Similar to how extensions can use Codex code splitting by using CodexModule and declaring the Codex components they use in extension.json (T349423), the same mechanism should be exposed to gadgets as well, by adding a codexComponents field in gadget definitions.
Description
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T313945 [EPIC] Enable gadget and user-script developers to use Vue and Codex | |||
| Open | Feature | None | T383248 Support Codex code splitting in gadgets |
Event Timeline
Comment Actions
Like, maybe this should be just about having access to Codex Vue components in gadgets, not specifically requiring it to use the same mechanism as RL modules.
Comment Actions
Gadgets can already use Codex components by declaring a dependency on @wikimedia/codex module (although they are easier to use only once T340460 is resolved). What's missing is the ability to load parts of Codex instead of the entire library.
As for some background, gadgets are also RL modules – defined on-wiki through MediaWiki:Gadgets-definition and consisting of on-wiki code. The definition format (see mw:Extension:Gadgets#Definition_format) supports setting dependencies on other RL modules. To resolve this ticket, it could be extended to also support setting codexComponents.