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

this.parent.registerV2Addon is not a function for nested v2 addons #1108

Closed
simonihmig opened this issue Feb 4, 2022 · 4 comments
Closed

Comments

@simonihmig
Copy link
Collaborator

Scheduled CI run revealed today this error. ember-stargate - a v2 addon that hasn't upgraded to v1 of @embroider/addon-shim yet - depends on ember-resources - another v2 which on the a minor version updated to v1 of @embroider/addon-shim. As you can see in the CI job, for the base scenario with locked dependencies it passes, but for all floatings deps it fails with the afore mentioned error.

It is probably related to #1069 and this line. So that looks like a dependency conflict when the v2 addon using the latest addon-shim is a dependency of one that hasn't upgraded yet.

I don't know if this needs fixing, I can and will certainly upgrade ember-stargate. But at least we can throw a better error when registerV2Addon does not exist?

Also, in that case when an addon upgraded to v1 of addon-shim, this now must be regarded a breaking change it seems, so ember-resources should have done a major bump probably? cc @NullVoxPopuli

@NullVoxPopuli
Copy link
Collaborator

NullVoxPopuli commented Feb 4, 2022

should have done a major bump probably?

Probably yeah.

I don't know how to best communicate these sorts of things.

Downgrade, re-release, upgrade, major bump?

@ef4
Copy link
Contributor

ef4 commented Feb 4, 2022

Oops, I didn't consider this combination. 🤦

This was actually released in addon-shim 0.50.0. So that is where the breakage happens -- once you upgrade to that, v2 addons that consume you will break if they are older than that.

I think we can fix this in addon-shim so it doesn't break. That would be best. Because while a better error would help, it still might hit people deep inside their transitive dependencies where they can't do much about it.

@simonihmig
Copy link
Collaborator Author

I think we can fix this in addon-shim so it doesn't break.

FWIW, I merged the renovate PR to update all things embroider, which made CI happy again, and published a new release. So while a general fix would be nice, given that we have, what?, a handful of v2 addons, the particular combination of addons and dependencies yielding that error is most likely the only one we have currently, so the time spent on fixing this is probably invested more effectively on... something else? 🤷‍♂️

Yes, I reported this, and I think it's good to be aware of this possible cause of error, but I wouldn't mind tbh if we just keep this in mind for the future, and keep things as they are now...

@ef4
Copy link
Contributor

ef4 commented Feb 4, 2022

Yeah I agree, and my initial reaction was going to be: well, anybody who is maintaining a V2 addon is a pretty advanced and with-it community member who can probably absorb this change quickly.

If this is quick and easy I'll still do it, if it doesn't get fixed v2 addon authors will probably have little trouble going to 1.0 anyway and probably should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants