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

Make addon-shim a non-ember-addon #1069

Merged
merged 2 commits into from Jan 8, 2022
Merged

Make addon-shim a non-ember-addon #1069

merged 2 commits into from Jan 8, 2022

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Jan 8, 2022

This changes @embroider/addon-shim from being an ember addon to being a plain NPM library.

All v2 addons are required to depend on @embroider/addon-shim in order to interoperate with the rest of ember-cli.

A v2 addon that has any v1 addons as dependencies needs to get copied into our temporary work area so that it can resolve those v1 addons after they've been compiled to v2. Whereas a v2 addon with only v2 dependencies can stay inert in node_modules and impose nearly zero built-time cost.

This meant that having addon-shim as a v1 addon was de-optimizing all v2 addons. And we can't do addon-shim as a v2 addon because it explicitly exists to hook into the classic Addon instance machinery. But it turns out we don't even need a breaking change here, because consumers of addon-shim already invoke it explicitly in their own Addon instance.

Along with this change, I had to also adjust the resolving rules so that v2 addons that get to stay in the real node_modules see the correct ember virtual peer deps.

This changes `@embroider/addon-shim` from being an ember addon to being a plain NPM library.

All v2 addons are required to depend on `@embroider/addon-shim` in order to interoperate with the rest of ember-cli.

A v2 addon that has any v1 addons as dependencies needs to get copied into our temporary work area so that it can resolve those v1 addons *after* they've been compiled to v2. Whereas a v2 addon with only v2 dependencies can stay inert in node_modules and impose nearly zero built-time cost.

This meant that having addon-shim as a v1 addon was de-optimizing all v2 addons. And we can't do addon-shim as a v2 addon because it explicitly exists to hook into the classic Addon instance machinery.

Along with this change, I had to also adjust the resolving rules so that v2 addons that get to stay in the real node_modules see the correct ember virtual peer deps.
@ef4 ef4 added the enhancement New feature or request label Jan 8, 2022
@ef4 ef4 merged commit 30373fd into master Jan 8, 2022
@ef4 ef4 deleted the plain-addon-shim branch January 8, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant