webiny-v5-to-v6-migration

Converts Webiny v5 plugin-based code to v6 feature-based dependency injection architecture.

8.0k|673|Updated Jan 9, 2018
One-click install
npx skills add https://github.com/webiny/webiny-js --skill webiny-v5-to-v6-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webiny-v5-to-v6-migration
Source: https://github.com/webiny/webiny-js/tree/main/skills/user-skills/api/v5-to-v6-migration
Command: npx skills add https://github.com/webiny/webiny-js --skill webiny-v5-to-v6-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating Webiny projects from v5 to v6 requires rewriting plugin-based code into a feature-based dependency injection architecture, and developers often struggle to map old patterns like ContextPlugin, event subscriptions, and GraphQL schema plugins to their v6 equivalents.

Core Features & Use Cases

  • Pattern-by-Pattern Migration Guides: Provides side-by-side v5 and v6 code examples for 11 patterns including ContextPlugin to DI services, event subscriptions to EventHandlers, and plugin arrays to feature registration.
  • Comprehensive Migration Maps: Includes lookup tables mapping v5 context methods to v6 UseCases, lifecycle subscriptions to EventHandlers, plugin classes to v6 abstractions, and React admin plugins to the AdminConfig API.
  • Common Mistake Prevention: Documents six frequent migration errors such as attaching services to context, naming features by technical events, and inlining business logic in handlers.
  • Use Case: An AI agent tasked with upgrading a Webiny v5 extension can use this Skill to convert a Lingotek translation ContextPlugin into a v6 DI-registered service with an EventHandler feature, following the exact code templates provided.

Quick Start

Migrate my Webiny v5 ContextPlugin and onEntryAfterCreate subscription code to the v6 feature-based DI architecture.

Frequently Asked Questions about webiny-v5-to-v6-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a Webiny v5 ContextPlugin to v6?

Replace the ContextPlugin with a v6 DI service: define an interface using createAbstraction, implement it in a class, export it via createImplementation, and register it in a createFeature container. Consumers receive the service through constructor injection instead of the context object.

How to convert v5 event subscriptions to v6 EventHandlers?

Create a class implementing the corresponding EventHandler interface, such as EntryAfterCreateEventHandler, with a handle method receiving the event payload. Register it in a feature container and filter by model.modelId since handlers fire for all models.

What replaces GraphQLSchemaPlugin in Webiny v6?

GraphQLSchemaPlugin is replaced by GraphQLSchemaFactory in v6. Similarly, CmsModelPlugin becomes ModelFactory, createSecurityRolePlugin becomes RoleFactory, and StorageTransformPlugin becomes StorageTransform, all registered through the DI container.

Does Webiny v6 still support the context object for services?

No, v6 removes the pattern of attaching services to the context object. Services must be defined as abstractions and registered in the DI container via createFeature, then injected as constructor dependencies into consumers.

What are common mistakes when migrating Webiny v5 to v6?

Common mistakes include creating one abstraction per operation instead of multi-method services, naming features by technical events rather than business capabilities, attaching services to context, and placing business logic directly inside event handlers instead of delegating to services.

How do v5 CMS permissions change in Webiny v6?

In v6, the content.i18n permission no longer exists and locale codes are removed. The models field becomes an array of modelId strings and groups becomes an array of group slug strings, while endpoint permissions like cms.endpoint.read remain unchanged.