This repository was archived by the owner on Feb 14, 2024. It is now read-only.
Open
Conversation
81e6e49 to
b863aed
Compare
b863aed to
bc478d8
Compare
188ab44 to
ab34262
Compare
ab34262 to
add8de4
Compare
0d9ec51 to
b289e07
Compare
b289e07 to
026de96
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
2.17.1->3.10.2Release Notes
nuxt/nuxt (nuxt)
v3.10.2Compare Source
✅ 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 vue and unjs ecosystems.
👉 Changelog
compare changes
🩹 Fixes
refreshCookie(#25635).pcssextension as a CSS extension (#25673)<ClientOnly>(#25714)baseURLon serveruseRequestURL(#25765)rootDir, notprocess.cwd, formodulesDir(#25766)useIdif attrs were not rendered (#25770)📖 Documentation
Fix typo in
useAsyncDatadocs (#25644)Add quotes to clarify what site title is in example (#25669)
Enable twoslash for some code snippets (#25679)
Add prepend option docs for
addComponentsDir(#25683)Extend auto-scanned layer directories (#25720)
Improve wording in seo docs (#25692)
Add how to debug nuxt with node inspector (#25731)
Add missing export defaults for nuxt config (#25774)
Add import statement for mountSuspended (#25783)
Pass
eventtouseRuntimeConfig(#25788)🏡 Chore
❤️ Contributors
v3.10.1Compare Source
✅ 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 vue and unjs ecosystems.
👉 Changelog
compare changes
🔥 Performance
🩹 Fixes
refreshfunctions (#25568)useIdtype signature (#25614)$from generated id inuseId(#25615)relfor same-site external links (#25600)inheritAttrs: falsewhen usinguseId(#25616)💅 Refactors
NuxtLinktypes (#25599)📖 Documentation
<NuxtLink>defaults in nuxt config (#25610)🏡 Chore
pathein internal tests (e33cec958)nuxt->nuxtAppinternally for consistency (c5d5932f5)🤖 CI
❤️ Contributors
v3.10.0Compare Source
👀 Highlights
v3.10 comes quite close on the heels of v3.9, but it's packed with features and fixes. Here are a few highlights.
✨ Experimental shared
asyncDatawhen prerenderingWhen prerendering routes, we can end up refetching the same data over and over again. In Nuxt 2 it was possible to create a 'payload' which could be fetched once and then accessed in every page (and this is of course possible to do manually in Nuxt 3 - see this article).
With #24894, we are now able to do this automatically for you when prerendering. Your
useAsyncDataanduseFetchcalls will be deduplicated and cached between renders of your site.👉 See full documentation.
🆔 SSR-safe accessible unique ID creation
We now ship a
useIdcomposable for generating SSR-safe unique IDs (#23368). This allows creating more accessible interfaces in your app. For example:✍️ Extending
app/router.optionsIt's now possible for module authors to inject their own
router.optionsfiles (#24922). The newpages:routerOptionshook allows module authors to do things like add customscrollBehavioror add runtime augmenting of routes.👉 See full documentation.
We now support (experimentally) polyfilling key Node.js built-ins (#25028), just as we already do via Nitro on the server when deploying to non-Node environments.
That means that, within your client-side code, you can import directly from Node built-ins (
node:and node imports are supported). However, nothing is globally injected for you, to avoid increasing your bundle size unnecessarily. You can either import them where needed.Or provide your own polyfill, for example, inside a Nuxt plugin.
This should make life easier for users who are working with libraries without proper browser support. However, because of the risk in increasing your bundle unnecessarily, we would strongly urge users to choose other alternatives if at all possible.
🍪 Better cookie reactivity
We now allow you to opt-in to using the CookieStore. If browser support is present, this will then be used instead of a BroadcastChannel to update
useCookievalues reactively when the cookies are updated (#25198).This also comes paired with a new composable,
refreshCookiewhich allows manually refreshing cookie values, such as after performing a request. See full documentation.🏥 Detecting anti-patterns
In this release, we've also shipped a range of features to detect potential bugs and performance problems.
setIntervalis used on server (#25259).<NuxtPage />but have thevue-routerintegration enabled (#25490). (<RouterView />should not be used on its own.)🧂 Granular view transitions support
It's now possible to control view transitions support on a per-page basis, using
definePageMeta(#25264).You need to have experimental view transitions support enabled first:
And you can opt in/out granularly:
Finally, Nuxt will not apply View Transitions if the user's browser matches
prefers-reduced-motion: reduce(#22292). You can setviewTransition: 'always'; it will then be up to you to respect the user's preference.🏗️ Build-time route metadata
It's now possible to access routing metadata defined in
definePageMetaat build-time, allowing modules and hooks to modify and change these values (#25210).Please, experiment with this and let us know how it works for you. We hope to improve performance and enable this by default in a future release so modules like
@nuxtjs/i18nand others can provide a deeper integration with routing options set indefinePageMeta.📦 Bundler module resolution
With #24837, we are now opting in to the TypeScript
bundlerresolution which should more closely resemble the actual way that we resolve subpath imports for modules in Nuxt projects.'Bundler' module resolution is recommended by Vue and by Vite, but unfortunately there are still many packages that do not have the correct entries in their
package.json.As part of this, we opened 85 PRs across the ecosystem to test switching the default, and identified and fixed some issues.
If you need to switch off this behaviour, you can do so. However, please consider raising an issue (feel free to tag me in it) in the library or module's repo so it can be resolved at source.
✅ 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
tryUseNuxtAppcomposable (#25031)bundlermodule resolution (#24837)pages:routerOptionshook (#24922)setIntervalis used on server (#25259)refreshCookie+ experimental CookieStore support (#25198)useIdcomposable (#23368)🔥 Performance
endsWithwhen checking for whitespace (#24746)🩹 Fixes
prefers-reduced-motion(#22292)fallbackin island response (#25296)defineModeloption as it is now stable (#25306)hiddensourcemap values to vite (#25329)dedupe(#25334)instance.attrsin client-only components (#25381)callOncecallbacks (#25431)nuxt-clientwithin template code (#25464)dependsOn(#25409)NuxtError(#25398)vue-routerwarning with routeRule redirect (#25391)useRequestEvent(#25480)useRuntimeConfigsignatures (#25440)pages:routerOptionshook (#25509)💅 Refactors
currentRoutenon-ref warning (#25337)📖 Documentation
@sinceannotations to exported composables (#25086)useAsyncDataexplanation (#25392)error.vue(#25320)error.vue(#25396).cjsextension forecosystem.config(#25459)routeRulesexample of swr/isr (#25436)sharedPrerenderData(b0f50bec1)pages:routerOptions(46b533671)🏡 Chore
NuxtPageis not used when pages enabled (#25490)✅ Tests
data-island-uidreplacement (#25346)🤖 CI
$fetch(a1fb399eb)❤️ Contributors
v3.9.3Compare Source
v3.9.2Compare Source
✅ 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 vue and unjs ecosystems.
👉 Changelog
compare changes
🔥 Performance
Object.fromEntries(#24953)🩹 Fixes
optionsinaddTemplate(#25109)pages/files inen-USlocale (#25195)nextTick(#25197)💅 Refactors
data-island-component(#25232)📖 Documentation
<NuxtPage>rather than<RouterView>(#25106)@nuxt/bridge-edge(3f09ddc31)--log-leveldescription (#25211)immediate: falsein the appropriate example (#25224).global.vuefilename for global components (#25144)lagonfrom deployment providers (#24955)definePageMeta(#25073)addDevServerHandlerAPI (#25233)nuxifor bridge (637f5622d)🏡 Chore
v3branch sandbox in issue template (#25174)❤️ Contributors
v3.9.1Compare Source
✅ 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 vue and unjs ecosystems.
👉 Changelog
compare changes
🔥 Performance
useRequestHeaders(#24853)startsWithto array access (#24744)🩹 Fixes
NuxtErrorBoundarywithssr: false(#24896)anyin inferred injections (#25010)<ClientOnly>(#25009)currentRouteinRef(#25026)💅 Refactors
nuxt-config-schema(#25067)📖 Documentation
features/futuredocs (f5676fba5)vue-routerdocs link (#24948)readValidatedBodyandgetValidatedQuery(#24990)getValidatedRouterParams(#25057)🏡 Chore
✅ Tests
❤️ Contributors
v3.9.0Compare 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
vueversion once v3.4 is released, or try out the release candidate today:{ "dependencies": { "nuxt": "3.9.0", "vue": "3.4.0-rc.1", "vue-router": "latest" } }🏝️ 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-clientdirective: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
documentwithin non-JS parts of your apps. But Vite's newdefinefunctionality is powered byesbuildand 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 auseLoadingIndicatorcomposable that lets you control/stop/start the loading state. You can also hook intopage:loading:startandpage:loading:endif you prefer.You can read more in the docs and in the original PR (#24010).
🏁 Run single events in
callOnceSometimes 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
useAsyncDataanduseFetchhave 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 theh3createErrorutility 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.datawhen throwing 404 errors (#24674)/moduleor/nuxtmodule subpath if it exists (#24707)refreshon islands and server components (#24261)dedupeoption for data fetching composables (#24564)undefinedon server (#24711)addServerScanDircomposable (#24001)setupwithindefineComponentoptions (#24515)useRequestHeaderutility (#24781)callOnceutil to allow running code only once (#24787)NuxtIsland(#22649)bundlermodule resolution (#22821)toArrayutil (#24857)🔥 Performance
resolveoperation (#24736)joinoperation (#24717)getoperations (#24734)useRuntimeConfigcall (#24843)JSON.stringifyoperation (#24848)🩹 Fixes
import.d.ts(#24413)reactivityTransform(vue 3.4) (#24477)<DevOnly>(#24511)isBuiltinpolyfill for greater node support (#24512)<NuxtLayout>usage in islands (#24529)errorinuseAsyncDatahas correct type (#24396)appManifestmiddleware after modules run (#24786)setupwithindefineComponent(#24784)__VUE_PROD_HYDRATION_MISMATCH_DETAILS__(#24836)modefromfilePathforaddComponent(#24835)bundlermodule resolution due to lack of support (22ce98d61)~/modulesdirs tomodulesDir(#24457)💅 Refactors
defineComponentto infer prop types for router-link stub (dc0e8347b)jiti.importfor schema (#24526)process.*usage in nuxt vue app (#24749)futureandfeaturesnamespace (#24880)📖 Documentation
typedPages(#24436)defineNuxtConfigto deployment example (#24451)~to@alias in examples (#24574)-ooption to--open(#24644)<NuxtPage>(#24675)getCachedDataoption (#24697)addServerScanDirexample (7cd02e290)loadNuxtoptions (#24201)nuxi module(#24790)useFetchanduseAsyncData#24407 (#24775, #24407)addComponentsDirexample to modules author guide (#24876)🏡 Chore
dev:prepareinstead ofbuild:stub(802b3e28c)✅ Tests
🤖 CI
nuxt/bridgewhen composables change (#24752)❤️ Contributors
v3.8.2Compare Source
👀 Highlights
3.8.2 is a patch release and we've deferred some exciting features in our next release (3.9.0, expected in December) but it does bring a significant Nitro minor release: v2.8.0. It's well worth checking out the release notes.
👉 Note that as Nitro has updated to rollup v4, but as Nuxt's vite dependency is still on rollup v3 until v3.9, you may experience type mismatches in modules or your projects if you are dependent on particular rollup plugins or plugin types.
✅ 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
🩹 Fixes
transformAssetUrls(#24173)createError(#24093)plugins.d.tsif they will be written (#23943)typeofoptimisations ([#23903](https://togithub.Configuration
📅 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 this update again.
This PR has been generated by Mend Renovate. View repository job log here.