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

All addons may need emberVirtualPeerDep handling #1509

Merged
merged 1 commit into from
Jul 2, 2023
Merged

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Jul 2, 2023

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.

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.
@ef4 ef4 added the bug Something isn't working label Jul 2, 2023
@ef4 ef4 merged commit 326562b into main Jul 2, 2023
372 checks passed
@ef4 ef4 deleted the virtual-peer-fix branch July 2, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants