Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.8.2
->3.9.0
Release Notes
nuxt/nuxt (nuxt)
v3.9.0
Compare Source
👀 Highlights
A very merry Christmas to you and yours from all Nuxters involved in this release! 🎁🎄
We have lots of features packed into v3.9.0 and can't wait for you to try them out.
⚡️ Vite 5
This release comes with Vite 5 and Rollup 4 support. Module authors may need to check to ensure that any vite plugins you're creating are compatible with these latest releases.
This comes with a whole host of great improvements and bug fixes - check out the Vite changelog for more info.
✨ Vue 3.4 ready
This release is tested with the latest Vue 3.4 release candidate, and has the necessary configuration to take advantage of new features in Vue 3.4, including debugging hydration errors in production (just set
debug: true
) in your Nuxt config.👉 To take advantage, just update your
vue
version once v3.4 is released, or try out the release candidate today:🏝️ Interactive Server Components
This is a highly-experimental update, but it's now possible to play around with interactive components within Nuxt server components. You'll need to enable this new feature additionally to component islands:
Now, within a server component, you can specify components to hydrate by using the
nuxt-client
directive:We're pretty excited about this one - so do let us know how you're using it! 🙏
🔥 Automatic Server Optimisations
We now use Vite's new AST-aware 'define' to perform more accurate replacements on server-side code, meaning code like this will no longer throw an error:
This hasn't been possible until now because we haven't wanted to run the risk of accidentally replacing normal words like
document
within non-JS parts of your apps. But Vite's newdefine
functionality is powered byesbuild
and is syntax-aware, so we feel confident in enabling this functionality. Nevertheless, you can opt out if you need to:🚦 Granular Loading API
We now have a new hook-based system for
<NuxtLoadingIndicator>
, including auseLoadingIndicator
composable that lets you control/stop/start the loading state. You can also hook intopage:loading:start
andpage:loading:end
if you prefer.You can read more in the docs and in the original PR (#24010).
🏁 Run single events in
callOnce
Sometimes you only want to run code once, no matter how many times you load a page - and you don't want to run it again on the client if it ran on the server.
For this, we have a new utility:
callOnce
(#24787).Note that this utility is context-aware so it must be called in component setup function or Nuxt plugin, as with other Nuxt composables.
Read more in the docs.
🚨 Error Types
For a while now, errors returned by
useAsyncData
anduseFetch
have been typed pretty generically asError
. We've significantly improved the type possibilities for them to make them more accurate in terms of what you'll actually receive. (We normalise errors with theh3
createError
utility under the hood, so they can be serialised from server to client, for example.)We've tried to implement the type change in a backwards compatible way, but you might notice that you need to update the generic if you're manually configuring the generics for these composables. See (#24396) for more information, and do let us know if you experience any issues.
🔥 Schema Performance
We've taken some time in this release to make some minor performance improvements, so you should notice some things are a bit faster. This is an ongoing project and we have ideas for improving initial load time of the Nuxt dev server.
✅ Upgrading
As usual, our recommendation for upgrading is to run:
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
<NuxtLayout>
(#24116)addComponentsDir
(#24309)useCookie
(#24503)error.data
when throwing 404 errors (#24674)/module
or/nuxt
module subpath if it exists (#24707)refresh
on islands and server components (#24261)dedupe
option for data fetching composables (#24564)undefined
on server (#24711)addServerScanDir
composable (#24001)setup
withindefineComponent
options (#24515)useRequestHeader
utility (#24781)callOnce
util to allow running code only once (#24787)NuxtIsland
(#22649)bundler
module resolution (#22821)toArray
util (#24857)🔥 Performance
resolve
operation (#24736)join
operation (#24717)get
operations (#24734)useRuntimeConfig
call (#24843)JSON.stringify
operation (#24848)🩹 Fixes
import.d.ts
(#24413)reactivityTransform
(vue 3.4) (#24477)<DevOnly>
(#24511)isBuiltin
polyfill for greater node support (#24512)<NuxtLayout>
usage in islands (#24529)error
inuseAsyncData
has correct type (#24396)appManifest
middleware after modules run (#24786)setup
withindefineComponent
(#24784)__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
(#24836)mode
fromfilePath
foraddComponent
(#24835)bundler
module resolution due to lack of support (22ce98d61)~/modules
dirs tomodulesDir
(#24457)💅 Refactors
defineComponent
to infer prop types for router-link stub (dc0e8347b)jiti.import
for schema (#24526)process.*
usage in nuxt vue app (#24749)future
andfeatures
namespace (#24880)📖 Documentation
typedPages
(#24436)defineNuxtConfig
to deployment example (#24451)~
to@
alias in examples (#24574)-o
option to--open
(#24644)<NuxtPage>
(#24675)getCachedData
option (#24697)addServerScanDir
example (7cd02e290)loadNuxt
options (#24201)nuxi module
(#24790)useFetch
anduseAsyncData
#24407 (#24775, #24407)addComponentsDir
example to modules author guide (#24876)🏡 Chore
dev:prepare
instead ofbuild:stub
(802b3e28c)✅ Tests
🤖 CI
nuxt/bridge
when composables change (#24752)❤️ Contributors
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.