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

Using polyfill when addon is not declaring a (peer) dependency on ember-source #212

Open
simonihmig opened this issue Apr 12, 2023 · 0 comments

Comments

@simonihmig
Copy link
Contributor

#184 uses dependencySatisfies to check for a good enough version of Ember to use @cached directly from @glimmer/tracking. However dependencySatisfies is quite strict on what it expects from declared package dependencies, as it will always return false (and which case the polyfilled version will get used) when the dependency (here ember-source) is not declared explicitly as a (peer) dependency. But this is the case for a lot of addons (most of them probably), given that also the addon blueprint added that only more recently.

I wonder how we should deal with that? At least we should document that addons that have ember-cached-decorator-polyfill as a dependency should also explicitly declare a peer dependency on ember-source.

Another way to look at it is maybe making dependencySatisfies less strict (which is not related to this repo here, but still mentioning this within this context)? What it does is right, but maybe it's just too strict compared to what the ecosystem has historically been? We could maybe introduce a special case for only ember-source (as so often we check for the version of that, and also addons have traditionially always assumed it's just there without bothering to declare an explicit dependency), and do the normal package resolve and version check even without a declared dependency in this narrow case?

/cc @ef4

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

1 participant