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: nuxt/nuxt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.14.6
Choose a base ref
...
head repository: nuxt/nuxt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.14.7
Choose a head ref

Commits on Sep 28, 2020

  1. Copy the full SHA
    d7a8548 View commit details

Commits on Sep 30, 2020

  1. chore(deps): update all non-major dependencies (#8131)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Sep 30, 2020
    Copy the full SHA
    3aa02cf View commit details
  2. Copy the full SHA
    79440f3 View commit details
  3. fix(vue-app): use mixin to provide this.$nuxt (#8068)

    Co-authored-by: Clark Du <clark.duxin@gmail.com>
    danielroe and clarkdo authored Sep 30, 2020
    Copy the full SHA
    8abdc17 View commit details
  4. chore(deps): lock file maintenance (#8126)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Sep 30, 2020
    Copy the full SHA
    afc2e2a View commit details
  5. Revert "fix(vue-app): use mixin to provide this.$nuxt (#8068)"

    This reverts commit 8abdc17.
    clarkdo committed Sep 30, 2020
    Copy the full SHA
    61e93d0 View commit details

Commits on Oct 6, 2020

  1. Copy the full SHA
    dfaa196 View commit details

Commits on Oct 8, 2020

  1. Copy the full SHA
    34f3211 View commit details
  2. Copy the full SHA
    202f355 View commit details
  3. chore(deps): update all non-major dependencies (#8137)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2020
    Copy the full SHA
    f0c1375 View commit details
  4. chore(deps): update dependency upath to v2 (#8157)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2020
    Copy the full SHA
    1b1ef37 View commit details
  5. chore(deps): lock file maintenance (#8147)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2020
    Copy the full SHA
    05353fc View commit details

Commits on Oct 9, 2020

  1. Copy the full SHA
    81030be View commit details
  2. chore(deps): update dependency @types/node to ^12.12.67 (#8171)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 9, 2020
    Copy the full SHA
    00c9dc3 View commit details

Commits on Oct 10, 2020

  1. Copy the full SHA
    a748cf0 View commit details

Commits on Oct 13, 2020

  1. chore(deps): lock file maintenance (#8191)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2020
    Copy the full SHA
    a52b5af View commit details
  2. Copy the full SHA
    9c4dac3 View commit details
  3. chore(deps): update all non-major dependencies (#8177)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2020
    Copy the full SHA
    5b87d1c View commit details
  4. Copy the full SHA
    819afcd View commit details
  5. chore(deps): update all non-major dependencies (#8197)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2020
    Copy the full SHA
    b533877 View commit details
  6. chore: update yarn.lock

    pi0 committed Oct 13, 2020
    Copy the full SHA
    7e1ecfe View commit details
  7. chore(deps): update dependency @nuxt/opencollective to ^0.3.2 (#8201)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2020
    Copy the full SHA
    5842a64 View commit details

Commits on Oct 14, 2020

  1. Copy the full SHA
    d9f4822 View commit details
  2. fix(babel-preset-app): always transpile optional chaining and nullish…

    …-coalescing for server (#8203)
    pi0 authored Oct 14, 2020
    Copy the full SHA
    c75ac80 View commit details

Commits on Oct 15, 2020

  1. chore(deps): update all non-major dependencies to ^7.12.0 (#8207)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 15, 2020
    Copy the full SHA
    044d07c View commit details
  2. fix: add better logs for DX with target option (#8206)

    * fix: add better logs for DX with target option
    
    * chore: add warning for old nuxt build in ssr false
    
    * Update generator.js
    
    * Update generate.js
    
    * chore: better logs
    
    * fix: update
    atinux authored Oct 15, 2020
    Copy the full SHA
    7e7190b View commit details
  3. v2.14.7

    [release]
    pi0 committed Oct 15, 2020
    Copy the full SHA
    265d0e7 View commit details
Showing with 915 additions and 752 deletions.
  1. +4 −4 distributions/nuxt-start/package.json
  2. +7 −7 distributions/nuxt/package.json
  3. +0 −1 examples/layout-transitions/package.json
  4. +2 −4 examples/layout-transitions/pages/users-2.vue
  5. +1 −3 examples/layout-transitions/pages/users.vue
  6. +1 −1 lerna.json
  7. +7 −7 package.json
  8. +8 −6 packages/babel-preset-app/package.json
  9. +6 −0 packages/babel-preset-app/src/index.js
  10. +6 −6 packages/builder/package.json
  11. +2 −4 packages/builder/src/builder.js
  12. +4 −4 packages/cli/package.json
  13. +2 −0 packages/cli/src/commands/generate.js
  14. +7 −12 packages/cli/src/run.js
  15. +5 −4 packages/cli/src/utils/config.js
  16. +19 −4 packages/cli/src/utils/generate.js
  17. +8 −2 packages/cli/test/unit/run-edge.test.js
  18. +5 −3 packages/cli/test/unit/utils.test.js
  19. +2 −2 packages/config/package.json
  20. +5 −5 packages/core/package.json
  21. +3 −3 packages/generator/package.json
  22. +10 −1 packages/generator/src/generator.js
  23. +4 −4 packages/server/package.json
  24. +1 −1 packages/types/config/index.d.ts
  25. +1 −1 packages/types/config/server-middleware.d.ts
  26. +3 −3 packages/types/package.json
  27. +1 −1 packages/utils/package.json
  28. +3 −3 packages/vue-app/package.json
  29. +2 −1 packages/vue-app/template/App.js
  30. +7 −0 packages/vue-app/template/index.js
  31. +5 −5 packages/vue-app/template/router.scrollBehavior.js
  32. +6 −0 packages/vue-app/template/utils.js
  33. +2 −2 packages/vue-renderer/package.json
  34. +6 −6 packages/webpack/package.json
  35. +13 −0 test/dev/ssr.test.js
  36. +6 −0 test/fixtures/full-static/nuxt.config.js
  37. +10 −0 test/fixtures/ssr/pages/context.vue
  38. +6 −0 test/fixtures/ssr/pages/context/_id.vue
  39. +725 −642 yarn.lock
8 changes: 4 additions & 4 deletions distributions/nuxt-start/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-start",
"version": "2.14.6",
"version": "2.14.7",
"description": "Starts Nuxt.js Application in production mode",
"keywords": [
"nuxt",
@@ -55,15 +55,15 @@
"dist"
],
"dependencies": {
"@nuxt/cli": "2.14.6",
"@nuxt/core": "2.14.6",
"@nuxt/cli": "2.14.7",
"@nuxt/core": "2.14.7",
"@nuxt/telemetry": "^1.2.3",
"node-fetch": "^2.6.1",
"vue": "^2.6.12",
"vue-client-only": "^2.0.0",
"vue-meta": "^2.4.0",
"vue-no-ssr": "^1.1.1",
"vue-router": "^3.4.3",
"vue-router": "^3.4.6",
"vuex": "^3.5.1"
},
"engines": {
14 changes: 7 additions & 7 deletions distributions/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt",
"version": "2.14.6",
"version": "2.14.7",
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"keywords": [
"nuxt",
@@ -58,16 +58,16 @@
"postinstall": "opencollective || exit 0"
},
"dependencies": {
"@nuxt/builder": "2.14.6",
"@nuxt/cli": "2.14.6",
"@nuxt/builder": "2.14.7",
"@nuxt/cli": "2.14.7",
"@nuxt/components": "^1.1.0",
"@nuxt/core": "2.14.6",
"@nuxt/generator": "2.14.6",
"@nuxt/core": "2.14.7",
"@nuxt/generator": "2.14.7",
"@nuxt/loading-screen": "^2.0.2",
"@nuxt/opencollective": "^0.3.0",
"@nuxt/opencollective": "^0.3.2",
"@nuxt/static": "^1.0.0",
"@nuxt/telemetry": "^1.2.3",
"@nuxt/webpack": "2.14.6"
"@nuxt/webpack": "2.14.7"
},
"engines": {
"node": ">=8.9.0",
1 change: 0 additions & 1 deletion examples/layout-transitions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "example-layout-transitions",
"dependencies": {
"axios": "^0.19.0",
"nuxt": "latest"
},
"scripts": {
6 changes: 2 additions & 4 deletions examples/layout-transitions/pages/users-2.vue
Original file line number Diff line number Diff line change
@@ -30,12 +30,10 @@
</template>

<script>
import axios from 'axios'
export default {
async asyncData ({ query }) {
const page = +(query.page || 1)
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
return {
page,
totalPages: data.total_pages,
@@ -50,7 +48,7 @@ export default {
watch: {
async '$route.query.page' (page) {
this.$nuxt.$loading.start()
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
this.users = data.data
this.transitionName = this.getTransitionName(page)
this.page = +(page || 1)
4 changes: 1 addition & 3 deletions examples/layout-transitions/pages/users.vue
Original file line number Diff line number Diff line change
@@ -28,8 +28,6 @@
</template>

<script>
import axios from 'axios'
export default {
// Watch for $route.query.page to call Component methods (asyncData, fetch, validate, layout, etc.)
watchQuery: ['page'],
@@ -42,7 +40,7 @@ export default {
},
async asyncData ({ query }) {
const page = +(query.page || 1)
const { data } = await axios.get(`https://reqres.in/api/users?page=${page}`)
const data = await fetch(`https://reqres.in/api/users?page=${page}`).then(res => res.json())
return {
page,
totalPages: data.total_pages,
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.14.6",
"version": "2.14.7",
"npmClient": "yarn",
"useWorkspaces": true,
"conventionalCommits": true,
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -33,8 +33,8 @@
"test:unit": "jest packages --forceExit"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/core": "^7.12.0",
"@babel/preset-env": "^7.12.0",
"@ls-lint/ls-lint": "^1.9.2",
"@nuxtjs/eslint-config": "^3.1.0",
"@rollup/plugin-alias": "^3.1.1",
@@ -45,11 +45,11 @@
"@vue/server-test-utils": "^1.1.0",
"@vue/test-utils": "^1.1.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
"babel-jest": "^26.5.2",
"consola": "^2.15.0",
"create-require": "^1.0.2",
"cross-spawn": "^7.0.3",
"eslint": "^7.9.0",
"eslint": "^7.11.0",
"eslint-multiplexer": "^2.0.0",
"esm": "^3.2.25",
"execa": "^3.4.0",
@@ -61,18 +61,18 @@
"got": "^11.7.0",
"improved-yarn-audit": "^2.3.1",
"is-wsl": "^2.2.0",
"jest": "^26.4.2",
"jest": "^26.5.3",
"jiti": "^0.1.11",
"jsdom": "^16.4.0",
"klaw-sync": "^6.0.0",
"lerna": "^3.22.1",
"lodash": "^4.17.20",
"node-fetch": "^2.6.1",
"node-sass": "^4.14.1",
"puppeteer-core": "^5.3.0",
"puppeteer-core": "^5.3.1",
"request": "^2.88.2",
"rimraf": "^3.0.2",
"rollup": "2.28.1",
"rollup": "2.30.0",
"rollup-plugin-license": "^2.2.0",
"sass-loader": "^8.0.2",
"sort-package-json": "^1.46.0",
14 changes: 8 additions & 6 deletions packages/babel-preset-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/babel-preset-app",
"version": "2.14.6",
"version": "2.14.7",
"description": "babel-preset-app for nuxt.js",
"repository": "nuxt/nuxt.js",
"license": "MIT",
@@ -10,13 +10,15 @@
],
"main": "src/index.js",
"dependencies": {
"@babel/core": "^7.11.6",
"@babel/helper-compilation-targets": "^7.10.4",
"@babel/core": "^7.12.0",
"@babel/helper-compilation-targets": "^7.12.0",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-decorators": "^7.10.5",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"@babel/runtime": "^7.11.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.0",
"@babel/plugin-proposal-optional-chaining": "^7.12.0",
"@babel/plugin-transform-runtime": "^7.12.0",
"@babel/preset-env": "^7.12.0",
"@babel/runtime": "^7.12.0",
"@vue/babel-preset-jsx": "^1.1.2",
"core-js": "^2.6.5"
},
6 changes: 6 additions & 0 deletions packages/babel-preset-app/src/index.js
Original file line number Diff line number Diff line change
@@ -159,6 +159,12 @@ module.exports = (api, options = {}) => {
absoluteRuntime
}])

// https://github.com/nuxt/nuxt.js/issues/7722
if (envName === 'server') {
plugins.push(require('@babel/plugin-proposal-optional-chaining'))
plugins.push(require('@babel/plugin-proposal-nullish-coalescing-operator'))
}

return {
sourceType: 'unambiguous',
presets,
12 changes: 6 additions & 6 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/builder",
"version": "2.14.6",
"version": "2.14.7",
"repository": "nuxt/nuxt.js",
"license": "MIT",
"main": "dist/builder.js",
@@ -9,11 +9,11 @@
],
"dependencies": {
"@nuxt/devalue": "^1.2.4",
"@nuxt/utils": "2.14.6",
"@nuxt/vue-app": "2.14.6",
"@nuxt/webpack": "2.14.6",
"@nuxt/utils": "2.14.7",
"@nuxt/vue-app": "2.14.7",
"@nuxt/webpack": "2.14.7",
"chalk": "^3.0.0",
"chokidar": "^3.4.2",
"chokidar": "^3.4.3",
"consola": "^2.15.0",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
@@ -23,7 +23,7 @@
"pify": "^4.0.1",
"semver": "^7.3.2",
"serialize-javascript": "^5.0.1",
"upath": "^1.2.0"
"upath": "^2.0.0"
},
"publishConfig": {
"access": "public"
6 changes: 2 additions & 4 deletions packages/builder/src/builder.js
Original file line number Diff line number Diff line change
@@ -24,8 +24,7 @@ import {
stripWhitespace,
isIndexFileAndFolder,
scanRequireTree,
TARGETS,
isFullStatic
TARGETS
} from '@nuxt/utils'

import Ignore from './ignore'
@@ -130,8 +129,7 @@ export default class Builder {
} else {
consola.info(`Bundling only for ${chalk.bold.green('client')} side`)
}
const target = isFullStatic(this.options) ? 'full static' : this.options.target
consola.info(`Target: ${chalk.bold.cyan(target)}`)
consola.info(`Target: ${chalk.bold.cyan(this.options.target)}`)
}

// Wait for nuxt ready
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/cli",
"version": "2.14.6",
"version": "2.14.7",
"repository": "nuxt/nuxt.js",
"license": "MIT",
"main": "dist/cli.js",
@@ -12,9 +12,9 @@
"dist"
],
"dependencies": {
"@nuxt/config": "2.14.6",
"@nuxt/config": "2.14.7",
"@nuxt/static": "^1.0.0",
"@nuxt/utils": "2.14.6",
"@nuxt/utils": "2.14.7",
"boxen": "^4.2.0",
"chalk": "^3.0.0",
"compression": "^1.7.4",
@@ -33,7 +33,7 @@
"pretty-bytes": "^5.4.1",
"serve-static": "^1.14.1",
"std-env": "^2.2.1",
"upath": "^1.2.0",
"upath": "^2.0.0",
"wrap-ansi": "^6.2.0"
},
"publishConfig": {
2 changes: 2 additions & 0 deletions packages/cli/src/commands/generate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TARGETS } from '@nuxt/utils'
import consola from 'consola'
import { common, locking } from '../options'
import { normalizeArg, createLock } from '../utils'
import { ensureBuild, generate } from '../utils/generate'
@@ -75,6 +76,7 @@ export default {

// Forcing static target anyway
config.target = TARGETS.static
consola.warn(`For using \`nuxt generate\`, your have to set \`target: 'static'\` in your \`nuxt.config\`\n 👉 Learn more about it on https://go.nuxtjs.dev/static-target`)

// Set flag to keep the prerendering behaviour
config._legacyGenerate = true
19 changes: 7 additions & 12 deletions packages/cli/src/run.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { existsSync } from 'fs'
import { resolve } from 'path'
import execa from 'execa'
import consola from 'consola'
import { name as pkgName } from '../package.json'
import NuxtCommand from './command'
import setup from './setup'
import getCommand from './commands'
import { isNuxtDir } from './utils/dir'

function packageExists (name) {
try {
require.resolve(name)
return true
} catch (e) {
return false
}
}

export default async function run (_argv, hooks = {}) {
// Check for not installing both nuxt and nuxt-edge
const dupPkg = '@nuxt/' + (pkgName === '@nuxt/cli-edge' ? 'cli' : 'cli-edge')
if (packageExists(dupPkg)) {
throw new Error('Both `nuxt` and `nuxt-edge` dependencies are installed! This is unsupported, please choose one and remove the other one from dependencies.')
const dupPkg = pkgName === '@nuxt/cli-edge' ? 'cli' : 'cli-edge'
const dupPkgJSON = resolve(__dirname, '../..' /* dist/../.. */, dupPkg, 'package.json')
if (existsSync(dupPkgJSON) && require(dupPkgJSON).name !== '@nuxt/' + dupPkg) {
consola.warn('Both `nuxt` and `nuxt-edge` dependencies are installed! Please choose one and remove the other one from dependencies.')
}

// Read from process.argv
9 changes: 5 additions & 4 deletions packages/cli/src/utils/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path'
import defaultsDeep from 'lodash/defaultsDeep'
import { loadNuxtConfig as _loadNuxtConfig, getDefaultNuxtConfig } from '@nuxt/config'
import { MODES } from '@nuxt/utils'

export async function loadNuxtConfig (argv, configContext) {
const rootDir = path.resolve(argv._[0] || '.')
@@ -18,9 +17,11 @@ export async function loadNuxtConfig (argv, configContext) {
}
})

// Nuxt Mode
options.mode =
(argv.spa && MODES.spa) || (argv.universal && MODES.universal) || options.mode
if (argv.spa === true) {
options.ssr = false
} else if (argv.universal === true) {
options.ssr = true
}

// Server options
options.server = defaultsDeep({
23 changes: 19 additions & 4 deletions packages/cli/src/utils/generate.js
Original file line number Diff line number Diff line change
@@ -59,13 +59,27 @@ export async function ensureBuild (cmd) {

const currentBuildSnapshot = await snapshot(snapshotOptions)

// Detect process.env usage in nuxt.config
const processEnv = {}
if (nuxt.options._nuxtConfigFile) {
const configSrc = await fs.readFile(nuxt.options._nuxtConfigFile)
const envRegex = /process.env.(\w+)/g
let match
// eslint-disable-next-line no-cond-assign
while (match = envRegex.exec(configSrc)) {
processEnv[match[1]] = process.env[match[1]]
}
}

// Current build meta
const currentBuild = {
// @ts-ignore
nuxtVersion: nuxt.constructor.version,
ssr: nuxt.options.ssr,
target: nuxt.options.target,
snapshot: currentBuildSnapshot
snapshot: currentBuildSnapshot,
env: nuxt.options.env,
'process.env': processEnv
}

// Check if build can be skipped
@@ -74,9 +88,10 @@ export async function ensureBuild (cmd) {
const previousBuild = destr(fs.readFileSync(nuxtBuildFile, 'utf-8')) || {}

// Quick diff
const needBuild = false
for (const field of ['nuxtVersion', 'ssr', 'target']) {
if (previousBuild[field] !== currentBuild[field]) {
let needBuild = false
for (const field of ['nuxtVersion', 'ssr', 'target', 'env', 'process.env']) {
if (JSON.stringify(previousBuild[field]) !== JSON.stringify(currentBuild[field])) {
needBuild = true
consola.info(`Doing webpack rebuild because ${field} changed`)
break
}
Loading