Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish ember-source as v2 addon #20787

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Publish ember-source as v2 addon #20787

wants to merge 2 commits into from

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.

1 participant