chore(deps): update nuxt core to v4 (major)#59
Open
renovate[bot] wants to merge 2 commits intomainfrom
Open
Conversation
a516d71 to
03d6944
Compare
03d6944 to
043f8ab
Compare
0413f39 to
42aa1a3
Compare
d14141f to
9513d99
Compare
ce030d2 to
7c50a1a
Compare
5a12d1a to
f40a8fc
Compare
1d2d0e9 to
608cdb9
Compare
608cdb9 to
e9f6402
Compare
e9f6402 to
8820652
Compare
1fc5358 to
d6a86b0
Compare
fed7e09 to
60d9c3d
Compare
60d9c3d to
ca48e08
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
4add32c to
68d6b72
Compare
4950264 to
9ea0fc7
Compare
0d642a0 to
ec8ff5a
Compare
5028f29 to
87d6018
Compare
a48d296 to
3177aed
Compare
3177aed to
3b336d8
Compare
3b336d8 to
3ac2a00
Compare
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
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.
This PR contains the following updates:
3.21.0→4.0.0^3.16.1→^4.0.0Release Notes
nuxt/test-utils (@nuxt/test-utils)
v4.0.0Compare Source
👀 Highlights
We're releasing Nuxt Test Utils v4, with support for Vitest v4. 🚀
Better mocking support
The biggest improvement in this release is how mocking works. Nuxt initialization has been moved from
setupFilesto thebeforeAllhook (#1516), which meansvi.mockandmockNuxtImportcalls now take effect before Nuxt starts. This fixes a long-standing issue where mocks for composables used in middleware or plugins wouldn't apply reliably (#750, #836, #1496).On top of that,
mockNuxtImportnow passes the original implementation to the factory function (#1552), making partial mocking much more natural:registerEndpointimprovementsregisterEndpointnow works correctly with query parameters in URLs (#1560), and endpoints registered in setup files are no longer lost when modules reset (#1549).🚧 Migration
@nuxt/test-utilsv4 contains a few breaking changes, almost all related to requiring at least vitest v4 as a peer dependency (if you are using vitest). It replacesvite-nodewith Vite's native Module Runner and simplifies pool configuration.This will mean improvements for test performance and mocking, but does require some changes to your test code.
Update your dependencies
Update
vitestand its companion packages together:{ "devDependencies": { - "@​nuxt/test-utils": "^3.x", - "vitest": "^3.x", - "@​vitest/coverage-v8": "^3.x" + "@​nuxt/test-utils": "^4.0", + "vitest": "^4.0", + "@​vitest/coverage-v8": "^4.0" } }Peer dependencies
We've tightened peer dependency ranges. You may need to update some of these:
vitest^3.2.0^4.0.2happy-dom*>=20.0.11jsdom*>=27.4.0@jest/globals^29.5.0 || >=30.0.0>=30.0.0@cucumber/cucumber^10.3.1 || >=11.0.0>=11.0.0@testing-library/vue^7.0.0 || ^8.0.1^8.0.1Later environment setup
This is the change that might require most change in your tests. Because we've moved the nuxt environment setup into
beforeAll, this means composables called at the top level of adescribeblock will fail with[nuxt] instance unavailable.This applies to
useRouter(),useNuxtApp(),useRoute(), and any other Nuxt composable or auto-import.Stricter mock exports
If you use
vi.mockwith a factory function, accessing an export that the factory doesn't return will now throw an error instead of silently returningundefined.Other changes
For the full list, see the vitest v4 migration guide.
👉 Changelog
compare changes
🚀 Enhancements
mockNuxtImportfactory (#1552)beforeAllhook (#1516)🩹 Fixes
registerEndpointwith query params (#1560)nextTickimport (#1563)💅 Refactors
@nuxt/devtools-kitfor devtools hooks (426e0b537)📖 Documentation
🏡 Chore
app-vitestfollow advised setup guidelines (#1542).nuxtrc(b4021dee4)✅ Tests
beforeAllhook (#1516)❤️ Contributors
v3.23.0Compare Source
👉 Changelog
compare changes
🚀 Enhancements
🩹 Fixes
$fetchis not typed asany(1f4754ea9)🏡 Chore
console.log(aef693340)✅ Tests
🤖 CI
❤️ Contributors
v3.22.0Compare Source
👉 Changelog
compare changes
🚀 Enhancements
vitestin separate process (#1524)NuxtPageexists (#1530)🔥 Performance
🩹 Fixes
.syncmethod for syncing route (1148c3cf1)server.depsrather thandeps(2b3c86921)sync()in initial setup (ec555192c)devtools:beforehook instead of direct config check (#1532)rootDir(#1531)💅 Refactors
addCleanup(86b4998bb)📖 Documentation
🏡 Chore
nuxtcli command in preference tonuxi(838ed8b6a)@vitest/uito example (ffaccd8a1)package.jsonnames (417102718)✅ Tests
defaultLocalein i18n test (059988fc3)🤖 CI
knipon pull requests (a94098671)❤️ Contributors
nuxt/nuxt (nuxt)
v4.3.0Compare Source
Nuxt 4.3 brings powerful new features for layouts, caching, and developer experience – plus significant performance improvements under the hood.
📣 Some News
Extended v3 Support
Early this month, I opened a discussion to find out how the upgrade had gone from v3 to v4. I was really pleased to hear how well it had gone for most people.
Having said that, we're committed to making sure no one gets left behind. And so we will continue to provide security updates and critical bug fix releases beyond the previously announced end-of-life date of January 31, 2026, meaning Nuxt v3 will meet its end-of-life on July 31, 2026.
Preparing for Nuxt 5
We're closer than ever to the releases of Nuxt v5 and Nitro v3. In the coming weeks, the
mainbranch of the Nuxt repository will begin receiving initial commits for Nuxt 5. However, it's still business as usual.mainbranch4.xand3.xbranchesKeep an eye out on the Upgrade Guide – we'll be adding details about how you can already start migrating your projects to prepare for Nuxt v4 with
future.compatibilityVersion: 5.🗂️ Route Rule Layouts
But that's enough about the future. We have a lot of good things for you today!
First, you can now set layouts directly in route rules using the new
appLayoutproperty (#31092). This provides a centralized, declarative way to manage layouts across your application without scatteringdefinePageMetacalls throughout your pages.This might be useful for:
📦 ISR/SWR Payload Extraction
Payload extraction now works with ISR (incremental static regeneration), SWR (stale-while-revalidate) and cache
routeRules(#33467). Previously, only pre-rendered pages could generate_payload.jsonfiles.This means:
🧹 Dev Mode Payload Extraction
Related to the above, payload extraction now also works in development mode (#30784). This makes it easier to test and debug payload behavior without needing to run a production build.
🚫 Disable Modules from Layers
When extending Nuxt layers, you can now disable specific modules that you don't need (#33883). Just pass
falseto the module's options:🏷️ Route Groups in Page Meta
Route groups (folders wrapped in parentheses like
(protected)/) are now exposed in page meta (#33460). This makes it easy to check which groups a route belongs to in middleware or anywhere you have access to the route.This provides a clean, convention-based approach to route-level authorization without needing to add
definePageMetato every protected page.🎨 Layout Props with
setPageLayoutThe
setPageLayoutcomposable now accepts a second parameter to pass props to your layout (#33805):🔧
#serverAliasA new
#serveralias provides clean imports within your server directory (#33870), similar to how#sharedworks:The alias includes import protection – you can't accidentally import
#servercode from client or shared contexts.🪟 Draggable Error Overlay
The development error overlay introduced in Nuxt 4.2 is now draggable and can be minimized (#33695). You can:
This is a quality-of-life improvement when you're iterating on fixes and don't want the overlay blocking your view.
https://github.com/user-attachments/assets/nuxt_4-3_error_demo.mp4
⚙️ Async Plugin Constructors
Module authors can now use async functions when adding build plugins (#33619):
This enables true lazy loading of build plugins, avoiding unnecessary code loading when plugins aren't needed.
🚀 Performance Improvements
This release includes several performance optimizations for faster builds:
nuxt:ssr-stylesplugin is now significantly faster (#33862, #33865)rou3, removing the need forradix3in the client bundle and eliminating app manifest fetches (#33920)🎨 Inline Styles for Webpack/Rspack
The
inlineStylesfeature now works with webpack and rspack builders (#33966), not just Vite. This enables critical CSS inlining for better Core Web Vitals regardless of your bundler choice.statusCode→status,statusMessage→statusTextIn preparation for Nitro v3 and H3 v2, we're moving to use Web API naming conventions (#33912). The old properties still work but are deprecated in advance of v5:
🐛 Bug Fixes
Notable fixes in this release:
keyattribute (#33958, #33963)useCookieunsafe number parsing during decode (#34007)NuxtPagenot re-rendering when nestedNuxtLayouthas layouts disabled (#34078)allowArbitraryExtensionsby default in TypeScript config (#34084)noUncheckedIndexedAccessto server tsconfig for safer typing (#33985)📚 Documentation
🎉 Nuxt 3.21.0
Alongside v4.3.0, we're releasing Nuxt v3.21.0 with many of the same improvements backported to the 3.x branch. This release includes:
setPageLayout,#serveralias, draggable error overlay, and morefalseuseCookienumber parsing, head component deduplication, and more✅ Upgrading
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe # or, if you are upgrading to v3.21 npx nuxt@latest upgrade --dedupe --channel=v3This will deduplicate your lockfile and help ensure you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🚀 Enhancements
#serveralias for server directory imports (#33870)crosswstypes (5b16a51f5)false(#33883)moduleDependenciesas an async function (#33504)appLayoutin route rules (#31092)setPageLayout(#33805)🔥 Performance
nuxt:ssr-stylesplugin (#33862)🩹 Fixes
router.replacein page hmr (#33897)page:loading:endin cache if already called (7789f73bd)NUXT_VITE_NODE_OPTIONS(41a564d23)appMiddlewarereferences invalid key (323f27bc8)nuxt/meta(01c2c9b13)keyfor tag deduplication in<Head>component (#33958)build.transpilewhen initialising vite (#33868)onUpgradearguments with types (#33988)rou3(2df4e1ae3)noUncheckedIndexedAccessto server tsconfig (#33985)shared/context (#33978)useRequestFetch(#33976)h3types to auto-imports (#34035)nuxt/schema(a6a044d81)NuxtPagewhen nestedNuxtLayouthas explicitly disabled layouts (#34078)allowArbitraryExtensionsby default (#34084)useAsyncDatadebounced execute post watcher flush (#34125)typeFromsupport forimports.d.tstemplate exports (#34135)hydrate-nevercomponents (#34132)💅 Refactors
defu+consola(322dae3e0).tsfile extensions to relative imports (80778c0cd)<>toas(f1713850c)~prefix for internal ssrContext properties (#33896)status/statusText+ deprecate old props (#33912)📖 Documentation
Module Author Guides(#33803)useHeadreturn type (#33857)statusText(#32834)defineWrappedResponseHandler(#33952)addImportsexample (#34011)config.experimentalproperties (#34069)nullfromgetCachedDatatrigger (f7cf3747e)useStatedocs (#34105).nuxtrcexample (#34107)addServerHandler(#34060)appLayout(beda47955)falseto its options (cdad9310c)sourcefrom<NuxtIsland>(1586bbb6e)📦 Build
vite-nodeentrypoints (#33893)obuildexcept for nuxt + nitro-server packages (#34049)/builder-envsubpath types (7f5034288)🏡 Chore
build:stubcommand for those that need it (3e3d3d37a)node:process(#33982)✅ Tests
vi.hoistedfor klona mock (#34113)🤖 CI
❤️ Contributors
v4.2.2Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
page:finishhook (#33707)tsconfig.server.json(#33510)moduleDependenciesby meta name (#33774).d.vue.tsdeclarations (1c73525a2)callOnceduring HMR (#33810)useAsyncData(#33802)rootDirto cached layer config (#33779)moduleDependencies->installModule(#33689)💅 Refactors
callOncefunction (#33825)📖 Documentation
erroras non-optional prop (#33763)🏡 Chore
✅ Tests
patchPropandnodeOpsto excluded Vue helpers (#33754)🤖 CI
--pnpmflag to correctly publish prerelease (#33688)❤️ Contributors
v4.2.1Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
ImportPresetWithDeprecation(#33596)<nuxt-error-overlay>iframe border (#33625)moduleEntryPaths(#33628)optimizeDepsconfig is applied before other plugins (#33586)pages:resolved(#33662)vite-node(#33663)💅 Refactors
📖 Documentation
pendingas alias ofstatus === 'pending'(#33221)cookieStoreistrueby default ([#33572](https://redirect.github.com/nuxt/nuxtConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 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.