-
Notifications
You must be signed in to change notification settings - Fork 142
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
Remove 'peerDependencies' from 'dependencyKeys' to align with ember-cli #728
Conversation
This is just how NPM packages are supposed to behave. And v2 addons definitely need it because there's no other way to resolve something out of the app. If we want classic addons to not do this, we should delete their peerDependencies while we're rewriting them from v1 to v2. |
Yeah, it's possible we need to tackle this from a different angle. The main issue isn't the existence of |
Ah ha, I think I see where the change needs to happen (though I don't 100% see how to do it just yet): The |
That sounds promising. 👍 The other place I was mentioning is here, where we already delete some things from package.json. But if you only need to change the engine splitting behavior, that's even better |
a0b3f3c
to
3dc22c7
Compare
Updated with a new approach: limiting it to only excluding
I suspect there's a corner case that I'm missing with that logic, but it seems sound on the surface. If that's true, then it may be cleaner to simply skip over them entirely. |
3dc22c7
to
e89708f
Compare
I'm suggesting this change on top of embroider-build#728 because I'd rather keep this behavior local to child addon discovery and not make it be something that's part of the Package's API. This should still provide the same performance benefit, because even though we will now examine the peerDeps before filtering them out, that work is guarded by the PackageCache and won't actually be repeated unnecessarily. The main thing we're trying to avoid is building many copies of each peerDep per consuming addon.
@charlespierce I suggested a change in charlespierce#1. Can you can confirm that it still provides the desired performance benefit in your app? |
move peerDep check into activeAddonChildren
Hi @ef4 yep, confirmed that solves the problem as well and merged it into the PR branch. My only concern is if an addon has a dependency listed in However, since a consuming app would then lose that addon dependency (even if it was installed separately, because the classic build would ignore both devDeps and peerDeps), so that seems like an anti-pattern anyway. |
Yeah, I sat and pondered that case myself and decided I could live with it. 😄 Thanks! |
Info
peerDependencies
as part of theapp-js
when merging lazy engines.ember-cli
, which completely ignorespeerDependencies
.peerDependencies
on something that is included by the root app.Changes
addonDependencies
getter toPackage
, mirroring whatdependencies
does but excluding those dependencies inpeerDependencies
addonDependencies
in theMovedPackageProxy
so that moved packages will be handled correctly as well.activeAddonChildren
to crawl theaddonDependencies
instead of the fulldependencies
list to get the child addons.Notes
ember-canary
tests failing due to new deprecation warnings.