Repository navigation
chore(deps): update nuxt framework to ^4.7.0 - #3929
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^4.6.4→^4.7.0^4.6.4→^4.7.0^4.6.4→^4.7.0Release Notes
nuxt/nuxt (@nuxt/kit)
v4.7.0Compare Source
📣 Some news
🧪 Try Nitro v3 today
You can now build your Nuxt 4 app with Nitro v3 (#37101). Nitro v3 is what Nuxt 5 is built on, so this is a way to move your server code (and your modules) over before you upgrade Nuxt itself.
There's no config to change. Just add
nitroto your dependencies:If
nitrois in yourpackage.json, Nuxt builds with Nitro v3. To go back, just remove it.Do give Nitro v3 a try! On our benchmark app with about 170 pages, the same app on 4.7 served 33% more requests per second on its home page with Nitro v3 than with Nitro v2 (926 to 1,236), and 44% more on a page with 1,000 links (219 to 316), with identical HTML.
On Nuxt 4, Nitro v3 runs with a compatibility layer,
nitroLegacy, which keeps imports fromh3,nitropackand#importsresolving, keeps the Nitro v2 auto-imports,useRuntimeConfig(event),event.nodeand the Nitro v2 hooks working, and keeps a long list of h3 v1 behaviours. Once things work, setnitroLegacy: falseto find the code that still depends on it.A few things change with Nitro v3 regardless. The main one is route rules:
/blog/*now also applies to/blog/2026/hello. Nuxt warns about each rule whose meaning changes (NUXT_B4029), and stops on a rule with more than one wildcard, like/api/*/items/**, which you can rewrite with a named parameter (/api/:id/items/**). Your app matches route rules the same way as the server, so Nuxt-only rules likeappMiddlewareandssrapply to the same paths on both.The other is imports. If your server code imported a package your app didn't depend on, Nitro v2 fell back to Nuxt's own dependencies. Nitro v3 doesn't, so
nuxt devfails with something likeCannot find package 'ufo'. Make sure every package your server code imports is in yourpackage.json. The upgrade guide has the full list.If something breaks for you (and it might), please open an issue and mention Nitro v3. ❤️
🖥️ Nuxt CLI 4.1
Nuxt 4.7 also comes with Nuxt CLI 4.1. The most visible change is that the CLI now renders the whole production build itself, from a set of new build hooks, with every builder and server builder (thanks to @atinux, nuxt/cli#1662, #37194):
nuxt generateshows the prerendered routes in the same way, and ends by suggesting where to deploy. Logs from Nuxt and modules stay inside the build output rather than breaking out of it (nuxt/cli#1705), and with nitropack v2.14 a route that fails to prerender is listed with the pages that link to it (#37245).There's more:
nuxt dev --httpsserves over HTTP/2 (thanks to @ProgramRipper, nuxt/cli#1694)nuxt module buildandnuxt module preparecommands for module authors (nuxt/cli#1687), paving the way for@nuxt/module-builderv2, built ontsdownwith support for TypeScript 7.1 (watch this space!)👀 Highlights
🤖 WebMCP (experimental)
WebMCP is a proposed browser API that lets a page offer tools to AI agents running in the browser. With
experimental.webmcp, tagging a function with@toolis enough (#37195):The arguments come from your template, so an agent can only do what a user could click. A
@toolon a@submithandler fills in and submits the form for real,defineAgentTool()anduseAgentTool()cover tools that don't map to one control, anduseAgentActivity()shows the user what an agent is doing (with a way to stop it).Nuxt also registers a
navigatetool listing your pages, warns at build time about bindings that can't become tools (or descriptions that don't follow Chrome's tool design guidance), and in development writes each page's tools to.nuxt/webmcp/schema.jsonforwebmcp-evals. In browsers without WebMCP, nothing registers and your app behaves exactly as before.This started from @sdras's proposal for Vue and WebMCP, and much of its shape comes from her work and feedback. Thank you, Sarah! 💚
👉 Read the WebMCP guide.
🔎 All your problems in one place
With
my-badv1 andvite-plugin-checkerv1, the dev error badge now collects problems too (#36918): type errors (withtypescript.typeCheck), ESLint or any other Vite checker, Vue compiler warnings (#36967) and Nuxt's own scan warnings (#36969). Each opens in a drawer beside your page, or in the DevTools v4 dock.And thanks to @sakaintp,
typescript.typeCheckcan now be'dev'or'build'(#36164).🩺 Template diagnostics
Nuxt now checks your templates for mistakes the Vue compiler can't know about (#36754): a
<NuxtLink>whose statictodoesn't match any page (NUXT_B4025), andv-on,v-model, functions or class instances on a server component (NUXT_B3014,NUXT_B3015).In development, these also show up on every open page until you fix them. Turn them off with
experimental.templateDiagnostics: false.🧯 Server-side error boundaries
With
experimental.ssrErrorBoundary(on withcompatibilityVersion: 5),<NuxtErrorBoundary>catches errors during server rendering too (#36990). One broken component no longer takes down the page: you get a200, the#errorslot in its place, and the client hydrates into the same state. A newretry-on-clientprop replaces<NuxtClientFallback>, which is now deprecated. The slot also exposesclearBoundaryError, the same method asclearErrorunder a name that can't be confused with the globalclearError(#37079).✅ Validated runtime config
Any value in
runtimeConfigcan now be a Standard Schema (Zod, ArkType, Valibot...) (#36905):Environment variables are converted to the schema's type at startup, and if anything is missing or invalid, the server doesn't start, and you get one error listing all of it. The schema itself never ends up in your server bundle.
🚀 Performance
We spent a lot of this release profiling. On the starter app from e18e's framework benchmarks, and on our own benchmark apps:
<NuxtLink>sstaticRoutesSome of the work behind that:
experimental.staticRoutesbuilds the server's route matcher once instead of per request, if you don't add routes at runtime (#36867) 🔥<NuxtLink>s render as plain anchors (#36904), and rendered HTML is encoded chunk by chunk (#36719)ofetchis left out of the client when nothing uses$fetch(#35790), and so is unhead when nothing on the client touches the head, even without your ownerror.vue(#37035, #37243)experimental.viteEnvironmentApi(orcompatibilityVersion: 5), the client and server build at the same time (#37047), andnuxt.schemafiles, decorators and JSX only cost build time when you use them (#37027, #37053, #37054)nuxtno longer depends on@nuxt/devtools, and ships the tiny@nuxt/devtools-onboardinstead, which loads DevTools v3 or v4 if you have it, or offers to install it (thanks to @antfu, #36581)nuxt buildis about 7% faster on the large app and about 6% slower on the starter, andnuxt devstarts as quickly as before.A huge thank-you to @onmax, who sent over twenty performance PRs for this release. ❤️
🦀 Rsbuild builder
Thanks to @Nsttt, there's a new
@nuxt/rsbuild-builder(builder: 'rsbuild') that hands your build to Rsbuild itself (#36499). It replaces@nuxt/rspack-builder, which is now deprecated.🧰 For module authors
addRendererPlugin()) add to the initial HTML with any server builder (#36601), plus a newrender:documenthook (#36989)build:environment:*andbuild:prerender:*hooks report every bundle and prerendered route (#37194)updateRuntimeConfig()accepts schemas, and there areextendRsbuildConfig()andaddRsbuildPlugin()defineHandlerfromnuxt/server, matching Nitro v3 (thanks to @atinux, #36929)nuxt.requesttracing channel for APM tools (thanks to @logaretm, #36483)🛠️ And more
addRouteMiddlewarereturns a function to remove the middleware again (#37080)onNuxtReadyaccepts atimeoutand asignal(#36743)sourcemap: { client: 'nosource' }and afinish-colorprop for<NuxtLoadingIndicator>(thanks to @0xgdr, #36534, #36533)navigateTo(url, { open })can passnoopenerby default, withexperimental.defaults.navigateTo.noopener(on withcompatibilityVersion: 5) (#37075)NuxtLinkSlotPropsis exported fromnuxt/app(thanks to @VividLemon, #37092)serverFetchis typed against your server routes (#36543)NUXT_E1014, #37076)nuxt.configas ESM, Nuxt suggests adding"type": "module"to yourpackage.json(#37205)🩹 Fixes
As always, lots of fixes. To name a few: @pawell67 made
callOncererun after navigating away while it runs and stopped Nitro creating a request body stream until it's read (#37149, #37129), @astraldev made cookies set before a streamed response starts reach the browser and kept page loading going while a page is still pending (#37131, #37165), @waleedtariq109 made lazy hydration replay the interaction that triggered it (#36838), @lafllamme made a failed read of shared prerender data retry on later routes instead of prerendering them withnull(#37244), and @posva kept the browser's restored scroll position on reload (#36957).🔒 Security
This release fixes three security issues. We recommend upgrading.
_payload.json(GHSA-jxc9-w3j6-pwp2, medium): affects a wildcardcache,swrorisrrule together with a more specific rule for a page. One user's page data could be cached and served to another.appMiddleware) on a catch-all page.nuxt devreachable from an untrusted network.Thank you to @inanna-malick, @stilwel, @kanokwut, @onur-yuksekkaya, @DicksonWu654 and @rexpository for reporting these responsibly. 💚
@nuxt/devtoolsto yourdevDependencies(or click the buttonnuxt devshows you).vueis older than the version it needs (NUXT_B7042). Nuxt 4.7 requiresvue^3.5.46, andnpx nuxt upgrade --dedupeupdates it along with Nuxt.NUXT_B4025warnings. For a link to a server route, a file inpublic/or another site, add theexternalprop.experimental.viteEnvironmentApi, the client and server build in parallel. If a Vite plugin reads the client build output from the server build, setexperimental.parallelBuild: false.globalThis.$fetchis only installed on the client when something uses it. If you read it somewhere Nuxt can't see at build time, setexperimental.globalFetch: true.@nuxt/rspack-builderand<NuxtClientFallback>are deprecated, in favour of@nuxt/rsbuild-builderand<NuxtErrorBoundary retry-on-client>.✅ Upgrading
Our recommendation for upgrading is to run:
This will refresh your lockfile and pull in the latest dependencies Nuxt relies on, including Nuxt CLI 4.1,
my-badv1 andvite-plugin-checkerv1.If you'd like to try Nitro v3, read Testing Nitro v3 in the upgrade guide first.
👉 Read the full release post for more details and examples.
👉 Changelog
compare changes
🚀 Enhancements
webmcpsupport for agent tools (#37195)"type": "module"when node reparses the config (#37205)noopenerfornavigateTowithopen(#37075)NuxtLinkSlotPropsfromnuxt/app(#37092)addRouteMiddleware(#37080)clearBoundaryErrorfrom<NuxtErrorBoundary>(#37079)async_hooks(#37052)<NuxtErrorBoundary>(#36990)render:documenthook (#36989)defineHandlerfromnuxt/serverand setdefineEventHandleras alias (#36929)$fetchpaths in-process with req context (#36919)experimental.globalFetchto always install the client$fetchglobal (97b8a0f48)devoption fortypescript.typeCheck(#36164)experimental.staticRoutesfor greater perf (#36867)'nosource'sourcemap option (#36534)serverFetchagainst server routes (#36543)timeout+signalforonNuxtReady(#36743)buildDir(#36746)finishColorprop to<NuxtLoadingIndicator>(#36533)nuxt.requesttracing channel (#36483)🔥 Performance
excludesin app and server tsconfig (#37145)app.vueinto server renderer (#37048)@vitejs/plugin-vue-jsxon first jsx/tsx module (#37054)untypedso a default install has nojiti(#36805)nuxt.schemafiles natively and read JSDoc with oxc (#37027)Intlformatters in<NuxtTime>(#37017)navigateToin the client pages-less router (#36994)defineAsyncComponent(#36985)ofetchfrom the client bundle when$fetchis unused (#35790)<NuxtLink>hooks in a single idle callback (#36755)@nuxt/devtools-onboardas a minimal devtools shim (#36581)node_modules(#36819)🩹 Fixes
b5a243dfc)38711ad5c)2bcefcce4)hasOwnPropertyisland prop withinheritAttrs: false(f9f9af215)64b35c893)writeOnlyproperty out ofwebmcptool schema defaults (a571c73b7)vue-tscfor type checking (#37230)#sharedvalue imports in server build (#37209)nuxt.configfiles (#37210)buildDiris in node_modules (#37204)render:html(#37148)nitroLegacy.importstoexperimental.nitroAutoImports(#37180)563572115)callOnceafter navigating away while it runs (#37149)Parameters<typeof $fetch>options + exportFetchOptions(#37172)useFetchoptions route params (#37173)noExternals+ drop wasm conditions in vite ssr (#37156)useAsyncDataerrors to the server runtime (#37160)vite:compileddev server reload until nitro has built (#37158)32fb81920)$fetchwrappers, named responses and its own parameters (#37152)acceptfor cached route errors on nuxt 4 + documentheadersrule order (#37140)statusCode+callHook(#37136)render:before(#37135)cache-controlfor cached responses (#37134)no-cachefor errors + convertnullto 204 in nitro v2 handlers (#37133)runtimeConfig(#37108)@vue/*packages from their dependents (#37115)nitroAutoImports(#37114)@NO_SIDE_EFFECTSannotations (#37107)useHydrationsetter when registered after app creation (#37099)https:hostas external (#37093)useResponseHeaderread back writes (#37072)useCookieclient fixes (#37071)navigateToopen option a no-op on the server (#37032)nuxt/serverwithout nitro (#37055)useStateinit functions when scope is disposed (#37033)Configuration
📅 Schedule: (UTC)
* * * * *)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.