Releases: nuxt/framework
v3.0.0-rc.14
Note
This is the last release candidate for Nuxt v3! Are you ready? 👀
Changelog
⚠️ Breaking Changes
- cli: Setup nuxt globally with
nuxt test
(#4578) - nuxt: Only add
$f
fetch prefix to auto-keys (#8852) - test-utils: Use
vitest/node
subpath export (#8815) - nuxt: Remove
initialCache
option (#8885) - nuxt: Enable payload extraction only for
nuxi generate
(#9018) - nuxt: Include request url and params in
useFetch
key (#6632) - nuxt: Fix typo for
NuxtRenderHTMLContext.bodyPrepend
(#8712) (#8704) - nuxt: Remove support for
404.vue
shorthand (#8809) - kit: Remove support for module container (#9010)
- nuxt: Move
head
option support intodefineNuxtComponent
(#8901) - Remove deprecated api (#9029)
- RemovePrivateRuntimeConfig
interface support
- RemoveautoImports
option
- RemoveautoImports:extend
hook support
- Remove deprecatedaddAutoImport
andaddAutoImport
utilities (useaddImports
andaddImportsDir
)
- Removedefer
option foruseAsyncData
- Remove support forinstallModule(nuxt, nuxtModule)
- Remove support for module defenition as function
- Remove support forname
in module definition (usemeta.name
)
- Remove deprecatedthrowError
(useshowError
)
- Remove deprecateduseActiveRoute
(useuseRoute
)
- Remove deprecatedNuxtConfig
anddefineNuxtConfig
imports fromnuxt
(import fromnuxt/config
)
- Remove deprecated<Script>
component (useuseHead
)
- Remove deprecatedRouterConfigOptions
interface (useRouterConfigSerializable
)
- Remove deprecatedfileName
for template options (usefilename
)
- Remove deprecated<NuxtNestedPage>
and<NuxtChild>
components
- Remove deprecatedbuildModules
config
- Remove deprecatedprivateRuntimeConfig
andpublicRuntimeConfig
options
- Remove deprecatedimports.presets[].name
(usepresets.imports
instead)
🚀 Enhancements
- nuxt: Add
isExternal
to<NuxtLink>
slot props (#8800) - nuxt: Auto-import
utils/
directory (#8817) - cli: Wrap and normalize all console outputs (#8846)
- nuxt: Allow customizing root id and tag (#8883)
- nuxt: Add
onBeforeRouteLeave
andonBeforeRouteUpdate
composables (#8889) - cli:
⚠️ Setup nuxt globally withnuxt test
(#4578) - cli: Auto-generate
.npmrc
and setting for pnpm (#7407) - nuxt, schema: Migrate to @vueuse/head v1 (#8975)
🩹 Fixes
- nuxt: Check if global transitions are activated for scroll behavior (#8700)
- nuxt: Allow cookies to be set to
null
to unset them (#8769) - nuxt: Add catchall paths to prerender list (#8782)
- schema: Add declarations to ignore list (#8787)
- ssr: Ensure
useRequestHeaders
are case-insensitive (#8805) - nuxt: Do not render page if we are throwing error (#8821)
- nuxt: Swallow issues with query selectors (#8843)
- nuxt:
⚠️ Only add$f
fetch prefix to auto-keys (#8852) - test-utils: Detect project root using
nuxt.config
with.mjs
and.cjs
extensions (#8855) - cli: Exclude
dist
from type checking (#8848) - test-utils:
⚠️ Usevitest/node
subpath export (#8815) - nuxt: Detect non-functional imports within page meta (#8881)
- nuxt: Preserve render errors (#8884)
- nuxt:
⚠️ RemoveinitialCache
option (#8885) - nuxt: Use
app.baseURL
when fetching error page on server (#8888) - nuxt: Avoid passing attrs to default slot for
<ClientOnly>
component (#8921) - vite: Add extend layers to
fs.allow
(#9006) - nuxt: Include layers in esbuild transform (#9014)
- kit: Add external module to transpile (#8963)
- nuxt:
⚠️ Enable payload extraction only fornuxi generate
(#9018) - nuxt:
⚠️ Include request url and params inuseFetch
key (#6632) - nuxt: Improve hmr for pages macros (#8940)
💅 Refactors
- nuxt:
⚠️ Fix typo forNuxtRenderHTMLContext.bodyPrepend
(#8712) - nuxt:
⚠️ Fix typo forNuxtRenderHTMLContext.bodyPrepend
(#8704) - nuxt:
⚠️ Remove support for404.vue
shorthand (#8809) - nuxt: Explicitly import app in nuxt-root (#8729)
- kit:
⚠️ Remove support for module container (#9010) - Update unjs dependencies to stable v1 (#9011)
- nuxt:
⚠️ Movehead
option support intodefineNuxtComponent
(#8901) ⚠️ Remove deprecated api (#9029)
📖 Documentation
- Update 2.nuxt-page.md (#8761)
- Update roadmap for november (#8766)
- Use update import for
defineLazyEventHandler
(#8767) - Remove stability-edge (507f444c)
- deployment: Remove usage of custom icons (8e4068b7)
- Improve examples content (1582f8ec)
- api: Add
useRequestHeaders
composable example (#8833) - Add entry for
extendPages
(#8860) - api: Add
refreshNuxtData
util examples (#8845) - Get event before running async function (#8861)
- api: Add
useHydration
composable (#8768) - Add
query
option with example foruseFetch
(#8719) - Add initial documentation for router composables (#8895)
- Add tls option to redis example (#8900)
- Fix syntax errors in server storage example (#8906)
- Fix typo (#8970)
- api: Add spaces to avoid breaking mobile layout (#8967)
- Typo in
available
(#8966) - Add a bit more detail in the
definePageMeta
warning to specify it needs to be in a page (#8923) - Match the open graph protocol markup (#8959)
- Fix typos (#8976)
❤️ Contributors
- Anthony Fu [email protected]
- Daniel Roe [email protected]
- Pooya Parsa (@pi0)
- Harlan Wilton (@harlan-zw)
- Mehdi HosseinZade (@xtoolkit)
- Silvesterwali
- Israel Ortuño [email protected]
- Kevin Olson (@acidjazz)
- Julien Huang
- Okoro Redemption (@therealokoro)
- Clément Ollivier (@clemcode)
- Cedric Wetzel (@cedWetzel)
- Percy Ma (@kecrily)
- Ali Soueidan
- Toby Faux
- Stefan [email protected]
- Krutie Patel...
Nuxt 3.0 stable
✨ Official Release Announcenment
📝 Changelog
Check out release candidate notes for older releases and migration steps if you using an older version of Nuxt 3.
🩹 Fixes
- nuxt: Removed auto imports (#9045)
- schema: Initialise
runtimeConfig.public
with empty object (#9050) - cli: Upgrade with
latest
tag (#9060) - nuxt: Allow union type arguments for
useAsyncData
(#9061)
📖 Documentation
- New website design (#9007)
- Update website theme version (819deb89)
- Minor style improvements (9ab069b2)
- Update website-theme (780b17b1)
- Add warning about
definePageMeta
issues with transitions andNuxtLoadingIndicator
(#9055) - Add missing agencies (#9059)
🏡 Chore
❤️ Contributors
- Toby Faux
- Clément Ollivier (@clemcode)
- Pooya Parsa (@pi0)
- Conner (@Intevel)
- Sébastien Chopin (@Atinux)
- Daniel Roe [email protected]
v3.0.0-rc.13
⭐ What is New?
🔰 Security Fixes
This release contains multiple security related fixes #8675, #8674 and #8673 reported via huntr.dev platform by OhB00.
We recommend you upgrade to the latest version as soon as possible.
If you encounter "The request URL ... is outside of Vite service allow list" issue, try adding path to vite.server.fs.allow
in nuxt.config
. read more.
🚀 Performance Improvements
Using a new method to extract definePageMeta
improves vite performance and makes lazy compilation of pages possible (#8536).
💯 Strict Config Schema and Types
We have cleaned up the configuration schema (#8487) so that you no longer would be confused with Nuxt 2 options and also can quickly notice any typos in nuxt.config
file.
Typescript strict mode is also enabled by default with this release as best practice. (#8667)
🚇 Nitro Development Server Proxy
Using nitro.devProxy
option you can now configure proxies for the development server. (learn more)
Changelog
⚠️ Breaking Changes
- nuxt:
⚠️ Use parser to generate page metadata (#8536) - schema:
⚠️ Use strict typescript mode by default (#8667) - test-utils:
⚠️ Update vitest args (#8325) - schema:
⚠️ Disableapp.pageTransition
andapp.layoutTransition
by default (#8436) - nuxt:
⚠️ Cleanup schema and split nuxt 2 types (#8487)
🚀 Enhancements
- nuxt: Default router scroll behavior (#3851)
- nuxt: Make
useFetch
options reactive (#8374) - kit: Add
updateTemplates
utility (#8413) - nuxt: Add dev warnings when
setPageLayout
is used incorrectly (#8464) - Add
<devOnly>
component (#7950) - nuxt: Allow setting
name
andpath
for a route indefinePageMeta
(#8633) - kit: Add
addServerPlugin
utility (#8635) - kit, nuxt: Support
prerender:routes
andaddPrerenderRoutes
(#8670)
🩹 Fixes
- nuxt: Don't use or assignment (#8299)
- nuxt: Pass original request headers to the error page (#7340)
- nuxt: Scroll to top on dynamic routes with different params (#8327)
- nuxt: Router defaults overwrite custom options always (#8334)
- cli: Update analzye main handler (#8339)
- nuxt: RouterBehavior comparison for hash block (#8383)
- nuxt: Don't load payloads for external urls (#8370)
- vite: Invalidate virtual modules with
vite-node
(#8389) - nuxt: Avoid directly importing
vue-router
inside<NuxtLayout>
(#8421) - webpack: Print build errors (#8388)
- kit: Use
pathe
to resolve aliases (#8453) - test-utils: Override
NITRO_PORT
as well (#8458) - nuxt: Call data refresh hook in parallel (#8470)
- nuxt: Allow responding with custom headers from
error.vue
(#8469) - schema: Disable early hints by default (#8486)
- kit: Don't require nuxt context when resolving path (#8504)
- nuxt, nuxi: Improve
pages
creation and removal DX (#8502) - nuxt: Add
vue-router
to optimized deps (#8544) - vite: Handle all vite middleware routes (#8601)
- nuxt: Pass async-data errors through to client (#8521)
- nuxt: Check before appending comma in composable keys (#8529)
- nuxt:
⚠️ Use parser to generate page metadata (#8536) - kit: Normalize handler paths (#8626)
- nuxt: Don't force prerender
/
if user doesn't have that route (#8639) - nuxt: Do not inline global styles in html response (#8666)
- schema:
⚠️ Use strict typescript mode by default (#8667) - nuxt: Disallow directly rendering error page (#8673)
- Resolve ids to support pnpm (#8671)
- vite: Enable fs strict mode (#8674)
- nuxt: Ensure payload url has no protocol (#8675)
💅 Refactors
- test-utils:
⚠️ Update vitest args (#8325) - schema:
⚠️ Disableapp.pageTransition
andapp.layoutTransition
by default (#8436) - nuxt:
⚠️ Cleanup schema and split Nuxt 2 types (#8487)
📖 Documentation
- Add route rules to concepts > rendering (#8292)
- Fix broken link (#8319)
- Fix link to documentation guide (#8322)
- Update website-theme to 0.1.7 (dbc2c8ce)
- Add missing opening
<NuxtLayout>
tag in a code sample (#8349) - Update links for external tools (#8382)
- Update for clarity and fix typos (#8375)
- Add missing
app
key for transitions (#8385) - api: Add
<ClientOnly>
to API docs (#8400) - Fix typo (#8427)
- Disable transitions by default as hotfix (#8434)
- Add note about runtime config serialization (#8432)
- Change required node version to be above 16.11 (#8408)
- Use
LinkExample
as block component (#8459) - Add note about early hints and nginx (#8485)
- Updated bridge migration guide (#8471)
- Mention use case for
<KeepAlive>
indefinePageMeta
(#8491) - Update stability edge banners (#8498)
- Generate docs for unversioned schema (#8535)
- Fix transition wording to include layouts (#8600)
- Add information about type checking to
typescript.typeCheck
config. (#8632)
📦 Build
- pkg: Support Node.js 19 (#8324)
🏡 Chore
- renovate: Ignore monorepo dependency upgrades (f934343b)
- Upgrade vitest to 0.24 (#6764)
- nuxt: Add type for headers (#8326)
- examples: Add missing dependency and script for testing example (#8457)
- Reenable auto-upgrades for vueuse/head (#8506)
- Update nitropack to 0.6.1 (5a43e68e)
✅ Tests
❤️ Contributors
- Adewale Adeyemi
- Anthony Fu
- Christian Burkhart
- Clément Ollivier
- Damian Głowala
- Daniel Roe
- David Stack
- Dawid Stefanko
- Dmitr...
v3.0.0-rc.12
🚀 How to Upgrade
Note
Make sure to recreate the lock file in the project in case of any issues after the upgrade.
- Automated:
npx nuxi@latest upgrade --force
- Manual: Bump
nuxt
dependency to3.0.0-rc.12
and then usenpx nuxi@latest cleanup
to cleanup any local caches
⭐ What is New?
📍 Route Rules
RC.12 comes with the first public beta for route rules and hybrid rendering support. Using route rules you can define rules for a group of nuxt routes, change rendering mode or assign a cache strategy based on route! Nuxt server will automatically register corresponding middleware and wrap routes with cache handlers using Nitro caching layer. Whenever possible, route rules will be automatically applied to the deployment platform's native rules (currently Netlify and Vercel are supported).
👉 See docs for examples and more info.
⚗️ Nitropack 0.6
Nitropack upgraded to 0.6 (Release Notes) and h3 upgraded to 0.8 (Release Notes)
defineEventHandler()
or eventHandler()
is now required. If you were previously using a Node.js middleware with (req, res, next?)
syntax you need to wrap them with fromNodeMiddleware()
to convert it into an h3 handler.
👦 useHead
updates
This release brings a brand-new version of @vueuse/head
with some significant performance improvements and bug fixes. Check out #8000 for more details, but in particular:
- Fully-typed usage of
useHead
- No more flickering when transitioning between routes
- Support ordering of head metadata
- Faster head hydration and deduping
viewport
and charset
can only be used within nuxt.config
and not within useHead
directly. For more information on how to update, see #8000.
⚡ Page Meta
New router options validate
and redirect
are now supported directly in definePageMeta
- so you can perform additional validation for dynamic routes, or implement route redirects directly within pages.
definePageMeta({
// redirect: '/admin',
validate: async (route) => {
const nuxtApp = useNuxtApp()
// Check if the id is made up of digits
return /^\d+$/.test(params.id)
}
})
🌅 Early Hints
Nuxt's node server renderer will now respond with 103 Early Hints before the server renders the app, meaning that you should see a decreased TTFB and earlier resource loading in a supported environment - which at the moment is Chrome with your Nuxt app served over HTTPS with newer than HTTP/1.1.
📖 Nuxt 3 Docs
Nuxt's documentation is now written with Nuxt 3's new theming system and the latest Docus and Content module versions. Check it out at https://v3.nuxtjs.org! Expect more coming soon!
Changelog
🚀 Enhancements
- nuxt: Support
redirect
within page metadata (#7746) - cli: Support
--dotenv
fordev
,build
andpreview
commands (#7660) - nuxt: Allow configuring plugins directory (#7981)
- nuxt: Add default slot to
<NuxtLoadingIndicator>
(#7128) - pages: Add
validate
hook fordefinePageMeta
(#7870) - nuxt: Refresh override for data fetching composables (#7864)
- schema, nuxt: Allow user-configurable
serverDir
(#7868) - nuxt: Parse html to treeshake client-only components (#7527)
- nuxt: Wrap
#components
client exports with createClientOnly (#7412) - nuxt: Add
ssr: false
route rule to enable SPA mode (#7938) - nuxt: Migrate to latest
@vueuse/head
(#8000) - nuxt:
⚠️ Add<NuxtPage>
to#components
(#8145) - nuxt: Add hook debug mode (#7690)
- cli: Add
nuxi build-module
command (#7610) - schema: Add experimental
routesRules
shortcut (#7954) - kit: Support plugin array for
addVitePlugin
andaddWebpackPlugin
(#8270)
🔥 Performance
- nitro: Respond with early hints in node-based environments (#7893)
- nuxt:
⚠️ Use component loader to add meta components (#8167) - nuxt: Remove
vue-router
dependency from minimal app (#8188) - nuxt: Improve link prefetching (#8225)
🩹 Fixes
- nuxt: Export and auto-import
clearNuxtData
(#7710) - test-utils: Support vitest v0.20.x (#7712)
- cli: Include
workspaceDir
in tsconfig include (#7726) - cli: Stub
defineNuxtConfig
fornuxi info
(#7728) - nuxt: Do not warn for non-existent default layout (#7748)
- nuxt: Respect immediate option in
useFetch
(#7720) - nuxt: Respect
baseURL
when rendering payload path (#7809) - nuxt: Don't disable scripts in dev mode with experimental
noScripts
(#7745) - Downgrade Node.js
^16.11.0
requirement to^16.10.0
(#7865) - nuxt: Handle schema types for relative module paths (#7946)
- vite: Add type-checker to client build for
ssr: false
(#7930) - nuxt: Allow auto-import component with same filename (#7713)
- test-utils: Respect
setupTimeout
(#7866) - nuxt: Fix lazy import of
.client
components (#7422) - nuxt: Remove fragment from
createClientOnly
(#7774) - head: Allow using the default slot for script content like noscript (#7858)
- nuxt: Don't prerender
index.html
with a server (#7831) - docs: Link to api config reference (#8038)
- docs: Link to installation section (#8040)
- nuxt: Page hydration and double load (#7940)
- schema: Declare
untyped
dependency (#8064) - nuxt: Use correct cache and add baseURL to payload (#7984)
- cli: Replace
lazyHandle
withdefineLazyHandler
(#8049) - schema: Evaluate environment variables when resolving values (#8079)
- vite: Prevent overlap between vite assets and app routes (#7989)
- nuxt: Don't inline styles for per-request
ssr: false
(#8106) - nuxt:
⚠️ refresh
to override previous requests by default (#8190) - nuxt: Enable router when
app/router.options.ts
file is present (#8193) - kit: Log module id to the console when import fails (#8198)
- nuxt: Avoid head dom update on same route click (#8206)
- webpack: Add global to new line (#8226)
- schema: RouteRules config (#8252)
- cli: Don't include
workspaceDir
in tsconfig by default (#8256) - nuxt: Avoid preloading external routes (#8255)
- nuxt: Allow disabling early hints (#8264)
- nuxt: Lazy-load entry CSS (#8278)
- nuxt: Ignore cache rules for middleware and errors (#8291)
💅 Refactors
- nuxt: Use
unref
in `...
v3.0.0-rc.11
💬 Join the release discussion
🚀 How to Upgrade
Note
Make sure to recreate the lock file in the project in case of any issues after the upgrade.
- Automated:
npx nuxi@latest upgrade --force
- Manual: Bump
nuxt
dependency to3.0.0-rc.11
and then usenpx nuxi@latest cleanup
to cleanup any local caches
⭐ What is New?
Full Static Enhancements
We have introduced Full-Static mode payload extraction in RC.10. Many of the issues from the initial implementation are resolved with this release thanks to your amazing feedback! Notably for SPA routes and state that is now in the initial state.
🧪 We understand that there might be still issues with the new implementation. Please report if spotted any. You can use new experimental.payloadExtraction: false
flag in nuxt.config
to opt-out as well.
IPv6 and HTTPS support for nuxi dev
and vite
Nuxi CLI and unjs/listhen are improved and now support --https
flag and ipv6 hosts out of the box with an auto-generated certificate. You can use --ssl-cert
and --ssl-key
to provide own generated SSL certificates with mkcert for example as well.
Issues with vite HMR and vite-node should be resolved as well. If you were previously using NODE_TLS_REJECT_UNAUTHORIZED
or custom vite.server.hmr
options for a workaround, you can try to remove them.
Note: If you see something like http://[::]:3000/
when running nuxi preview
, it is all normal! The New IPv6 URL works in all modern browsers and is also backward compatible with IPv4 interfaces. If for some reason encountered any issues, try setting HOST
to 0.0.0.0
to disable IPv6 listener.
Nitro Improvements
Nitro is the server engine for Nuxt 3. We had landed several fixes in 0.5.2 and 0.5.3 versions improving stability and bug fixes.
Full Changelog
🚀 Enhancements
🩹 Fixes
- nuxt: Disable payload extraction for spa generated pages (#7535)
- nuxt: Do not pass prefetched class to custom link (#7522)
- cli: Improved self-signed certificate for
nuxi dev --https
(#7545) - vite:
nuxi dev --https
working out of the box (#7547) - schema: Update resolver for
cssSourceMap
with newsourcemap
format [bridge] (#7541) - nuxt: Pass fully resolved path to nitro dist files (#7494)
- nuxt: Remove modulepreload for spa fallback routes with
ssr:true
(#7553) - schema: Only disallow vite server port and host (#7554)
- nuxi, vite: Ipv6 support for
nuxi dev
(#7560) - cli: Print resolved public directory after generate (#7577)
- nuxt: Load payload after middleware and once final route is resolved (#7574)
- nuxt: Keep
state
in the initial state instead of extracting it (#7567) - vite: Normalize vite-node error data from server (#7589)
- vite: Include id and stack in
vite-node
fallback error handler (#7575) - vite: Respect
ctx.nuxt.options.modulesDir
for resolving externals withvite-node
(#7612) - nuxt: Add missing
process.client
for early redirect innavigateTo
(#7625) - vite-node: Include importer in error stack (#7607)
- vite, webpack: Avoid generating keys where a key is already provided (#7622)
- vite, webpack: Handle auto keys for composables without args (#7651)
- nuxt: Don't tree shake client-only fallback templates (#7659)
- nuxt: Strip non-
.vue
extensions from component types (#7673) - nuxt: Only observe tag elements for
<NuxtLink>
prefetching (#7679) - nuxi, vite: Support HTTPS with custom domain and HMR (#7680)
📖 Documentation
- Update auto-imports link (#7530)
- Add note about link prefetching (#7540)
- Improve NuxtLink prefetch explanation (#7540)
- Add testing and
addComponent
to modules and updateaddImports
(#7543) - Fix typo on directory-structure/pages (#7601)
- Fix typo in custom router example (8621c860)
- Fix typo in nitro options in wasm example (#7639)
- Add
addImportsSources
to list of kit utils (#7636) - api: Add
defineNuxtComponent
page (#7618) - testing: Move modules testing section to module authors guide (#7643)
- getting-started: Add views page (#7556)
❤️ Contributors
- Alexander Lichter
- Alper Doğan
- Chenying
- Clément Ollivier
- Damian Głowala
- Daniel Roe
- Julien Huang
- Krutie Patel
- Lexpeartha
- Pooya Parsa
- YIngChenIt
v3.0.0-rc.10
💬 Join the release discussion
🚀 How to Upgrade
Note
Make sure to recreate the lock file in the project in case of any issues after the upgrade.
- Automated:
npx nuxi@latest upgrade --force
- Manual: Bump
nuxt
dependency to3.0.0-rc.10
and then usenpx nuxi@latest cleanup
to cleanup any local caches
⭐ What is new?
Critical Styles are Inlined
Global styles and used component styles are now automatically inlined when server-side rendering a page. This feature helps to improve the First Contentful Paint (FCP) metric.
🧪 You can disable the feature from nuxt.config
using experimental: { inlineSSRStyles: false }
in case of any issues.
Full Static Generation with Payload Rendering
In Nuxt 2, we introduced an amazing feature called Full Static Generation. When using nuxt generate
, the payload of each page containing asyncData and state is extracted to a .js
chunk and we can deploy output to any static hosting without requiring a hosted API server. This feature also introduced performance benefits to reduce page size and allow smartly prefetching payload of next pages ahead of time when using nuxt generate
but kept limited to it.
This feature is now back in Nuxt 3 but much better! Payload is not only extracted during prerendering phase (nuxt generate
) but also can be rendered on demand by simply appending /_payload.js
to the end of any URL. This made implementation much simpler and also unlocks future development to enable payload rendering for hybrid static server and incremental generated pages. Followup #6411 for the roadmap.
Link Prefetching
Another goodie ported from Nuxt 2, is automatically prefetching the next pages when a <NuxtLink>
is in the viewport.
This feature is integrated with vue-router to prefetch components of the next route and also payload extraction to prefetch the payload of the next pages ahead of time! You can also hook into link:prefetch
to do more prefetches.
Better Workspace Support
Nuxt has several configurations for directories including rootDir
where nuxt.config
, package.json
, etc is, and srcDir
which is the same as rootDir
by default but can be customized to move project code such as pages/
to the src/
directory. With Monorepo becoming more popular, it became clear we need another new option to act smarter in a monorepo.
We have introduced a new workspaceDir
configuration. It is automatically detected from rootDir using different heuristics (how?). This option is used to extend the search path for node_modules
via #7439 but we will keep spreading its use in other places.
🧪 You can manually set workspaceDir
from nuxt.config
in case of any issues.
defineNuxtConfig
is Auto Imported
Nuxt uses unjs/jiti in order to support typescript and ESM syntax for nuxt.config
.
When importing { defineNuxtConfig } from 'nuxt'
in Nuxt 3, it causes the whole nuxt package to be loaded. It was making startup time slower.
We have introduced a new nuxt/config
subpath export that only exports defineNuxtConfig
for type support but you don't even need this anymore! Just remove import and enjoy shorter syntax!
-- import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
})
More Powerful nuxt init
We have switched to unjs/giget for a much more powerful template init engine.
Normally nuxi init
command should work as it was before. If you were using nuxt init org/repo
to clone the 3rd party GitHub repository, you should use nuxi init gh:org/repo
now.
Experimental Zero-Client-JS Mode
This new experimental flag allows turning off all Nuxt client js code when server-side rendering a page.
Using this feature is advisable for the very small minority of sites that would not benefit from client-side JS.
You can try this feature by setting experimental: { noScripts: true }
and let us know what you think!
Changelog
🚀 Enhancements
- nuxt, vite: Inline global and component styles in server response (#7160)
- nuxt: Custom
history
androutes
forapp/router.options.ts
(#7129) - nuxt: Router with hash mode (#6980)
- nuxt: Allow extending routes with custom alias (#7074)
- test-utils: Add
mockFn
andmockLogger
utils (#6235) - nuxt: Support experimental flag to render no client-side js (#7248)
- kit: Add
addImportsSources
utility (#7270) - nuxt: Add
immediate
option foruseAsyncData
anduseFetch
(#5500) - nuxt: Add
clearNuxtData
(#5227) - Allow client-side sourcemaps in production (#7313)
- nuxt: Filter support for
clearNuxtData
(#7323) - cli: Switch to
unjs/giget
fornuxi init
(#7361) - cli:
⚠️ Use giget 0.1x with template registry fornuxi init
(#7404) - nuxt: Payload rendering support (#6455)
- nuxt: Allow exposing type augmentations from extends layers (#7442)
- nuxt: Add
workspaceDir
option and add it tomodulesDir
(#7439) - nuxt: Support prefetching
<nuxt-link>
(#4329) - nuxt: Allow passing transition & keepalive props to
<NuxtPage>
(#7492) - nuxt, kit: Auto import
defineNuxtConfig
(#7497) - nuxt: Generate spa fallback for
nuxt generate
(#7507)
🔥 Performance
- nuxt: Cache
createClientOnly
wrapper using weakmap (#7297) - vite: Remove duplicate css links from rendered page when inlined (#7264)
- nuxt: Only inject preload helper when webpack is used (#7460)
- nuxt: Import
defineNuxtConfig
fromnuxt/config
(#7485) - Enable
treeshakeClientOnly
flag by default (#7484)
🩹 Fixes
- nuxt: Update default redirect code of
navigateTo
to302 Found
(#7189) - head: Case
http-equiv
correctly (#7190) - kit, nuxi: Semver regexp to support
nuxt-edge
current releases (bridge) (#7193) - vite: Use baseURL + assetsDir as base in dev mode (#7234)
- vite: Pass ssr condition to
getModuleByUrl
(#7260) - nuxt: Import and wrap client-only components once (#7245)
- cli: Pass value of
https
through to vite-node (#7271) - nuxt: Don't override payload error if it is present (#7290)
- nuxt: Don't try to set cookie after redirect (#7288)
- webpack: Promisify webpack dev/hot handlers using
h3.promisifyHandler
(#7275) - schema: Disallow setting vite server properties (#7317)
- schema: Mark vite server as optional (#7327)
- nuxt: Allow
abortMiddleware
to receive a nuxt error or error options (#7335) - webpack: Don't parse styles for composable keys (#7333)
- vite: Allow overriding vite sourcemap (#7342)
- schema: Resolve
ssr
(#7359) - kit: Add default config layer without
nuxt.config
file ([#7358](https://github.com/...
v3.0.0-rc.9
💬 Join the release discussion
Highlights
- ✅
app.config.ts
with HMR and Reactivity support (see documentation and example) - ✅ Vite-Node enabled by default (#6217)
- ✅ Updated to [email protected]
⚠️ autoImports
option and hooks is deprecated and renamed toimports
(#6864) (#7158)⚠️ Vue dependency is now externalized (#6868)⚠️ Handle prerelease constraint (#7116)- 👉 If you see an error like
Nuxt version ^3.0.0 is required but currently using 3.0.0-rc.9
, please contact the module author.
- 👉 If you see an error like
Changelog
🚀 Enhancements
- webpack, vite: Default to
.js
extension for client (#6505) - schema, vite:
⚠️ Enablevite-node
by default (#6217) - vite: Allow disabling entry warmup (#6647)
- nuxt: Exclude page chunks from being prefetched (#6662)
- cli: Auto cleanup with project manifest changes (#6672)
- nuxt:
app.config
with HMR and reactivity support (#6333) - nuxt: Allow
getRouteFromPath
to use objects (#5900) - nuxt: Add warning in dev mode if layouts/pages do not have a single root node (#5469)
- nuxt: Config options for default keepalive, page & layout transitions (#5859)
- nuxt: Allow programmatically prefetching global components (#6661)
- cli: Support mode flags for
add
command (#3921) - nuxt:
imports.autoImport
option to disable auto-imports (#6768) - nuxt:
navigateTo
supports external redirects (#5022) - nuxt:
app.config
improvements (#6905) - nuxt: Add
setPageLayout
utility (#6826, #7075) - cli: Display nuxt and nitro versions for dev and build commands (#7118)
- kit, schema: Allow extending with
theme
config (#7131) - nuxt:
⚠️ RenameautoImports
toimports
(#6864) - kit, nuxt: Improve
autoImports
deprecation dx (#7158) - nuxt: Pass and format vite-node build errors (#6683)
🔥 Performance
- nuxt: Tree-shake asyncData client logic from server (#7056)
- nuxt: Don't prefetch all global components (#7069)
🩹 Fixes
- nuxt: Remove stray commas in component templates (#6580)
- cli: Update
server.port
andserver.host
with listener info (#6595) - nuxt: Add
#components
alias to tsconfig (#6634) - vite: Pass relative url as default base (#6637)
- nuxt: Don't set asyncData to existing payload on CSR if
initialCache
is disabled (#6640) - vite: Warmup server entries with
ssr
condition (#6649) - nuxt: Include tag attrs for non self-closing tags in tree-shake regex (#6675)
- nuxt: Fallback to static error page on server error (#6697)
- cli: Ensure
nuxi upgrade
runs in rootDir (#6707) - cli: Properly detect hash and tag for upgrade changelog (#6708)
- nuxt: Use
vue-devtools-stub
to mock@vue/devtools-api
for both cjs + esm (#6713) - nuxt: Pass params to client-only slot (#6584)
- vite: Improve
vite-node
module invalidation (#6736) - vite: Dedupe
vue
in client bundle (#6735) - nuxt: Ensure component helper methods do not create side-effects (#6789)
- nuxt: Use deep assignment for app.config hmr (#6788)
- nuxt: Throw hard error on initial spa load if aborted (#6857)
- nuxt: Pass analyze options through to nitro (#6871)
- cli: Build all types on typecheck command (#5437)
- nuxt: Lazy composables shouldn't block setup in
ssr: false
(#6901) - vite: Remove client
manifest.json
from public dir (#7021) - kit: Sort aliases before resolving (#7018)
- nuxt: Use shared state for asyncData (#7055)
- vite: Sanitize client asset chunk names (#7067)
- schema: Sync types of vite v3.x (#7104)
- kit:
⚠️ Handle prerelease constraint (#7116)
💅 Refactors
- nuxt: Enable strict type checking (#6368)
- vite: Enable strict type checking (#6616)
- nuxt, kit: Improve type strictness (#6685)
- Enable strict type checking everywhere (#6943)
- Apply lints from
@nuxtjs/eslint-config-typescript
v11 (#7114) - nuxt: Remove unused
meta:register
hook (#7130)
📖 Documentation
- Ensure consistent casing of section headers (#6578)
- components: Use
fallbackTag
inClientOnly
examples (#6587) - Global style imports example (#6490)
- composables: Add more examples for
autoImports
(#6615) - server: Add nitro config and storage examples (#6507)
- data-fetching: Fix and simplify cookie proxy example (#5770)
- Tweaks for data fetching, server routes and composables (#6653)
- Update links to nitro.unjs.io (#6684)
- Make wording slightly clearer (#6740)
- Fix typo in
defineEventHandler
example (#6741) - api: Add
<NuxtWelcome />
component docs (#6745) - Use updated h3 utils (#6818)
- api: Add missing kit utilities (#6841)
- plugins: Add note about composable usage (#6744)
- api: Add
useNuxtApp
composable (#6786) - composables: Add nested and plugin injection examples (#6743)
- examples: Add jsx example (#6870)
- api: Add
addRouteMiddleware
util (#6894) - Update stormkit link (3ee812939)
- Update link to pinia nuxt module (#6952)
- deploy: Update command for csr prerendering (#6966)
- api: Enhance
abortNavigation
util (#6936) - api: Add
defineNuxtRouteMiddleware
util (#6933) - api: Add
definePageMeta
util (#6931) - Replace backtick with apostrophe (#7015)
- api: Fix the layout file extension in cli example ([#7024](https://github.com/nuxt/framework/pull...
v3.0.0-rc.8
Note
This version includes hotfixes from rc.7. Check v3.0.0-rc.7 release notes for all changes between rc.6...rc.8
Warning
There are slight API changes with this release candidate.
💬 Join the release discussion
🚀 How to upgrade
- Automated:
npx nuxi-edge@latest upgrade --force
- Manual: Bump
nuxt
dependency to3.0.0-rc.8
and then usenpx nuxi-edge@latest cleanup
to cleanup any local caches
🩹 Fixes
- cli: Fix issues with
nuxi upgrade
(#6514) - nuxt:
⚠️ Allowapp:rendered
to modify ssr context and addrender:html
(#6521) - vite: Remove
/@fs
from external ids (#6529) - nuxt: Tree-shake devtools from production bundle (#6538)
- vite, nuxt: Resolve relative to
srcDir
rather thanrootDir
(#6546)
📦 Build
- nuxt: Publish missing types (#6516)
📖 Documentation
- Change
info
todanger
for the pages root element (#6528) - quick-start: Add the file path for disabling generating shim (#6519)
- schema: Grammar, punctuation and typo fixes (#6469)
❤️ Contributors
- Damian Głowala
- Daniel Roe
- Eugen Istoc
- Jiang Menghao
- Pooya Parsa
- Timur Bolotov
v3.0.0-rc.7
Warning
There are slight API changes with this release candidate. Please check the linked issues marked with⚠️
Warning
This release contains some regressions. Please upgrade to the latest v3.0.0-rc.8
🚀 Enhancements
- vite: Check types with
vue-tsc
(#6012) - vite:
⚠️ Upgrade to vite v3 (#5398) - nuxt:
⚠️ Only scan top levelcomposables/
with glob support (#6025) - nuxt: Improve error DX (#4539)
- cli:
nuxi cleanup
command (#6125) - nuxt, schema: Add
<NoScript>
component andnoscript
typings (#6139) - nuxt:
app:rendered
andrender:response
hooks (#6042) - nuxt:
⚠️ Add support forcomponents/global
dir (#6070) - nuxt: Extends support for
app.vue
(#6228) - nuxt: Add
fetchpriority
attribute and literal typings for meta components (#6251) - kit: Support
followSymbolicLinks
option forresolveFiles
(#6240) - nuxt: Remove wrapper from client only components (#6165)
- nuxt: Add
setResponseStatus
utility (#6306) - vite: Log vite-node hmr updates (#6351)
- nuxt: Update to
[email protected]
(#6210) - nuxt: Update nitropack to latest (#6442)
🔥 Performance
- nuxt: Transform
#imports
to improve tree-shaking (#5763) - vite-node: Only invalidate cache for user code (#6156)
🩹 Fixes
- webpack: Do not resolve
#internal/nitro
alias internally (#5987) - nuxt:
⚠️ ChangestatusCode
type to number for error page template (#6010) - kit, nuxt: Always sort globby results (#6029)
- pages: Ignore expression delimiters within quotes (#6033)
- nuxt: Always write nitro types when building (#6035)
- kit: Resolve aliases in plugin src (#6037)
- vite: Invalidate virtual files when changed (#6038)
- nuxt: Use relative path to generate plugin variables (#6030)
- types: Generate relative path in
imports.d.ts
(#6054) - nuxt: Auto import for components with the external template (#6053)
- vite: Ignore
baseurl
when pruning manifest (#6063) - nuxt: Don't ignore components dirs with the same prefix (#6116)
- vite: Resolve
tsconfig.json
for vue-tsc type checker (#6069) - cli: Load
.env
file before starting dev server (#6119) - nuxt: Normalize manifest css file entries (#6112)
- vite: Allow overriding client HMR options (#6082)
- nuxt: Clear
vite-node
runner cache after each render (#6154) - nuxt: Add error event declaration to the
<NuxtErrorBoundary>
component (#6141) - schema: Add empty noscript array (#6155)
- vite: Use
unjs/externality
to handlevite-node
externals (#6153) - nuxt: Allow
useHead
to accept computed values (#6174) - schema: Exclude functions from
DeepPartial
(#6176) - nuxt: Don't call renderMeta if it is not defined (#6201)
- vite, webpack: Generate composable keys based on order (#6191)
- schema: Add typings for
vite.vue
options (#6220) - vite: Fix dist dir resolution (#6215)
- webpack: Output
.mjs
to use crossorigin preloads (#6232) - kit: Try extensions with
resolvePath
with absolute input (#6233) - nuxt: Do not allow catchalls to have child routes (#6257)
- nuxt: Narrow
nuxt.config
import protection (#6279) - nuxt: Separate routes for different suspense forks (#6275)
- nuxt: Avoid duplicate titleTemplate (#6296)
- nuxt: Render head scripts that use
body: true
(#6293) - nuxt: Generate
200.html
and404.html
spa fallback files (#6308) - nuxt: Extract component to provide route (#6325)
- nuxt: Remove literal
<script setup>
from comment (#6331) - vite: Improve
vite-node
hmr (#6343) - nuxt: Better equality check for json cookies (#6352)
- nuxt: Make the route provided to page children reactive (#6349)
- nuxi, kit: Enable
esmResolve
flag forjiti
(#6356) - nuxt: Resolve plugins and middleware to their full path (#6350)
- vite: Use URL for entry on windows (#6355)
- nuxt: Remove side-effect imports from page metadata (#6376)
- nuxt: Type
useRoute
return (#6395) - schema: Cleanup meta tags and deduplicate charset and viewport (#6378)
- kit: Move relative path handling back into nuxt templates (#6430)
- cli: Upgrade
listhen
(#6434) - nuxt: Do not log
404
andshowError
as fatal by default (#6437) - nuxt: Add
viteServerDynamicImports
as experimental flag (#6433) - nuxt: Use payload error state as the source of truth (#6389)
- vite: Add
module
type to vite node entry (#6448) - nuxt: Handle immediate errors when calling
useAsyncData
(#6441) - nuxt: Ensure component dirs in
node_modules
have lower scanning priority (#6382) - nuxt: InteropDefault for page component imports (#6468)
- nuxt: Immediately call
asyncData
handler (#6472) - nuxt: Log fatal errors as well as unhandled (#6488)
💅 Refactors
- nuxt: Enhance
useFetch
anduseLazyFetch
request type (#4825) - vite: Reuse logic and improve code splitting (#6164)
- test-utils: Remove unused codes (#6369)
- nuxt:
⚠️ Removenull
handling fortitleTemplate
(#6487)
📖 Documentation
- Fix typo in the roadmap (#5979)
- Update bridge migration with info about generating
.nuxt/tsconfig.json
for tests (#5967) - Warn that
useState
should only contain JSON-serializable content (#5994) - runtime-config: Clarify how environment variables are loaded (#5916)
- Add explicit
createError
import (#6050) - Expand contribution guide for ecosystem (#5922)
- Grammar fix (#6106)
- Update the link to the configuration (#6137)
- Grammar fix (#6166)
- api: Add
<NuxtLayout>
component docs (#6264) - Add
theme-color
meta (#6250) - Fix external link display text (#6323)
- api: Add missing hooks and environment column (#6329)
- Add missing periods (2cbdc5c)
- useFetch: Minor punctuation fixes (#6409)
- Update vue-router links (#6421)
- Update full static status (#6460)
📦 Build
- Upgrade to unbuild 0.8.x (#6483)
✅ Tests
❤️ Contributors
- Alwin Lohrie
- Anthony Fu
- Brendan Mulholland
- CSY54
- Conrawl Rogers
- Cédric Exbrayat
- Damian Głowala
- Daniel Roe
- David Tai
- Ennio Visconti
- Gregor Becker
- Harlan Wilton
- Hecateball
- Julien Huang
- Kazuya Kawaguchi
- Kevin Marrec
- Krutie Patel
- Lakshya Singh
- Mitsuki Fukunaga
- Mohammad Hosein Feizi
- Nathan Chase
- Nur Muhammad
- OptimusePrime
- Pooya Parsa
- Rio Weber
- Sanjaiyan Parthipan
- Sébastien Chopin
- Thomas
- Timur Bolotov
- Victor Saa
- YuTin Liu
v3.0.0-rc.6
✅ RC.6 is a hotfix release fixing known issues with previous releases
🚀 Enhancements
- schema: Sync types of vite v2.9.x (#5896)
🔥 Performance
- nuxt: Tree-shake client-only components from ssr bundle (#5750). Enabled by experimental
treeshakeClientOnly
flag (#5934)
🩹 Fixes
- vite: Set transform mode for
vite-node
(#5854) - kit: Only call
viteExtendConfig
callback once (#5929) - nuxt: Lazy load and tree-shake error templates (#5930)
- pkg: Use fixed version range for monorepo packages (#5933)
- vite: Avoid creating vite server for production build (#5941)
- vite: Unset
build.watch
options for production build (#5958) - vite: Use more strict app entry check in dev-bundler (#5959)
- cli: Add missing
types
field (#5962)
📖 Documentation
- Fix typo (#5881)
- Improve runtimeConfig example (#5785)
- Add readmore link (#5893)
- Add way to pass
.env
variables to nuxt app in production (#5879) - Add missing
initialCache
toUseFetchOptions
types (#5908) - Update roadmap (#5935)
- testing: Add missing import (#5956)
❤️ Contributors
- Anthony Fu
- Benicio Cardozo
- Bot08
- Damian
- Daniel Roe
- Kevin Marrec
- Lay
- Lm
- OptimusePrime
- Pooya Parsa
- Yoho
- 码农小余
See all changes: v3.0.0-rc.5...v3.0.0-rc.6