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

4.0 Migration docs not mentioning the need for e-auto-import in dependencies #602

Open
vlascik opened this issue Dec 13, 2022 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@vlascik
Copy link

vlascik commented Dec 13, 2022

I just tried to migrate my app to e-modifier v4 via yarn resolutions, and it broke the build on all the addons using the previous versions with messages like ember-basic-dropdown needs to depend on ember-auto-import in order to use ember-modifier

Turns out e-modifier 4.x is embroider v2 addon, and addons using it need to have ember-auto-import v2 in package.json dependencies, not just devDependencies.

Maybe the migration docs should mention this step, so that people are not surprised by it?

@SergeAstapov
Copy link
Collaborator

@vlascik sure it makes. Feel free to open PR to add such info

@ijlee2
Copy link

ijlee2 commented Dec 19, 2022

Hello, I'd like to get some clarification on a related problem.

For the ember-container-query@v3.0.0 release, I had intentionally limited the installed version of ember-modifier to v3.2.7 so that my addon could continue to support projects that can't use ember-auto-import@v2 at the moment.

As seen in ijlee2/ember-container-query#143, however, an end-developer may want to use yarn or pnpm resolutions, so that they can install just one version of ember-modifier (v4.x). In such case, my addon will cause the error, ember-container-query needs to depend on ember-auto-import in order to use ember-modifier.

What would you suggest that I (addons that have ember-modifier as a dependency) do? (The only solution that I could think of was to suggest end-developers, not use to resolutions for ember-modifier for the time being, to allow other Ember users some time to migrate their projects to ember-auto-import@v2. There may be better solutions that I'm missing.)

@SergeAstapov
Copy link
Collaborator

@ijlee2 I would suggest you to use "ember-modifier": "^3.2.7 || ^4.0.0" in your dependencies field e.g. like in https://github.com/adopted-ember-addons/ember-keyboard/blob/master/addon/package.json#L38

that would allow the consumer to choose the version needed.

e.g. if the consuming app has "ember-modifier": "^3.2.7" - that's what will be used.
if the consuming app has "ember-modifier": "^4.0.0" - v4 will be used.

I can confirm this works fine as that's what we have been doing in our app with npm and it works fine with yarn, see https://github.com/adopted-ember-addons/ember-keyboard/blob/master/.github/workflows/ci.yml#L134-L137

However, there is one caveat with suggested above approach: ember-container-query would need to have ember-auto-import@v2 in dependencies field to successfully use ember-modifier@v4 which would be a breaking change.

I've started the same in jelhan/ember-style-modifier#133 but didn't get a chance to push over the line.
I would suggest to do that sooner than later so we move ecosystem to ember-auto-import@v2/v2 Embroider native addon format.

@ijlee2
Copy link

ijlee2 commented Dec 19, 2022

@SergeAstapov Thanks for a prompt response and the link to an example repo. The solution of widening the version support and the caveat that comes along make sense to me.

Yes, for my addon's v4 release, I do plan to limit its support to ember-auto-import@v2 projects.

@ijlee2
Copy link

ijlee2 commented Dec 19, 2022

@SergeAstapov Sorry, can you clarify: in ember-keyboard, where do the maintainers declare ember-auto-import@v2 in dependencies? I didn't find it in the package.json that you linked above, and was wondering how CI had passed for the matrix scenarios ember-modifier@3.2 and ember-modifier@^4.0.0-beta.0.

@SergeAstapov
Copy link
Collaborator

@ijlee2 ember-keyboard is v2 addon hence it requires consumers to have ember-auto-import@v2 but it does not have ember-auto-import@v2 on it's own

@ijlee2
Copy link

ijlee2 commented Dec 19, 2022

Ah, understood. Thanks!

elwayman02 added a commit to elwayman02/ember-resize-modifier that referenced this issue Jan 3, 2023
With ember-modifier v4, it's now required to make e-a-i a dep instead of devDep. See also: ember-modifier/ember-modifier#602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants