ember-cli-babel icon indicating copy to clipboard operation
ember-cli-babel copied to clipboard

Move @babel/core to peerDependencies to reduce dependency resolution …

Open NullVoxPopuli opened this issue 3 years ago • 4 comments

…confusion

Following the advice here: https://github.com/ember-cli/ember-cli/pull/9934#issuecomment-1210078896

The eventual perceived fix for users is that when using strict package managers (npm 8, yarn2+, pnpm, etc) is that when they are told to specify a missing peer, @babel/core, the @babel/core they specify will be the one used by ember-cli-babel.

@babel/core will eventually be added to the app and addon blueprints in https://github.com/ember-cli/ember-cli/pull/9934

NullVoxPopuli avatar Aug 10 '22 14:08 NullVoxPopuli

I have 8 failures when I run the tests -- but those 8 failures also exist on master so.... that's fun

NullVoxPopuli avatar Aug 10 '22 14:08 NullVoxPopuli

You need a devDependency too.

(This is an example of the confusing fallout from making v1 addons be their own test-app too, in a single package. The package.json has two meanings. It needs to do the work that a consuming app would do (put @babel/core in devDependencies) while also doing the work of the addon (put @babel/core in peerDependencies).

ef4 avatar Aug 10 '22 16:08 ef4

devDependency is there

NullVoxPopuli avatar Aug 10 '22 16:08 NullVoxPopuli

Oops, sorry, somehow I looked right at it and didn't see it. 😛

ef4 avatar Aug 10 '22 16:08 ef4

I think we can make the argument that this is a bugfix instead of breaking change because people were already experiencing peer dep warnings and/or failures depending on their package manager, so documenting the fact that you already needed this peer dep to avoid those issues is only a bug fix.

ef4 avatar Sep 08 '22 18:09 ef4

This seems ready to go?

bertdeblock avatar Sep 10 '22 18:09 bertdeblock

It was pointed out to me that this really is probably breaking, because it's not the addition to peerDependencies that is the big problem, it's the removal from dependencies.

ef4 avatar Sep 15 '22 18:09 ef4

I still think we should do it, we can make this ember-cli-babel 8.

I know a traditional reason not to do a major release here was to save it for a babel major release, but this change means we're decoupled from the babel version anyway.

ef4 avatar Sep 15 '22 18:09 ef4

Sounds good to me -- as long as we can specify in the release notes that resolutions / overrides can still be used to collapse all ember-cli-babel versions down to 1 version in folks dep-trees, and v8 would still be compatible with their projects, provided they add @babel/core (and likely meet other criteria we move as a part of the major (node engines, etc))

NullVoxPopuli avatar Sep 15 '22 19:09 NullVoxPopuli

Discussed with ember-cli core team and agreed to merge this, once we see it run CI. For some reason that hasn't happened yet. Investigating.

Also, the plan to release this is tracked in https://github.com/babel/ember-cli-babel/issues/453 which I will fill out with more details.

ef4 avatar Sep 28 '22 17:09 ef4

@NullVoxPopuli I added a test commit and dropped it again to trigger CI, hope you don't mind!

bertdeblock avatar Oct 01 '22 14:10 bertdeblock

CI is green, so I'm merging!

bertdeblock avatar Oct 01 '22 15:10 bertdeblock