This repository was archived by the owner on Apr 6, 2023. It is now read-only.
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.
Beta Testing
Switch to the edge channel.
⭐ What is New?
⚗️ Nitropack@0.6 and h3@0.8
Nitropack upgraded to 0.6. [Release Notes]
Using
defineEventHandleris now required. If you were previously using Node.js middleware(req, res, next?)you need to wrap them withfromNodeMiddleware()to convert into h3 handler.📍 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 vertical are supported).
redirect- Define server-side redirects.ssr- Disables server-side rendering for sections of your app and make them SPA-only withssr: falsecors- Automatically adds cors headers withcors: true- you can customize the output by overriding withheadersheaders- Add specific headers to sections of your site - for example, your assetsstaticandswr-staticenables a single (on-demand) build;swrenables a static build, that lasts for a configurable TTL. (currently enables full incremental static generation on netlify, with Vercel coming soon)🧪 Route rules are still under active development, and subject to change.
Some examples:
👦
useHeadupdatesThis release brings a brand-new version of
@vueuse/headwith some significant performance improvements and bug fixes. Check out #8000 for more details, but in particular:useHeadThe shortcuts
viewportandcharsetcan only be used withinnuxt.configand not withinuseHeaddirectly. For more information on how to update, see #8000.📖 Page Meta
New router options
validateandredirectare now supported directly indefinePageMeta- so you can perform additional validation for dynamic routes, or implement route redirects directly within pages.🌅 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
compare changes
🚀 Enhancements
redirectwithin page metadata (#7746)--dotenvfordev,buildandpreviewcommands (#7660)<NuxtLoadingIndicator>(#7128)validatehook fordefinePageMeta(#7870)serverDir(#7868)#componentsclient exports with createClientOnly (#7412)ssr: falseroute rule to enable SPA mode (#7938)@vueuse/head(#8000)<NuxtPage>to#components(#8145)nuxi build-modulecommand (#7610)routesRulesshortcut (#7954)addVitePluginandaddWebpackPlugin(#8270)🔥 Performance
vue-routerdependency from minimal app (#8188)🩹 Fixes
clearNuxtData(#7710)workspaceDirin tsconfig include (#7726)defineNuxtConfigfornuxi info(#7728)useFetch(#7720)baseURLwhen rendering payload path (#7809)noScripts(#7745)^16.11.0requirement to^16.10.0(#7865)ssr: false(#7930)setupTimeout(#7866).clientcomponents (#7422)createClientOnly(#7774)index.htmlwith a server (#7831)untypeddependency (#8064)lazyHandlewithdefineLazyHandler(#8049)ssr: false(#8106)refreshto override previous requests by default (#8190)app/router.options.tsfile is present (#8193)workspaceDirin tsconfig by default (#8256)💅 Refactors
unrefinlayout.ts(#7818)unrefinfetch.ts(#7813)<Script>component tag in template (#8197)writeEarlyHintsfromh3(#8245)getRouteRulesfrom nitropack (#8251)📖 Documentation
useError()type definition (#7749)nuxt/auth(#7781): ?(#7928)definePageMetadocs (#7888)transitionspage (#7987)webpfor 3D gem asset (93c3f30b)website-theme@0.1.6(3218356d)definePageMeta(c804daa0)NuxtHookssource (#8128)RouterConfiginterface in examples (#8151)validateexample (#8231)useBodywithreadBody(#8266)button-link(#8275)🌊 Types
nuxt-linktarget types (#8172)🏡 Chore
<NuxtPage>to#components(#8145)refreshto override previous requests by default (#8190)❤️ Contributors
ue