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

What to do when my project uses ember-modifier@v4 #143

Closed
NullVoxPopuli opened this issue Dec 18, 2022 · 9 comments · Fixed by #162
Closed

What to do when my project uses ember-modifier@v4 #143

NullVoxPopuli opened this issue Dec 18, 2022 · 9 comments · Fixed by #162
Labels
bug Something isn't working enhance: dependency Issue asks for a new or updated dependency

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Dec 18, 2022

Describe the bug 🐞

When using ember-modifier v4 and ember-container-query v3, I get the following error during build time:

ember-container-query needs to depend on ember-auto-import in order to use ember-modifier

I saw that in the package.json, that ember-auto-import is not a dependency.
Maybe we can group a few things together:

Things we need

  • add ember-auto-import@v2 as a dependency (non-breaking? idk actually)
  • convert to v2 addon (optional, but highly recommended, as when all addons are v2, we can see build times drop to half of what they are now) -- we'd then no longer need ember-auto-import-v2
  • widen support for ember-modifier to v3 and v4 or change ember-modifier to be a peerDependency so we don't get multiple copies of ember-modifier attempted to be resolved in a consuming app.

Expected behavior 🤔

To be able to boot my app.

Minimal reproduction 🔬

Describe steps to reproduce the behavior:

  1. Use ember-container-query with ember-modifier-3
  2. Use ember-modifier v4
  3. try to boot your app
  4. error

NullVoxPopuli/limber#621

Environment 🌍

  • Ember: - n/a
  • Node.js/npm: - Node 18, pnpm v7.x
@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Dec 18, 2022
@ijlee2
Copy link
Owner

ijlee2 commented Dec 19, 2022

@NullVoxPopuli Thanks for using ember-container-query (I do need more examples) and reporting the issue with possible solutions.

My understanding was that, with ember-modifier@v4, this addon wouldn't be able to support projects that can't use ember-auto-import@v2 at the moment. So, for the v3.0.0 release, I limited the version of ember-modifier to v3.2.7.

(For this addon's v4 release, I do plan to support v2 addon format and list ember-auto-import@v2 as a dependency, so I'm glad to see your suggestions here.)

I had tested v3.0.0-alpha.0 in ember-workshop. This project uses ember-modifier@v4 for its own modifiers, but allows multiple versions of ember-modifier to be installed. I noticed that the limber project uses pnpm resolutions overrides; I wonder if it's possible to remove the resolution for ember-modifier for the time being.

I'll need some time to figure out the right solution. I'll keep an eye out for what other addons that depend on ember-modifier do.

@ijlee2 ijlee2 added the enhance: dependency Issue asks for a new or updated dependency label Dec 19, 2022
@ijlee2
Copy link
Owner

ijlee2 commented Dec 19, 2022

Related issue in ember-modifier: ember-modifier/ember-modifier#602

@NullVoxPopuli
Copy link
Contributor Author

I'm not using any resolutions atm in limber -- but i did tell pnpm to not log the error about me having ember-modifier at a newer version. I could probably remove that now that i've patched container query. Good eye!

Yarn1 is inherently flawed for basically everything and i can't trust that it's resolving things correctly.
I've wasted weeks of my life dealing with yarn related bugs. 😢

@ijlee2
Copy link
Owner

ijlee2 commented Dec 19, 2022

Oh. I did a superficial review of your pull request, and might have misunderstood how resolutions work in pnpm (guess the term is called "overrides" in pnpm). From the following line, I thought that you had installed just one version of ember-modifier (v4):

@NullVoxPopuli
Copy link
Contributor Author

Oh! No, I'm a space cadet and will remove that!
Thank you <3

@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Dec 19, 2022

Done here: NullVoxPopuli/limber#623

it works about the same -- because the error was reported from ember-cli-dependency-checker (or whatever it's called), and pnpm only organizes the deps correctly (compared to yarn)

@ijlee2 ijlee2 pinned this issue Dec 19, 2022
@ijlee2 ijlee2 changed the title Incompatible with ember-modifier v4 What to do when my project uses ember-modifier@v4 Dec 19, 2022
@ijlee2
Copy link
Owner

ijlee2 commented Dec 19, 2022

To recap, my current suggestion to the users is to allow multiple versions of ember-modifier (e.g. v3 and v4) to be installed. If ember-cli-dependency-lint is also installed, the configuration file will need to be updated. For example,

/* config/dependency-lint.js */

module.exports = {
  allowedVersions: {
    'ember-modifier': '4.0.0 || 3.2.7',
  },
};

Once [email protected] is released (see #144 for plans), we can mark this issue as fixed.

@NullVoxPopuli
Copy link
Contributor Author

seems like a reasonable work around for now -- esp if folks have big apps where a duplicate dependency shipped to their users doesn't impact them much. nice!

@ijlee2
Copy link
Owner

ijlee2 commented Mar 2, 2023

End-developers who would like to use ember-modifier@v4 may install [email protected] (if they are okay with an alpha release).

@ijlee2 ijlee2 unpinned this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhance: dependency Issue asks for a new or updated dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants