This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
247e18b to
c98e5c7
Compare
072ab11 to
0455bcd
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.
Beta Testing
Switch to the edge channel.
What is new?
Critical Styles are Inlined
#6755, #7160
Global styles and used component styles are now automatically inlined when server-side rendering a page. This feature helps to improve the First Contentful Paint (FCP) metric.
🧪 You can disable the feature from
nuxt.configusingexperimental: { inlineSSRStyles: false }in case of any issues.Full Static Generation with Payload Rendering
#6411, #6455
In Nuxt 2, we introduced an amazing feature called Full Static Generation. When using
nuxt generate, the payload of each page containing asyncData and state is extracted to a.jschunk and we can deploy output to any static hosting without requiring a hosted API server. This feature also introduced performance benefits to reduce page size and allow smartly prefetching payload of next pages ahead of time when usingnuxt generatebut kept limited to it.This feature is now back in Nuxt 3 but much better! Payload is not only extracted during prerendering phase (
nuxt generate) but also can be rendered on demand by simply appending/_payload.jsto the end of any URL. This made implementation much simpler and also unlocks feature development to enable payload rendering for hybrid static server and incremental generated pages. Followup #6411 for the roadmap.Link Prefetching
#4329
Another goodie ported from Nuxt 2, is automatically prefetching the next pages when a
<NuxtLink>is in the viewport.This feature is integrated with vue-router to prefetch components of the next route and also payload extraction to prefetch the payload of the next pages ahead of time! You can also hook into
link:prefetchto do more prefetches.Better Workspace Support
unjs/pkg-types#34, #7439
Nuxt has several configurations for directories including
rootDirwherenuxt.config,package.json, etc is, andsrcDirwhich is the same asrootDirby default but can be customized to move project code such aspages/to thesrc/directory. With Monorepo becoming more popular, it became clear we need another new option to act smarter in a monorepo.We have introduced a new
workspaceDirconfiguration. It is automatically detected from rootDir using different heuristics (how?). This option is used to extend the search path fornode_modulesvia #7439 but we will keep spreading its use in other places.🧪 You can manually set
workspaceDirfromnuxt.configin case of any issues.defineNuxtConfigis Auto Imported#7267, #7485, #7497
Nuxt uses unjs/jiti in order to support typescript and ESM syntax for
nuxt.config.When importing
{ defineNuxtConfig } from 'nuxt'in Nuxt 3, it causes the whole nuxt package to be loaded. It was making startup time slower.We have introduced a new
nuxt/configsubpath export that only exportsdefineNuxtConfigfor type support but you don't even need this anymore! Just remove import and enjoy shorter syntax!-- import { defineNuxtConfig } from 'nuxt'More Powerful
nuxt initWe have switched to unjs/giget for a much more powerful template init engine.
Normally
nuxi initcommand should work as it was before. If you were usingnuxt init org/repoto clone the 3rd party GitHub repository, you should usenuxi init gh:org/reponow.Experimental Zero-Client-JS Mode
#7156, #7248
This new experimental flag allows turning off all Nuxt client js code when server-side rendering a page.
Using this feature is advisable for the very small minority of sites that would not benefit from client-side JS.
You can try this feature by setting
experimental: { noScripts: true }and let us know what you think!Changelog
(see all commits)
🚀 Enhancements
historyandroutesforapp/router.options.ts(#7129)mockFnandmockLoggerutils (#6235)addImportsSourcesutility (#7270)immediateoption foruseAsyncDataanduseFetch(#5500)clearNuxtData(#5227)clearNuxtData(#7323)unjs/gigetfornuxi init(#7361)nuxi init(#7404)workspaceDiroption and add it tomodulesDir(#7439)<nuxt-link>(#4329)<NuxtPage>(#7492)defineNuxtConfig(#7497)nuxt generate(#7507)🔥 Performance
createClientOnlywrapper using weakmap (#7297)defineNuxtConfigfromnuxt/config(#7485)treeshakeClientOnlyflag by default (#7484)🩹 Fixes
navigateToto302 Found(#7189)http-equivcorrectly (#7190)nuxt-edgecurrent releases (bridge) (#7193)getModuleByUrl(#7260)httpsthrough to vite-node (#7271)h3.promisifyHandler(#7275)abortMiddlewareto receive a nuxt error or error options (#7335)ssr(#7359)nuxt.configfile (#7358)FetchErrorforuseFetcherrors (#7435)@vue/runtime-core(#7448)vite-node(#7512)💅 Refactors
📖 Documentation
useFetchauto generated key (#7044)useHeadcomposable (#7072)externaloption ofnavigateTo(#7188).clientand.servercomponents (#7084)useAsyncDatasignature (#7242)app-configexample (#7247)AppConfigtoAppConfigInput(#7293)nuxi preparecommand (#7349)useRuntimeConfigpage (#7406)imports.d.tsfile (#7474)srcDirexample tosrc/(#7503)🏡 Chore
📦 Build
nodeto export conditions (0cc49e2a)✅ Tests
runIfandskipIfhelpers (#7312)🤖 CI
❤️ Contributors