Hello everyone,

The Design Systems Team is pleased to announce that ResourceLoader now supports basic code splitting for Codex components. The way this works is similar to how Codex icons already work: you list the components you need in your ResourceLoader module definition, and only the components you need will be bundled. This should be helpful for performance, reducing the amount of code that is loaded by loading only the components your feature needs, not the entire library. Most new and existing uses of Codex should be able to use this feature. If you maintain code that uses Codex, we recommend trying this out!

There's documentation for how to use this feature on the Codex page on mediawiki.org, and you can also look at the CodexExample extension for a more complete example of how to use this feature. If you have any questions, or run into any issues trying to use this feature, we're here to help, feel free to reply to this email or post on the Codex talk page on mediawiki.org.

So far we have only implemented the most basic iteration of code splitting. We plan on building some more advanced features to help with deduplication of components as well. For more details about our plans, see the epic task on Phabricator.

Roan Kattouw
Software engineer on the Design Systems Team at the Wikimedia Foundation