Skip to content

Releases: nuxt/nuxt

v3.7.0

25 Aug 23:44
9013f88
Compare
Choose a tag to compare

👀 Highlights

🐣 A New CLI

We've refactored nuxi using unjs/citty and this marks the first Nuxt release that depends on the new version, safely in its own repository. We have grand plans for this - check out some of the features + roadmap discussions in nuxt/cli and please feel free to contribute!

Nuxi is now decoupled from the main nuxt version - we plan to iterate and release nuxi more quickly in future so you can expect new things coming soon!

🕸️ Native Web Streams and Response

With improvements in unjs/h3 and unjs/nitro, it's now possible to directly return a Response object from server routes, meaning it's also possible to return and handle streams natively in Nuxt.

👉 Check out the full detail in the unjs/h3 and unjs/nitro release notes.

🔥 HTML Rendering Optimisations

This release comes with a couple of improvements in rendering HTML responses from the server. We now determine whether to preload/prefetch resources at build time (so you can customise this in the build:manifest hook). We also now manage rendering the HTML for them directly in unhead (#22179), which means you can configure the order for <link>, <meta>, <script>, <style>, and more. And - in our preliminary testing - it's even faster!

It's possible to opt-in to upcoming head improvements with the experimental.headNext flag. This currently includes a new ordering algorithm based on capo.js (#22431) and allows enabling future optimisations as they are released in unhead:

export default defineNuxtConfig({
  experimental: {
    headNext: true
  }
})

We'd love your thoughts - you can respond with any issues/feedback in this discussion.

🛠️ Build Environment Shortcuts

In your Nuxt config you can now use $client and $server shortcuts to easily define configuration that is specific to just the Vite client/server (#22302) or webpack client/server (#22304) builds. This previously was only possible with the vite:extendConfig and webpack:config hooks.

For example:

export default defineNuxtConfig({
  vite: {
    $client: {
      build: {
        rollupOptions: {
          output: {
            chunkFileNames: '_nuxt/[hash].js',
            assetFileNames: '_nuxt/[hash][extname]',
            entryFileNames: '_nuxt/[hash].js'
          }
        }
      }
    }
  }
})

⚡️ Vite 4.4

We've chosen to unpin Vite from minor versions, meaning whenever Vite releases a new feature version you can opt-in straight away. Vite 4.4 brings a lot of exciting things, including experimental Lightning CSS support - and much more!

👉 Check out the Vite release notes for more.

💪 TypeScript Updates

We now use purely relative paths in the generated tsconfig.json instead of setting a baseUrl. This means better support for dev environments like docker images where the absolute path may not match your IDE (#22410).

We also set a couple of additional compiler flag defaults to match Vite/TS recommendations (#22468).

Plus, you should now get type hinted access to layouts in setPageLayout and also in <NuxtLayout name> (#22363).

🦄 Async Context support

If you've ever got an issue with 'Nuxt context unavailable' this might be one for you. We now support native async context for Bun and Node under an experimental flag, in both Nuxt and Nitro (#20918).

This enables using Nuxt composables on the server without needing to ensure they are being called directly in a setup function. It also allows the same in Nitro, with a new useEvent() utility that is usable in server routes.

To try it out, you can enable experimental.asyncContext:

export default defineNuxtConfig({
  experimental: {
    asyncContext: true
  }
})

👓 Watcher Updates

We've fixed a couple of issues with watchers, meaning that you should need to restart your server less often - and you should see a significant performance increase if you are using layers.

⚗️ Nitro 2.6

There lots more exciting features coming directly from Nitro 2.6, including smaller, lighter servers and new persistent data storage in a .data directory.

👉 Read more in the full release article.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

npx nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🚀 Enhancements

  • vite: Unpin vite from minor (#22031)
  • nuxt: Polyfill idle callback utils (#21863)
  • nuxt: Smooth scroll behavior option (#21948)
  • schema,vite: Allow $client and $server vite env overrides (#22302)
  • schema,webpack: Allow $client and $server overrides (#22304)
  • nuxt: Allow dynamic scrollToTop page meta (#21741)
  • nuxt: Expose filtered templates in app:templatesGenerated hook (#21935)
  • nuxt: Render all head tags on server with unhead (#22179)
  • nuxt: Auto-install @nuxt/webpack-builder when needed (#21747)
  • nuxt: Allow remote sources for islands (#21592)
  • nuxt: Environment-specific plugin execution for islands (#20726)
  • kit,nuxi: Add writeTypes utility (#22385)
  • nuxt: Autocomplete layouts in setPageLayout/<NuxtLayout> (#22362)
  • nuxt: Allow 'lazy' (non-blocking) server components (#21918)
  • nuxt: Use build plugin to access nuxt route injection (#21585)
  • vite,webpack: Tree-shakable import.meta.* build flags (#22428)
  • nuxt: Resolve unresolved paths within node_modules (#22478)
  • nuxt: Experimental native async context support (#20918)
  • nuxt: Warn on external webpack/nitro/postcss config (#22521)
  • nuxt: Allow experimental global: 'sync' components (#22558)
  • nuxt: Make app.rootId optional (#22528)
  • nuxt: Add experimental.headNext unhead integration (#22620)
  • cli: Detect bun package manager (#22673)
  • nuxt: Upgrade nitro + reduce node-specific usage (#22515)
  • nuxt: Add support for routeRules defined within pages (#20391)
  • schema: Support setting hidden sourcemaps (#22787)
  • kit,nuxt: Respect nuxt ignore patterns in nitro (#22808)
  • nuxt: Migrate to new nuxt/cli (#22799)
  • schema: Export ./schema/config.schema.json subpath (#22813)

🔥 Performance

  • nuxt: Export DefineNuxtConfig interface from nuxt/config (#22391)
  • nuxt: Write templates in single sync step + improve logs (#22384)
  • nuxt: Render css/inline css higher than resource hints (#21793)
  • nuxt: Experimental support of capo.js head tag order (#22431)
  • nuxt: Use LRU prerender cache and limit cached items (#22465)
  • nuxt: Reduce multiple calls to .toLowerCase() (#22743)
  • nuxt: Reduce multiple calls to dirname (#22800)

🩹 Fixes

  • nuxt: Await prerender:routes hook (#22247)
  • nuxt: Access resolved scrollBehaviorType (#22264)
  • nuxt: Add overloads for asyncData generic + default ([#22258](#22258...
Read more

v3.6.5

19 Jul 17:46
f6a3adb
Compare
Choose a tag to compare

3.6.5 is a hotfix patch release addressing the regression with nuxt/content introduced in v3.6.4.

v3.6.4 release notes

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🩹 Fixes

  • nuxt: Remove dist from the default ignore list (#22227)

❤️ Contributors

v3.6.4

19 Jul 15:25
380a919
Compare
Choose a tag to compare

3.6.4 is a patch release, brought forward to allow releasing some important bug fixes before work begins on 3.7.

Warning
We're currently investigating a regression with nuxt/content and will be releasing 3.6.5 later today.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🔥 Performance

  • nuxt,schema: Do not watch buildDir and node_modules (#22214)

🩹 Fixes

  • nuxt: Correctly use toLowerCase for possible moduleResolution (#22160)
  • nuxt: Don't redirect if initial path has trailing slash (#22192)
  • nuxt: Work around payload extraction issue (#22162)
  • nuxt: Add baseURL to island fetch requests (#22009)
  • nuxt: Resolve race condition regenerating auto imports (#22201)
  • nuxt: Ensure we only increment hydrating count once (#22200)
  • nuxt: Avoid premature hydration when using async layouts (#22198)
  • cli: Support --inspect in dev mode (#22205)
  • test-utils: Pass along error if server can't start (#22216)

📖 Documentation

  • Add runtime storage configuration examples (#22189)
  • Add instruction on how to use other modules in a module (#22081)
  • Standardize indentation and tag positioning (#22157)

❤️ Contributors

v3.6.3

14 Jul 22:55
f068ad5
Compare
Choose a tag to compare

3.6.3 is the next patch release, including a number of fixes. It's anticipated this will be the last patch release before 3.7.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🔥 Performance

  • nuxt: Prepopulate island payloads from rendered html (#22049)

🩹 Fixes

  • kit: Module compatibility not working with module names (6cabe69ce)
  • schema: Correct type of unctx options (4e32e70bb)
  • vite: Pass modulesDir to isExternal (#21966)
  • nuxt: Add pages in correct hook when generating (#22088)
  • test-utils: Export from core playwright package (#22122)
  • nuxt: Skip view transitions where there is no route change (#22140)
  • nuxt: Skip scanning components that do not produce a name (#22074)
  • cli: Add aliases to monorepo paths to tsconfig includes (#21997)
  • cli: Allow non-existent experimental option (0643d4315)

💅 Refactors

  • cli,schema: Add bundler module resolution flag (#22142)

📖 Documentation

  • Fix accessing custom props from child pages (#21977)
  • Add leading slash (3bae61507)
  • Add more internal links (#22013)
  • Add space in list (#22032)
  • Add details and components folder to auto imports introduction (#22062)
  • Use sfc syntax in example (#22073)
  • Prefix internal links with / (#22118)
  • Fix typos (#22125)
  • Update link to router options (#22131)

🏡 Chore

❤️ Contributors

v2.17.1

14 Jul 22:37
Compare
Choose a tag to compare

2.17.1 is the next patch release for Nuxt 2.

👉 Changelog

compare changes

🩹 Fixes

  • webpack: Downgrade dev-middleware to fix peer dep issue (#21626)
  • webpack: Pin webpack-dev-middleware to 5.0.0 (#21804)

❤️ Contributors

v3.6.2

05 Jul 21:59
88f914e
Compare
Choose a tag to compare

3.6.2 is the next patch release, with a raft of fixes including preparations for use without --shamefully-hoist and some fixes for data fetching within nested layouts/pages.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🔥 Performance

  • nuxt: Don't run island transform plugin if disabled (#21844)
  • nuxt: Allow hmr for server components in dev mode (#21916)
  • nuxt: Use getters when constructing reactive routes (#21957)

🩹 Fixes

  • nuxt: Only redirect if path is not the same as initial url (#21815)
  • cli: Resolve @nuxt/ui-templates from modulesDir (#21836)
  • nuxt, vite: Do not use cjs utils to resolve/alias vue (#21837)
  • nuxt: Improve default prerender behaviour (#21817)
  • vite: Greater type-safety within runtime vite-node (#21849)
  • nuxt: Ensure static presets equivalent to nuxi generate (#21860)
  • nuxt: Handle injecting multiple entry ids for styles (#21864)
  • nuxt: Stop loading indicator on navigation failure (#21751)
  • cli: Respect nitro ssl cert/key variables (#21912)
  • nuxt: Include external layers in tsconfig.json scope (#21917)
  • nuxt: Support custom route name meta with typedPages (#21659)
  • vite: Remove @vue/ scoped libraries from resolutions (#21922)
  • nuxt: Add layers in node_modules to tsconfig include (#21929)
  • nuxt: Regenerate imports after template (#21934)
  • vite: Fix issue detecting shadowed keyed composables (#21891)
  • nuxt: Use $fetch.raw in dev client mode for islands (#21904)
  • schema: Warn if user provides vite.publicDir (#21847)
  • nuxt: Preserve old vnode when leaving nested route (#21823)
  • kit: Ignore telemetry startup time (as it has prompt) (#21959)

📖 Documentation

  • Add warning about dynamic import of css (#21805)
  • Update example links (#21811)
  • Fix broken spaLoadingTemplate link (#21845)
  • Update useFetch return values (#21852)
  • Describe environment override feature (#21879)
  • Add Daniel example for hybrid rendering and Vercel (20d59d1cf)
  • Improve hybrid rendering (3fb329cc8)
  • rendering: Add end of sentence (565787183)
  • Add closing bracket (#21887)
  • Added a note about server dynamic routes limitation (#21919)
  • Update docs for <NuxtLoadingIndicator> (#21952)
  • Update more links to examples repo (13a892361)
  • Add JetBrains IDEs debug configuration (#21965)

🏡 Chore

  • Prune internal unused code and exports (#21809)
  • Add codeflow overrides configuration (d7267663f)

✅ Tests

  • Add nuxt-vitest and composable unit tests (#21884)

❤️ Contributors

v3.6.1

26 Jun 19:34
54a0d5e
Compare
Choose a tag to compare

3.6.1 is a bugfix/patch release with some significant patches merged since 3.6.0

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🩹 Fixes

  • nuxt: Use esbuild/acorn instead of typescript dep (#21729)
  • nuxt: Proxy headers to islands + returned prerender hints (#21740)
  • nuxt: Respect false to disable spa loading template (#21739)
  • nuxt: Remove path from SPA payload (#21732)
  • nuxt: Only remove one item from middleware (#21730)
  • nuxt: Escape colons in page paths (#21731)
  • nuxt: Augment nitro config within server context as well (#21724)
  • nuxt: Inline global css with ssr: false route rule (#21763)
  • vite: Resolve css files without importer id first (#21770)
  • vite: Emit assets referenced in inline css (#21790)
  • nuxt: Support importing types from #imports (#21796)
  • nuxt: Use starting index when transforming islands (#21795)

📖 Documentation

  • Add defineNuxtRouteMiddleware migration (#21718)
  • Add a link to Docus layer nuxt config file (#21742)
  • Remove outdated reference to stable version (#21785)
  • Centre example loading spinner (#21792)

✅ Tests

❤️ Contributors

v3.6.0

23 Jun 12:22
e58cfc8
Compare
Choose a tag to compare

3.6.0 is the next minor release, packed with improvements and bug fixes.

📣 Upcoming news

In the coming week you can expect two announcements:

  1. The open-sourcing of nuxt/cli by @pi0 - a new, drop-in replacement for nuxi featuring more extensibility and better DX. We are aiming to release this alongside Nuxt 3.7, but you would be very welcome to test and contribute to nuxi-ng before then!
  2. Three significant RFCs: Nuxt Font, Nuxt Assets and Nuxt Scripts. We're expecting an initial POC to take shape in the next month, and would very much appreciate community feedback on this.

👀 Highlights

This minor release contains quite a lot, and we have big plans

 SPA loading indicator

If your site is served with ssr: false or you have disabled server-rendering on some of your pages, you might be particularly interested in the new built-in SPA loading indicator.

You can now place an HTML file in ~/app/spa-loading-template.html with some HTML you would like to use to render a loading screen that will be rendered until your app is hydrated on these pages.

👉 By default an animated Nuxt icon is rendered. You can completely disable this indicator by setting spaLoadingTemplate: false in your nuxt configuration file.

⚡️ Performance improvements

The first thing that happens when your app is hydrated is that your plugins run, and so we now perform build-time optimisations on your plugins, meaning they do not need to be normalised or reordered at runtime.

We also include your error component JS in your main entrypoint, meaning that if an error occurs when a user has no connectivity, you can still handle it with your ~/error.vue. (This also should decrease your total bundle size.)

👉 Compared to Nuxt 3.5.3, the minimal client bundle has decreased by ~0.7kB. Let's keep this up!

🔥 Fully static server components

It has been possible to use server components on static pages, but until now they would increase the payload size of your application. That is no longer true. We now store rendered server components as separate files, which are preloaded before navigation.

👉 This does rely on the new, richer JSON payload format, so make sure you have not disabled this by setting experimental.renderJsonPayloads to false.

🎨 Better style inlining

If you're monitoring your metrics closely and have not turned off experimental.inlineSSRStyles, you should see more CSS inlined in your page, and a significantly external CSS file. We're now better at deduplicating global CSS, particularly added by libraries like tailwind or unocss.

🎬 Animation controls

To give you more fine-grained control over your page/layout components, for example to create custom transitions with GSAP or other libraries, we now allow you to set pageRef on <NuxtPage> and layoutRef on <NuxtLayout. These will get passed through to the underlying DOM elements.

✨ Automatic 'static' preset detection

Up to now, running nuxt generate produced the same output on every deployment provider, but with Nuxt 3.6 we now enable static provider presets automatically. That means if you are deploying a static build (produced with nuxt generate) to a supported provider (currently vercel and netlify with cloudflare and github pages coming soon) we'll prerender your pages with special support for that provider.

This means we can configure any route rules (redirects/headers/etc) that do not require a server function. So you should get the best of both worlds when deploying a site that doesn't require runtime SSR. It also unblocks use of Nuxt Image on Vercel (with more potential for automatic provider integration coming soon).

💪 Increased type safety

We now have better support for server-specific #imports and augmentations if you are using the new ~/server/tsconfig.json we shipped in Nuxt 3.5. So when importing from #imports in your server directory, you'll get IDE auto-completion for the right import locations in Nitro, and won't see Vue auto-imports like useFetch that are unavailable within your server routes.

You should now also have type support for runtime Nitro hooks.

Finally, we have removed more locations where objects had a default any type. This should improve type safety within Nuxt in a number of locations where unspecified types fell back to any:

  • RuntimeConfig
  • PageMeta
  • NuxtApp['payload'] (accessible now from NuxtPayload interface)
  • ModuleMeta

You can find out more about how to update your code if this affects you in the original PR.

⚗️ Nitro 2.5 built-in

This release ships with new Nitro 2.5, which has a whole list of exciting improvements that are worth checking out.

Of particular note is experimental support for streaming, which is also enabled by a couple of changes in Nuxt itself.

🛠️ New tools for module authors

This release brings a number of utilities for modules authors to easily add type templates and assert compatibility with a given version of another module.

In addition, this release will finally unlock a new nuxt/module-builder mode that should improve type support for module authors. If you're a module author, you might consider following these migration steps to try it out in the coming days.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🚀 Enhancements

  • nuxt: Sync useCookie state between tabs (#20970)
  • kit: Module compatibility utils (#21246)
  • nuxt: Add renderResult to app:rendered (#18610)
  • webpack: Allow configuring esbuild-loader options (#21436)
  • nuxt: Add open option in navigateTo helper (#21333)
  • webpack, schema: Add webpack experiments configuration (#21446)
  • nuxt: Provide clearNuxtState composable (#21409)
  • kit: addTypeTemplate helper with auto-registration (#21331)
  • nuxt: Return status from useAsyncData (#21045)
  • nuxt: Allow accessing NuxtPage ref via pageRef (#19403)
  • nuxt: Allow accessing NuxtLayout ref via layoutRef (#19465)
  • nuxt: Emit error in ssr-error event (#21547)
  • nuxt: Start loading indicator state with middleware (#21003)
  • kit: Allow direct function in defineNuxtModule (#20763)
  • nuxt: Expose useNuxtApp to window for convenience (#21636)
  • nuxt: Allow configuring spa loading indicator (#21640)
  • nuxt: Add types for nuxt-defined nitro runtime hooks (#21666)
  • nuxt: Update devdependency nitropack to v2.5.1 (#21696)

🔥 Performance

  • nuxt: Mark define functions as side-effect free at source (#21434)
  • nuxt: Import error component synchronously (#21406)
  • nuxt: Use prerendered islands to serialise/revive payload (#21461)
  • nuxt: Extract and apply plugin order at build time (#21611)

🩹 Fixes

  • nuxt: Handle page rendering on different path (#21408)
  • nuxt: Replace BigInt literal with BigInt constructor (#21427)
  • vite: Remove resolveId workaround and update vite-node (#21423)
  • schema: Remove obsolete terser option from webpack config (#21407)
  • nuxt: Skip vue render when redirecting (#21412)
  • nuxt: Avoid early returning renderer with empty response (#21439)
  • nuxt: Add missing vue types (#21445)
  • nuxt: Prefix server component ids to avoid collisions (#21472)
  • schema: Add more explicit types for config schema ([#21475](https://github.com/nuxt/nuxt/p...
Read more

v2.17.0

09 Jun 20:55
1ce34ec
Compare
Choose a tag to compare

2.17.0 is the next minor release for Nuxt 2.

✨ Highlights

Nuxt 2.17 comes with a few new features, including better support for new Vue 2.7 types, and supporting passing postcss config as a function.

It also includes support for Node 20+ and a fix for a dependency issue with the Babel preset that affected new installs.

👉 Changelog

compare changes

🚀 Enhancements

  • types: Support nuxt types for defineComponent (#19789)
  • csp: Support generating nonce for scripts and links in ssr (#9621)
  • webpack: Support passing function as postcssOptions (#19495)

🔥 Performance

  • config: Avoid recursive md4 patching (7fab95252)

🩹 Fixes

  • Relax node engines upper constraint (010b539ed)
  • utils: Respect patterns within paths when sorting routes (#20669)
  • vue-app: Skip page render early on error or navigation (#20719)
  • babel-preset-app: Add explicit dep on used babel plugin (#21488)

🏡 Chore

  • Reenable publishing 🙈 (4ce8b118e)
  • Exclude yaml exception vulnerability (build-time dep) (c8ed87a26)
  • Bump jest dependencies (#20506)
  • Remove resolved advisories (98cd35665)
  • Skip publishing node_modules folder (8799cfacc)
  • Remove obsolete useWorkspaces option (27e450119)

✅ Tests

  • Add catchall path to route generation test (71c359516)
  • Update windows snapshot (4ec274ae2)
  • Update jest snapshots to remove escaped quotes (f93411c7c)

🤖 CI

  • Run tests in node 16 (#20644)
  • Pin actions by hash and use corepack (#21356)

❤️ Contributors

v3.5.3

06 Jun 00:28
199595f
Compare
Choose a tag to compare

3.5.3 is expected to be the last patch release before our next raft of features lands in v3.6.

✅ Upgrading

As usual, our recommendation for upgrading is to run:

nuxi upgrade --force

This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.

👉 Changelog

compare changes

🔥 Performance

  • nuxt: Avoid watching nested paths (#21256)

🩹 Fixes

  • nuxt: Handle serialising empty bigint (#21257)
  • cli: Pass --no-clear config through to vite (#21262)
  • cli: Always use the latest devtools wizard (#21291)
  • schema: Update vue-loader options type (#21363)
  • schema: Add types for vue experimental features (#21364)
  • nuxt: Display errors in client overlay with typeCheck (#21064)
  • nuxt: Support usage of std-env in runtime code (#21372)
  • nuxt: Key distinct pages differently for legacy asyncData (#21263)
  • vite: Skip generating keys for locally scoped functions (#20955)
  • kit: Temporarily inline lodash.template from lodash-es (#20892)

📖 Documentation

  • Add index.vue to page routing example (#21240)
  • Distinguish between $fetch and fetch composables (#21228)
  • Adjust env property to match runtimeConfig (#21265)
  • Fix Cloudflare capitalization (#21267)
  • Migrate transition class names and style prop (#21281)
  • Remove irregular spaces (#21380)

🏡 Chore

  • Pin dev dependencies (9fb83b744)
  • Avoid inlining deps in vitest (#21316)
  • Rewrite crawler to remove old dependencies (#21326)
  • Support vitest 0.30.0 peer dependency (d58d1ea1e)

✅ Tests

🤖 CI

  • Apply security best practices to workflows (#21328)
  • Pin more action dependencies to hash (#21330)

❤️ Contributors