Skip to content

Commit

Permalink
fix: pin babel version (fix #1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 25, 2018
1 parent fb013da commit dbc3f10
Show file tree
Hide file tree
Showing 5 changed files with 528 additions and 336 deletions.
4 changes: 2 additions & 2 deletions packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ test('object spread', () => {
const { code } = babel.transformSync(`
const a = { ...b }
`.trim(), defaultOptions)
expect(code).toMatch(`import "core-js/modules/es6.object.assign"`)

This comment has been minimized.

Copy link
@hzoo

hzoo Apr 26, 2018

If you want this back (probably do), can pass loose: true and useBuiltIns: true. This is since someone made a PR to add more spec behavior by default

This comment has been minimized.

Copy link
@yyx990803

yyx990803 Apr 26, 2018

Author Member

useBuiltIns no longer accept true - it's either usage or entry now. With just loose: true it doesn't seem to revert to old behavior.

This comment has been minimized.

Copy link
@yyx990803

yyx990803 Apr 26, 2018

Author Member

Oh nvm, I'm looking at the wrong preset ;)

This comment has been minimized.

Copy link
@yyx990803

yyx990803 Apr 26, 2018

Author Member

Looks like preset-stage-3 is not passing along the loose flag to proposal-object-rest-spread: https://github.com/babel/babel/blob/master/packages/babel-preset-stage-3/src/index.js#L36

This comment has been minimized.

Copy link
@hzoo

hzoo Apr 26, 2018

Oh we should def fix that then! Although were thinking of just removing the stage 0-2 presets since it's better for people to opt-in to them anyway? babel/babel#7770

expect(code).toMatch(`var a = Object.assign({}, b)`)
expect(code).toMatch(`import _objectSpread from`)
expect(code).toMatch(`var a = _objectSpread({}, b)`)
})

test('dynamic import', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/babel-preset-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (context, options = {}) => {
// and rest object spread.
presets.push([require('@babel/preset-stage-2'), {
useBuiltIns: true,
decoratorsLegacy: options.decoratorsLegacy || false
decoratorsLegacy: options.decoratorsLegacy !== false
}])

// transform runtime, but only for helpers
Expand Down
10 changes: 5 additions & 5 deletions packages/@vue/babel-preset-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
},
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/babel-preset-app#readme",
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.0.0-0",
"@babel/plugin-transform-runtime": "^7.0.0-0",
"@babel/preset-env": "^7.0.0-0",
"@babel/preset-stage-2": "^7.0.0-0",
"@babel/runtime": "^7.0.0-0",
"@babel/plugin-syntax-jsx": "7.0.0-beta.46",
"@babel/plugin-transform-runtime": "7.0.0-beta.46",
"@babel/preset-env": "7.0.0-beta.46",
"@babel/preset-stage-2": "7.0.0-beta.46",
"@babel/runtime": "7.0.0-beta.46",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-transform-vue-jsx": "^4.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/cli-plugin-babel#readme",
"dependencies": {
"@babel/core": "^7.0.0-0",
"@babel/core": "7.0.0-beta.46",
"@vue/babel-preset-app": "^3.0.0-beta.6",
"babel-loader": "^8.0.0-0"
},
Expand Down
Loading

0 comments on commit dbc3f10

Please sign in to comment.