Skip to content

v2.5.0

Compare
Choose a tag to compare
@atinux atinux released this 21 Mar 13:10

15,000 line changes with 230 squashed commits by more than 30 contributors made this version possible! ❤️

What's new?

Typescript DX

No longer needed to install nuxt-ts for typescript support. Nuxt.js officially supports TS by installing @nuxt/typescript. Please see #5079 for reasons behind such migration.

Babel

Babel 7.4, Core-js v3, and Object.assign polyfill for better browser support.

Stability

More than 30 fixes, refactors and performance improvements.

Open in Browser

Use nuxt dev -o to instantly open project in the browser and enjoy a cool loading screen:

nuxt-loading-screen

.nuxtignore

Before v2.5, you were able to ignore files through an ignore prefix. As using the prefix over and over, ignoring files (and implementing custom structures) was a bit tedious on the long run. We came up with something more sophisticated: A .nuxtignore file. Following the same specs as a .eslintignore or a .gitignore file, you can now define what files or folders to ignore through a .nuxtignore file in your project root.

Examples and more info in the .nuxtignore docs

[IMPORTANT] Migration Guide

Lock Files

For a clean upgrade, please remove yarn.lock / package-lock.json file from your project before upgrade.

Programmatic API / Middleware

If not already done, please explicitly call nuxt.ready() after new Nuxt(). nuxt.ready() was always async, but not awaiting the function call has now a severe impact.

   const nuxt = new Nuxt(config)
++ await nuxt.ready()

TypeScript

  1. Please replace nuxt-ts dependency and use nuxt + @nuxt/typescript. (Also nuxt-ts-edge to nuxt-edge + @nuxt/typescript-edge for edge users)
{
--  "nuxt-ts": "^2.4.2"
++  "@nuxt/typescript": "^2.5.0"
++  "nuxt": "^2.5.0"
}
  1. Configuration API to customize/disable type checking has been moved from build.useForkTsChecker to build.typescript.typeCheck. Please see #5079 for more details.
build: {
-- useForkTsChecker: false // or ForkTsChecker options
++ typescript : {
++   typeCheck: false // or ForkTsChecker options
++ }
}

Features

  • feat(babel): include es6.object.assign by default (Clark Du) (52fe145)
  • feat(cli): lock project during build or generate (#4985) (Pim) (4e51723)
  • feat(cli): option to open the project in the browser (#4930) (Ricardo Gobbo de Souza) (4c7bd9c)
  • feat(generate): return non-zero code or page error (fixes #4991) (#5195) (Jarek Lipski) (c6565c9)
  • feat(module): support src as a function in addModule (#4956) (Ricardo Gobbo de Souza) (1e9eb4b)
  • feat: support .nuxtignore (#4647) (Xin Du (Clark)) (59be77a)
  • feat: support devModules option (#5102) (Jonas Galvez) (e87711c)
  • feat(ts): nuxt configuration typedefs (#4854) (Kevin Marrec) (92f81e0)
  • feat(vue-app): universal fetch (#5028) (Pooya Parsa) (2015140)
  • feat(vue-renderer): improvements (#4722) (Pooya Parsa) (2929716)
  • feat(vue-renderer): use async fs (#5186) (Pooya Parsa) (d07aefa)
  • feat(ts): better DX for typescript support (#5079) (Kevin Marrec) (920f444)
  • feat: loading screen (#5251) (Sébastien Chopin, Pooya Parsa) (ef41e20)
  • feat: support core-js 3 (#5291) (Xin Du (Clark)) (d094c4a)

Fixes

  • fix(builder, vue-app): order of plugin execution based on order in array (#5163) (Dmitry Molotkov) (a867dbd)
  • fix: correct public path in generation and start (#5202) (Xin Du (Clark)) (648062c)
  • fix: default for-exit to false to prevent dev exit (pooya parsa) (a347ef9)
  • fix: disable "analyze" for nuxt generate (#4975) (Alexander Lichter) (574a2eb)
  • fix: disable parallel build when extractCSS is enabled (Clark Du) (aad46ed)
  • fix: extra properties in templateFiles (#4925) (Xin Du (Clark)) (ca19124)
  • fix: fix non standard esm modifications (pooya parsa) (fb87a55)
  • fix: generate failure (#5007) (Andrey Shertsinger) (bcd672f)
  • fix: keep-alive component data should not be updated (#5188) (Xin Du (Clark)) (1ea8661)
  • fix: not send Server-Timing header if no timing info (Clark Du) (d9a0b5f)
  • fix(postcss): default to preset-env and cssnano last (#5215) (Alexander Lichter) (adf423a)
  • fix: publicPath is not reactive in dev restarting (#5227) (Xin Du (Clark)) (1fb7538)
  • fix: refactor file watchers (chokidar/linux workaround) (#4950) (Pim) (5ec5932)
  • fix: remove cache-loader for external resources (#4915) (Xin Du (Clark)) (0223e56)
  • fix: respect namespaced in store module (#5189) (Xin Du (Clark)) (9e1ef88)
  • fix: revert templatFiles name (#4924) (Xin Du (Clark)) (f70645e)
  • fix: trailing comma in tsconfig (#5061) (Sergey Vikulov) (1fb44d9)
  • fix(ts): deprecate isClient, isServer, isStatic (#5211) (Daniel Hritzkiv) (29c3c42)
  • fix(types): reflect chainlable NuxtLoading methods (#5104) (Matjaž Lipuš) (66273f4)
  • fix: Unexpected token .... Expected a property name in Safari (Clark Du) (eef7f69)
  • fix(vua-app): clone mount error to prevent mutating read-only error object (#5214) (Alexander Lichter) (37006f6)
  • fix(vue-app): avoid css chunk error (#5173) (Yutaka Sasaki) (41028a4)
  • fix(webpack): clone config.entry (fixes #4849) (#5236) (Julien Dargelos) (8216765)
  • fix: disable extract-css-chunks-webpack-plugin in dev mode (#4888) (Xin Du (Clark)) (928a230)
  • fix(server): handle decodeURI error (#5243) (phof) (5b7f6d7)
  • fix: correct socket address in use error message (Clark Du) (2eb1965)
  • fix(utils): relax lock settings (#5280) (Pim) (65a431d)
  • fix(vue-app): multiple named views cause invalid syntax (#5262) (Michael Leaney) (d03a61b)
  • fix(webpack): loaders in extend config is broken (#5292) (Xin Du (Clark)) (0eb5ed9)
  • fix(vue-app): duplicated router.base when using context.redirect(object) (#5290) (Nianyong) (cf02e82)
  • fix(vue-app): decode router base to support unicode characters (#5297) (Alexander Lichter) (3ac01df)

Performance Improvements

  • perf: await routeData promises in parallel (#5027) (Alexander Lichter) (0826d7e)
  • perf(core): skip esm for node_modules and non .js files (#5220) (Pooya Parsa) (aabb1f6)
  • perf(webpack): use futureEmitAssets (#5003) (Alexander Lichter) (3997d50)
  • perf(ts): transpileOnly when using nuxt-ts start (#4906) (Kevin Marrec) (17cc12f)

Examples

  • examples(jest-puppeteer): fix package .json (#4997) (Andrew Cravenho) (dfc8dd5)
  • examples: improve vuex store example (#5017) (Alexander Lichter) (a9511e5)
  • examples(pug): fix example by adding plain-pug-loader (#5223) (Paul Geisler) (320a46f)
  • examples(vuex-store): change to module store (#4923) (Alexander Lichter) (be41ae1)
  • examples: add pug-stylus-coffee (#4927) (chiboreache) (6d05969)
  • examples: add tsx example (#4855) (andoshin11) (5101dc6)
  • examples: fix jest test dependencies (#5155) (Dmitry Molotkov) (1c3761a)
  • examples: fix links to vue-meta repo (#5018) (Pim) (06f4762)
  • examples: rebase on latest stable nuxt version (#4874) (Alexander Lichter) (47898fb)
  • examples: zero-downtime pm2 typescript example (#4907) (Dmytro) (1fb9af3)
  • examples: fix dynamic components example (#5294) (Dmitry Molotkov) (d9db45c)

Refactors

  • refactor: generate routes and template files in builder (#4883) (Xin Du (Clark)) (4c5a59e)
  • refactor: improve modern middleware and spa modern rendering (#5037) (Xin Du (Clark)) (05299d6)
  • refactor: isModernBrowser return boolean for avoiding duplicate call (Clark Du) (c6d8e8f)
  • refactor: not detect modern browser if modern mode is disabled (Clark Du) (2b4d79c)
  • refactor: remove builder coupling from server (#5157) (Pooya Parsa) (13cb0f7)
  • refactor: remove unnecessary onEmit in old webpack (Clark Du) (eac6d02)
  • refactor: some small stuff (#4979) (Alexander Lichter) (69dfd84)
  • refactor: fix typos (#4922) (Alexander Lichter) (569b6aa)
  • refactor: unify context in webpack module (#5054) (Xin Du (Clark)) (9860eb6)
  • refactor: use spread syntax for plugin push (#4976) (Alexander Lichter) (31cb187)
  • refactor: fallback to babel-preset-env defualt targets when buildTarget is not specified (Clark Du) (176641f)
  • refactor(ts): add warning for nuxt-ts deprecation (#5301) (Kevin Marrec) (a11afd4)

Chore

  • chore(babel-preset): create readme with basic docs (#5127) (HG) (04cdd60)
  • chore: don`t ignore .nuxtignore (#5169) (Dmitry Molotkov) (39c9ab5)
  • chore: enable yarn.lock maintenance (#5063) (Xin Du (Clark)) (17b53eb)
  • chore(vue-app): suppress deprecated warning for classic vuex in prod (#5137) (Shingo Sato) (f39205a)

Tests

  • test: add await for promisable expect (Clark Du) (fabf1c0)
  • test: add chrome detector (#4984) (Xin Du (Clark)) (855705b)
  • test: add describe.posix and win (Clark Du) (e9ba2f9)
  • test: fix macos e2e tests (Pooya Parsa) (2c763df)
  • test: improve nuxt-loading component tests (#5005) (Pim) (75a7454)
  • test: mock enquirer in typescript tests (#5025) (Pim) (ad6a8cd)
  • test: skip reqest in dev test for now (Clark Du) (3e67879)
  • test: try to fix unhandled request (Clark Du) (2f2baac)
  • test: turn off cli dev test (Clark Du) (5c053f5)
  • test: unit tests for generator (#4857) (Xin Du (Clark)) (e22a282)
  • test: unit tests for @nuxt/util (#4880) (Xin Du (Clark)) (96bab9f)
  • test: unit tests for server module (#5154) (Xin Du (Clark)) (cc573a4)
  • test: update cli snapshot (Clark Du) (3dd1a28)
  • test: unhandled open handles (Clark Du) (858c9ee)
  • test: change cli.test to be more accurate (#4957) (Xin Du (Clark)) (68f6880)
  • test: use puppeteer-core (#4929) (Pooya Parsa) (940a36f)
  • test: fix e2e test by downloading chromium (#5254) (Pooya Parsa) (2561b68)
  • test: fail tests in case of unhandled errors (#5255) (Pooya Parsa) (d6b505a)