Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.5.3
Choose a base ref
...
head repository: vuejs/vue-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.5.4
Choose a head ref
  • 6 commits
  • 15 files changed
  • 1 contributor

Commits on Mar 27, 2019

  1. Copy the full SHA
    3f14550 View commit details
  2. Copy the full SHA
    eeb350e View commit details

Commits on Mar 31, 2019

  1. fix: should not add polyfills from transform-runtime plugin (#3730)

    It is due to a misunderstanding when upgrading babel from 7.0.0-beta.47
    to 7.x.
    In Vue CLI, usage-based polyfills are **only** added by @babel/preset-env
    so that it avoids overheads. `transform-runtime` plugin adds polyfills
    regardless of env targets so we must disable its polyfill feature.
    Though, there're edge cases where runtime-helpers' polyfill dependency
    are not correctly added (babel/babel#7597),
    so we also need to whitelist `@babel/runtime` for webpack to transpile.
    haoqunjiang authored Mar 31, 2019
    Copy the full SHA
    b987969 View commit details
  2. Copy the full SHA
    9bdff3b View commit details
  3. Copy the full SHA
    5eb1425 View commit details
  4. v3.5.4

    haoqunjiang committed Mar 31, 2019
    Copy the full SHA
    d037fbb View commit details
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# [3.5.3](https://github.com/vuejs/vue-cli/compare/v3.5.2...v3.5.3) (2019-03-27)

## babel-preset-app

#### Bug Fixes

* downgrade [@babel](https://github.com/babel)/preset-env temporarily ([#3716](https://github.com/vuejs/vue-cli/issues/3716)) ([f107623](https://github.com/vuejs/vue-cli/commit/f107623))

## cli-service

#### Bug Fixes

* properly load non-js config files in genCacheConfig ([#3632](https://github.com/vuejs/vue-cli/issues/3632)) ([adac48d](https://github.com/vuejs/vue-cli/commit/adac48d)), closes [#3631](https://github.com/vuejs/vue-cli/issues/3631)
* set the path of safari-no-module-fix.js correctly ([#3647](https://github.com/vuejs/vue-cli/issues/3647)) ([10296ff](https://github.com/vuejs/vue-cli/commit/10296ff)), closes [#3033](https://github.com/vuejs/vue-cli/issues/3033)



# [3.5.2](https://github.com/vuejs/vue-cli/compare/v3.5.1...v3.5.2) (2019-03-27)

## babel-preset-app
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"npmClient": "yarn",
"useWorkspaces": false,
"version": "3.5.3",
"version": "3.5.4",
"packages": [
"packages/@vue/babel-preset-app",
"packages/@vue/cli*"
11 changes: 6 additions & 5 deletions packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ test('polyfill detection', () => {
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
expect(code).toMatch(genCoreJSImportRegExp('es6.array.iterator'))
// usage-based detection
expect(code).toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
expect(code).toMatch(/import "core-js\/modules\/es6.map"/)
})

test('modern mode always skips polyfills', () => {
@@ -63,7 +63,7 @@ test('modern mode always skips polyfills', () => {
// default includes
expect(code).not.toMatch(genCoreJSImportRegExp('es6.promise'))
// usage-based detection
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
expect(code).not.toMatch(/import "core-js\/modules\/es6.map"/)

;({ code } = babel.transformSync(`
const a = new Map()
@@ -78,7 +78,7 @@ test('modern mode always skips polyfills', () => {
// default includes
expect(code).not.toMatch(genCoreJSImportRegExp('es6.promise'))
// usage-based detection
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
expect(code).not.toMatch(/import "core-js\/modules\/es6.map"/)
delete process.env.VUE_CLI_MODERN_BUILD
})

@@ -107,7 +107,7 @@ test('async/await', () => {
// should use regenerator runtime
expect(code).toMatch(`import "regenerator-runtime/runtime"`)
// should use required helper instead of inline
expect(code).toMatch(/import _asyncToGenerator from ".*runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
expect(code).toMatch(/import _asyncToGenerator from ".*runtime\/helpers\/esm\/asyncToGenerator\"/)
})

test('jsx', () => {
@@ -152,5 +152,6 @@ test('disable absoluteRuntime', () => {
filename: 'test-entry-file.js'
})

expect(code).toMatch('import _toConsumableArray from "@babel/runtime-corejs2/helpers/esm/toConsumableArray"')
expect(code).toMatch('import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"')
expect(code).not.toMatch(genCoreJSImportRegExp('es6.promise'))
})
13 changes: 8 additions & 5 deletions packages/@vue/babel-preset-app/index.js
Original file line number Diff line number Diff line change
@@ -106,7 +106,10 @@ module.exports = (context, options = {}) => {
ignoreBrowserslistConfig,
configPath
})
plugins.push([require('./polyfillsPlugin'), { polyfills, entryFiles }])
plugins.push([
require('./polyfillsPlugin'),
{ polyfills, entryFiles, useAbsolutePath: !!absoluteRuntime }
])
} else {
polyfills = []
}
@@ -151,10 +154,10 @@ module.exports = (context, options = {}) => {
// transform runtime, but only for helpers
plugins.push([require('@babel/plugin-transform-runtime'), {
regenerator: useBuiltIns !== 'usage',
// use @babel/runtime-corejs2 so that helpers that need polyfillable APIs will reference core-js instead.
// if useBuiltIns is not set to 'usage', then it means users would take care of the polyfills on their own,
// i.e., core-js 2 is no longer needed.
corejs: (useBuiltIns === 'usage' && !process.env.VUE_CLI_MODERN_BUILD) ? 2 : false,

// polyfills are injected by preset-env & polyfillsPlugin, so no need to add them again
corejs: false,

helpers: useBuiltIns === 'usage',
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES,

3 changes: 1 addition & 2 deletions packages/@vue/babel-preset-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/babel-preset-app",
"version": "3.5.3",
"version": "3.5.4",
"description": "babel-preset-app for vue-cli",
"main": "index.js",
"publishConfig": {
@@ -30,7 +30,6 @@
"@babel/plugin-transform-runtime": "^7.4.0",
"@babel/preset-env": "^7.0.0 < 7.4.0",
"@babel/runtime": "^7.0.0",
"@babel/runtime-corejs2": "^7.2.0",
"@vue/babel-preset-jsx": "^1.0.0-beta.2",
"babel-plugin-dynamic-import-node": "^2.2.0",
"core-js": "^2.6.5"
24 changes: 13 additions & 11 deletions packages/@vue/babel-preset-app/polyfillsPlugin.js
Original file line number Diff line number Diff line change
@@ -2,20 +2,23 @@ const { addSideEffect } = require('@babel/helper-module-imports')

// slightly modifiled from @babel/preset-env/src/utils
// use an absolute path for core-js modules, to fix conflicts of different core-js versions
function getModulePath (mod) {
if (mod === 'regenerator-runtime') {
return require.resolve('regenerator-runtime/runtime')
}

return require.resolve(`core-js/modules/${mod}`)
function getModulePath (mod, useAbsolutePath) {
const modPath =
mod === 'regenerator-runtime'
? 'regenerator-runtime/runtime'
: `core-js/modules/${mod}`
return useAbsolutePath ? require.resolve(modPath) : modPath
}

function createImport (path, mod) {
return addSideEffect(path, getModulePath(mod))
function createImport (path, mod, useAbsolutePath) {
return addSideEffect(path, getModulePath(mod, useAbsolutePath))
}

// add polyfill imports to the first file encountered.
module.exports = ({ types }, { entryFiles = [] }) => {
module.exports = (
{ types },
{ polyfills, entryFiles = [], useAbsolutePath }
) => {
return {
name: 'vue-cli-inject-polyfills',
visitor: {
@@ -24,13 +27,12 @@ module.exports = ({ types }, { entryFiles = [] }) => {
return
}

const { polyfills } = state.opts
// imports are injected in reverse order
polyfills
.slice()
.reverse()
.forEach(p => {
createImport(path, p)
createImport(path, p, useAbsolutePath)
})
}
}
3 changes: 3 additions & 0 deletions packages/@vue/cli-plugin-babel/generator.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ module.exports = api => {
api.extendPackage({
babel: {
presets: ['@vue/app']
},
dependencies: {
'core-js': '^2.6.5'
}
})
}
5 changes: 5 additions & 0 deletions packages/@vue/cli-plugin-babel/index.js
Original file line number Diff line number Diff line change
@@ -40,6 +40,11 @@ module.exports = (api, options) => {
if (transpileDepRegex && transpileDepRegex.test(filepath)) {
return false
}
// may need to add polyfills (by preset-env) for babel helpers
// https://github.com/babel/babel/issues/7597
if (/node_modules\/@babel\/runtime/.test(filepath)) {
return false
}
// Don't transpile node_modules
return /node_modules/.test(filepath)
})
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-babel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-babel",
"version": "3.5.3",
"version": "3.5.4",
"description": "babel plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -21,7 +21,7 @@
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
"dependencies": {
"@babel/core": "^7.0.0",
"@vue/babel-preset-app": "^3.5.3",
"@vue/babel-preset-app": "^3.5.4",
"@vue/cli-shared-utils": "^3.5.1",
"babel-loader": "^8.0.5",
"webpack": ">=4 < 4.29"
6 changes: 3 additions & 3 deletions packages/@vue/cli-service-global/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-service-global",
"version": "3.5.3",
"version": "3.5.4",
"description": "vue-cli-service global addon for vue-cli",
"main": "index.js",
"publishConfig": {
@@ -22,8 +22,8 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-build#readme",
"dependencies": {
"@vue/babel-preset-app": "^3.5.3",
"@vue/cli-plugin-babel": "^3.5.3",
"@vue/babel-preset-app": "^3.5.4",
"@vue/cli-plugin-babel": "^3.5.4",
"@vue/cli-plugin-eslint": "^3.5.1",
"@vue/cli-service": "^3.5.3",
"babel-eslint": "^10.0.1",
4 changes: 2 additions & 2 deletions packages/@vue/cli-ui-addon-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-ui-addon-webpack",
"version": "3.5.3",
"version": "3.5.4",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
@@ -18,7 +18,7 @@
},
"license": "MIT",
"devDependencies": {
"@vue/cli-plugin-babel": "^3.5.3",
"@vue/cli-plugin-babel": "^3.5.4",
"@vue/cli-plugin-eslint": "^3.5.1",
"@vue/cli-service": "^3.5.3",
"@vue/eslint-config-standard": "^4.0.0",
4 changes: 2 additions & 2 deletions packages/@vue/cli-ui-addon-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-ui-addon-widgets",
"version": "3.5.3",
"version": "3.5.4",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
@@ -18,7 +18,7 @@
},
"license": "MIT",
"devDependencies": {
"@vue/cli-plugin-babel": "^3.5.3",
"@vue/cli-plugin-babel": "^3.5.4",
"@vue/cli-plugin-eslint": "^3.5.1",
"@vue/cli-service": "^3.5.3",
"@vue/eslint-config-standard": "^4.0.0",
4 changes: 2 additions & 2 deletions packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-ui",
"version": "3.5.3",
"version": "3.5.4",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
@@ -61,7 +61,7 @@
"watch": "^1.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.5.3",
"@vue/cli-plugin-babel": "^3.5.4",
"@vue/cli-plugin-e2e-cypress": "^3.5.1",
"@vue/cli-plugin-eslint": "^3.5.1",
"@vue/cli-service": "^3.5.3",
8 changes: 4 additions & 4 deletions packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli",
"version": "3.5.3",
"version": "3.5.4",
"description": "Command line interface for rapid Vue.js development",
"bin": {
"vue": "bin/vue.js"
@@ -25,9 +25,9 @@
},
"dependencies": {
"@vue/cli-shared-utils": "^3.5.1",
"@vue/cli-ui": "^3.5.3",
"@vue/cli-ui-addon-webpack": "^3.5.3",
"@vue/cli-ui-addon-widgets": "^3.5.3",
"@vue/cli-ui": "^3.5.4",
"@vue/cli-ui-addon-webpack": "^3.5.4",
"@vue/cli-ui-addon-widgets": "^3.5.4",
"chalk": "^2.4.1",
"cmd-shim": "^2.0.2",
"commander": "^2.16.0",
22 changes: 11 additions & 11 deletions packages/vue-cli-version-marker/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "vue-cli-version-marker",
"version": "3.5.2",
"version": "3.5.3",
"description": "version marker for @vue/cli",
"author": "Evan You",
"license": "MIT",
"main": "package.json",
"devDependencies": {
"@vue/babel-preset-app": "3.5.2",
"@vue/babel-preset-app": "3.5.3",
"@vue/cli-init": "3.5.1",
"@vue/cli-overlay": "3.5.1",
"@vue/cli-plugin-babel": "3.5.2",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-e2e-cypress": "3.5.1",
"@vue/cli-plugin-e2e-nightwatch": "3.5.1",
"@vue/cli-plugin-eslint": "3.5.1",
"@vue/cli-plugin-pwa": "3.5.1",
"@vue/cli-plugin-typescript": "3.5.2",
"@vue/cli-plugin-unit-jest": "3.5.2",
"@vue/cli-plugin-typescript": "3.5.3",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-plugin-unit-mocha": "3.5.1",
"@vue/cli-service-global": "3.5.2",
"@vue/cli-service": "3.5.2",
"@vue/cli-service-global": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/cli-shared-utils": "3.5.1",
"@vue/cli-test-utils": "3.5.1",
"@vue/cli-ui-addon-webpack": "3.5.2",
"@vue/cli-ui-addon-widgets": "3.5.2",
"@vue/cli-ui": "3.5.2",
"@vue/cli-ui-addon-webpack": "3.5.3",
"@vue/cli-ui-addon-widgets": "3.5.3",
"@vue/cli-ui": "3.5.3",
"@vue/cli-upgrade": "3.5.1",
"@vue/cli": "3.5.2"
"@vue/cli": "3.5.3"
}
}