Make addon-shim a non-ember-addon #1069
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.