All addons may need emberVirtualPeerDep handling #1509
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.
As the old comment here implied, this was relying on the assumption that auto-upgraded packages would never be at risk of accidentally resolving un-rewritten emberVirtualPeerDeps because they would necessarily resolve from our rewritten node_modules. But that is no longer true, so in complicated monorepo environments it is possible for them to see a copy of an emberVirtualPeerDep that isn't actually in use and therefore isn't rewritten to v2.
This change expands the behavior that we used to only use for native v2 addons to all addons.
Addons can still avoid being impacted by this compatbility feature if they declare their own dependencies explicity. That is, you have a dep or peerDep on
@glimmer/component
or@ember/string
, etc, you will get exactly the range you asked for. If you don't have any such dependency, you can still use those packages but you get the app's active copy.