vue-cli icon indicating copy to clipboard operation
vue-cli copied to clipboard

Please update babel dependencies.

Open 634750802 opened this issue 8 years ago • 23 comments

What problem does this feature solve?

The official babel 7.0.0 has been released, but the version used by @vue/babel-preset-app is 'beta.47'.

Thanks for your efforts to create such a great framework.

What does the proposed API look like?

Update babel dependencies' version from '7.0.0-beta.47' to '7.0.0'.

634750802 avatar Aug 28 '18 09:08 634750802

@634750802 Shouldn't "babel-core" deps also be changed to "@babel/core"?

corbinu avatar Aug 28 '18 23:08 corbinu

@corbinu Which package.json file? In packages/@vue/babel-preset-app/package.json there is no "babel-core".

634750802 avatar Aug 29 '18 02:08 634750802

it is used a few places including the main package.json and the jest generator

corbinu avatar Aug 29 '18 02:08 corbinu

The main "babel-core" dep is under version 7.0.0-bridge. I think this may be a feature.

634750802 avatar Aug 29 '18 02:08 634750802

Yes as in it was the "bridge" until 7.0.0 was released ... @babel/core replaces it.

screen shot 2018-08-28 at 8 52 54 pm

corbinu avatar Aug 29 '18 03:08 corbinu

I'm not sure about what the bridge used for. Does it affect the babel compiler? I found another '@babel/core' dep in '@vue/cli-plugin-babel' which I think is the dep that babel used in fact.

634750802 avatar Aug 29 '18 05:08 634750802

# yarn.lock
jest-config@^23.5.0:
  version "23.5.0"
  resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.5.0.tgz#3770fba03f7507ee15f3b8867c742e48f31a9773"
  dependencies:
    babel-core "^6.0.0"
    babel-jest "^23.4.2"
    chalk "^2.0.1"
    glob "^7.1.1"
    jest-environment-jsdom "^23.4.0"
    jest-environment-node "^23.4.0"
    jest-get-type "^22.1.0"
    jest-jasmine2 "^23.5.0"
    jest-regex-util "^23.3.0"
    jest-resolve "^23.5.0"
    jest-util "^23.4.0"
    jest-validate "^23.5.0"
    micromatch "^2.3.11"
    pretty-format "^23.5.0"

Maybe it is used for jest, which depends on babel 6. Should I upgrade jest dep in this issue or create a new one?

634750802 avatar Aug 29 '18 05:08 634750802

https://github.com/facebook/jest/tree/master/packages/babel-jest

634750802 avatar Aug 29 '18 05:08 634750802

Needs help, It's beyond my ability.

634750802 avatar Aug 29 '18 08:08 634750802

ok no worries

corbinu avatar Aug 29 '18 17:08 corbinu

jest needs [email protected] to work with @babel/core@^7.0.0. I believe the reason is that jest still imports babel core as babel-core, so the "bridge" is meant to force @babel/core to be imported.

vikr01 avatar Sep 08 '18 03:09 vikr01

Jest itself is ok with the bridge, but we need this PR to be merged:

https://github.com/airbnb/babel-plugin-dynamic-import-node/pull/64

As this plugin is still using babel 6

LinusBorg avatar Sep 17 '18 11:09 LinusBorg

@LinusBorg seems the v2.2.0 release support both babel 6 and 7 already, according to this comment https://github.com/airbnb/babel-plugin-dynamic-import-node/pull/64#issuecomment-428011905

axe-me avatar Oct 11 '18 18:10 axe-me

is this fixed? can somebody told me what to do? currently i have dependencies: { "@babel/core": "^7.1.2", } and devDependencies: { "babel-core": "7.0.0-bridge.0", "babel-jest": "^23.0.1", } and a lot more @babel plugin. but now each time i do npm isntall it says @babel/{plugins} requires a peer of @babel/[email protected] but none is installed.

i am confused, should i downgrade it to @babel/core 7.0.0-beta.47 ? or can i do something?

I use "@vue/cli-plugin-babel": "^3.0.1", "@vue/cli-plugin-eslint": "^3.0.3", "@vue/cli-plugin-unit-jest": "^3.0.1", "@vue/cli-service": "^3.0.1", "@vue/eslint-config-airbnb": "^3.0.3", "@vue/test-utils": "^1.0.0-beta.20",

the reason i want to know this was, bcs i failed to run the jest, and i tried to update this and that, but i still cant make it work

rgalaxy avatar Oct 23 '18 03:10 rgalaxy

@rgalaxy You need to upgrade those babel plugins.

vikr01 avatar Oct 23 '18 04:10 vikr01

@vikr01 hi vikr thanks for the reply, i already try to update babel plugins, but it still show the same, for instance i upgrade @babel/preset-env but it still show the message @babel/[email protected] requires a peer of @babel/[email protected] but none is installed. You must install peer dependencies yourself.

i dont understand, is it because there is a hidden plugin somewhere? and what's weird lot of the dependencies is not even ont package.json devdependencies. is it bcs vue cli 3 isntall it somewhere? even without showing on package.json?

rgalaxy avatar Oct 23 '18 04:10 rgalaxy

@rgalaxy It's a dependency of @vue/cli-plugin-babel. This is gonna be fixed in the next release. Maybe the errors are due to the "@babel/core": "^7.1.2" in the package.json suppressed dependency hoisting so for now you can remove this field to see if it works.

haoqunjiang avatar Oct 23 '18 04:10 haoqunjiang

@sodatea hi sodat, thanks for the reply, when you say 'This is gonna be fixed in the next release', it means i need to update my vue cli version and then reinstall? or will it update all the project inside and able to fix also the problems?

and i tried to remove all the @babel/ from my package.json, remove package-lock.json and run npm install, and.... guess what is still gaves me the errors.. and i can see this line [email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself. i am so ultra mega ultimately confused, i tried to create another vue-cli project and it works normally (without all the @babel/ thing)

rgalaxy avatar Oct 23 '18 05:10 rgalaxy

@rgalaxy Are you able to create a repo that reproduces the issue? Just with all babel dependencies you had installed.

vikr01 avatar Oct 23 '18 05:10 vikr01

i am not sure, can you suggest me where i can do this? @vikr01

rgalaxy avatar Oct 23 '18 07:10 rgalaxy