Skip to content

Conversation

@ef4
Copy link
Contributor

@ef4 ef4 commented Nov 6, 2024

This is intended as a fully non-breaking switch to publishing as a v2 addon. The published contents of the package have already been compliant with the v2 addon spec for some time, but this actually flips the setting.

Embroider builds will now be able to consume ember-source directly without ember-source going through any addon rewriting.

Classic builds will continue to get all pre-existing ember modules via the vendor.js bundle, because otherwise it would introduce observable differences in when the ember modules become available in the AMD loader. We achieved this by

  • extending (carefully) the @embroider/addon-shim so that it still emits treeForVendor in classic builds (this code is inert under embroider, since v2 addons cannot have treeForVendor).
  • using a new features in @embroider/addon-shim plus ember-auto-import to customize the ember-addon metadata when a v2 addon is consumed by ember-auto-import, so that we can remove the renamed-modules rules that would otherwise cause ember-auto-import to start managing the ember modules. Without this, we would get two copies of ember -- the webpack-provided one and the vendor.js provided one.

Going forward, any newly-added ember modules should not go into the legacy bundles and should instead by allowed to remain in the renamed-modules metadata so that they'll always be consumed through webpack+ember-auto-import, making them tree-shakeable even in all classic builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants