cibernox/ember-native-dom-helpers

Babel 6 upgrade?

Closed this issue · 6 comments

Hello,

We are using your package on an enterprise-level web application and I was wondering... why was this package upgraded to use a beta version of Babel 6 and released as a patch semversion?

I would think that using an unstable, unofficial beta version would warrant a major (or even minor) version bump.

Also, was there a reason it was added to dependencies in package.json rather than to devDependencies?

@mkay581 The fact that this addon uses babel6 should be irrelevant as babel5 and 6 can coexist. It doesn't mean that you have to update your application to babel6. It also doesn't mean that if you do, addons that still use babel5 will break.
It should be transparent for you.

I'm unsure of what you mean by

babel5 and 6 can coexist.

You can only have one version of an npm package running at one time. The dependencies specified in app's dependencies are used. Are you saying that going from ember-cli-babel 5.1.7 -> 6.0.0-beta.4 is safe enough to use without regression?

@mkay581 That's unnacurate. If this addon depends on babel6 and your app depends on babel5, both packages will be installed. The files of this addon will be transpiled with babel6 and the files in the rest of your app will be transpiled with babel5.

This works like this by design. Every addon is in charge of it's own transpilation so different versions of babel can coexist. Once babel7 comes your chances are you will have a mix of babel 5, 6 and 7 and you will not know about it.

I see. Looked at this with another coworker and it appears that each package has its own version like you say. I was more concerned about how this worked with other dependencies that we have (we don't specify an ember-cli-babel package directly. I suspect that this wouldn't work by design if the maintainers of those dependencies are not declaring their own version of the package (it would use yours i think).

Also, just curious though... what was the reason it was added to dependencies over devDependencies?

If a dependency doesn't specify any babel version then the version in your app (and you have control over it) will be the used one.

About it being a dependency and not a devDependency, this is what all ember addons do, and it is PRECISELY the reason why several versions of babel can coexist. The idea is that addons specify how they are transpiled, avoiding the kind of problems you though you would have.

Since babel6, if you make use of the targets feature (http://rwjblue.com/2017/04/21/ember-cli-targets/), addons will honor those preferences too.

Great, thanks for that insight! Will close issue.