This repository has been archived by the owner on Aug 21, 2024. 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.
This PR contains the following updates:
3.6.5
->3.8.0
0.4.0
->0.5.2
3.6.5
->3.8.0
3.6.5
->3.8.0
3.6.5
->3.8.0
Release Notes
nuxt/nuxt (@nuxt/kit)
v3.8.0
Compare Source
👀 Highlights
We have a lot of exciting features in v3.8, and can't wait for you to try it out.
💻 Nuxi improvements
Just to remind you, we're now using the new Nuxt CLI which is now versioned separately. There are some exciting improvements there to follow, so do check out the latest releases. (For example, we now share the same port with the Vite websocket, meaning better support for docker containers in development.)
🚨 Built-in Nuxt DevTools
Nuxt DevTools v1.0.0 is out and we now think it's ready to be shipped as a direct dependency of Nuxt.
👉 You can check out the release notes for more information - and stay tuned for an article detailing our roadmap for the future.
📸 Nuxt Image auto-install
We've now made
<NuxtImg>
and<NuxtPicture>
first-class built-in components, documenting them and auto-installing@nuxt/image
the first time that they are used (#23717).autoinstall2.mp4
We would definitely advise using
@nuxt/image
if you're using images in your site; it can apply optimisations to make your site more performant.📂 Deeper layout scanning
🚨 This is a behaviour change so do take care with this one: 🚨
We now support scanning layouts within subfolders in
~/layouts
in the same way as we do with~/components
.File | Layout name
-- | --
~/layouts/desktop/default.vue | 'desktop-default'
~/layouts/desktop-base/base.vue | 'desktop-base'
~/layouts/desktop/index.vue | 'desktop'
See #20190 for more information
📊 App Manifest
We now support a built-in app manifest (see #21641), which generates a manifest at
/_nuxt/builds/meta/<buildId>.json
.Initially this enables loading payloads only for prerendered routes, if a site is static (preventing 404s). It also enables client-side route rules. To begin with, only
redirect
route rules will have an effect; they will now redirect when performing client-side navigation. (More coming soon...!)The app manifest also enables future enhancements including detection of outdated deployments by checking
/_nuxt/builds/latest.json
.You can switch off this behaviour if you need to (but do let us know if you have any issues):
🤝 Scope and context improvements
We now define a 'scope' for Nuxt composables executed in plugins (#23667), which allows running synchronous cleanup before navigating away from your site, using the Vue
onScopeDispose
lifecycle method. This should fix an edge case with cookies (#23697) and also improves memory management, for example in Pinia stores (#23650). You can read more about Vue effect scopes.We also now support native async context for the Vue composition API (#23526). In case you're unaware, we support native async context on Node and Bun, enabled with
experimental.asyncContext
. This can help address issues with missing a Nuxt instance. But it didn't previously affect missing Vue instances.If you experience issues with 'Nuxt instance unavailable', enabling this option may solve your issues, and once we have cross-runtime support we are likely to enable it by default.
🔗 NuxtLink defaults
We've supported defining your own
NuxtLink
components with thedefineNuxtLink
utility. We now support customising the options for the built-in<NuxtLink>
, directly in yournuxt.config
file (#23724). This can enable you to enforce trailing slash behaviour across your entire site, for example.⚡️ Data fetching improvements: deep and caching
We have two very significant new features for
useAsyncData
anduseFetch
:deep: false
to prevent deep reactivity on thedata
object returned from these composables (#23600). It should be a performance improvement if you are returning large arrays or objects. The object will still update when refetched; it just won't trigger reactive effects if you change a property deep within thedata
.getCachedData
option to handle custom caching for these composables (#20747)We also support configuring some default values for these composables in an app-wide way (#23725):
🔢 Layer improvements
We now more carefully load layer plugins (#22889 and #23148) and middleware (#22925 and #23552) in the order of the layers, always loading your own plugins and middleware last. This should mean you can rely on utilities that layers may inject.
We've also added a test suite to cover these layer resolution changes.
And probably one of the most significant changes - if you are using remote layers we now clone these within your
node_modules/
folder (#109) so layers can use dependencies with your project. Seec12
release notes for full details.😴 Nightly release channel
Every commit to the
main
branch of Nuxt is automatically deployed to a new release, for easier testing before releases. We've renamed this from the 'edge release channel' to the 'nightly release channel' to avoid confusion with edge deployments. And probably also with Microsoft Edge (though I haven't heard that anyone was confused with that one!)➡️
nuxt3
is nownuxt-nightly
➡️
nuxi-edge
is nownuxi-nightly
➡️
@nuxt/kit-edge
is now@nuxt/kit-nightly
... and so on.
You can read more about how it works.
⚗️ Nitro v2.7
Nitro v2.7 has been released with lots of improvements and bug fixes - do check out the full changelog.
🔥 One of the most significant is that we now save ~40% of bundle size in production by using native
fetch
(which is supported in Node 18+) (#1724). So if possible, we'd recommend you update your Node version to at least 18.💪 Type import changes
🚨 This is likely to need code changes in your project 🚨
Vue requires that type imports be explicit (so that the Vue compiler can correctly optimise and resolve type imports for props and so on). See core Vue
tsconfig.json
.We've therefore taken the decision to turn on
verbatimModuleSyntax
by default in Nuxt projects, which will throw a type error if types are imported without an explicittype
import. To resolve it you will need to update your imports:You may also encounter modules in the Nuxt ecosystem that need to be updated; please open an issue for those modules. I'm also very happy to help if you're encountering any problems with this, if you're a module author. Just tag me and I'll take a look.
If for whatever reason you need to undo this change in your project you can set the following configuration:
However, we'd recommend only doing that temporarily, as Vue does need this option to be set for best results.
✅ Upgrading
As usual, our recommendation for upgrading is to run:
👉 Changelog
compare changes
🚀 Enhancements
addServerImports
andaddServerImportsDir
(#23288)prerenderRoutes
ssr composable (#22863)appManifest
by default (#23448)withAsyncContext
(#23526)-nightly
extension (#23508)@nuxt/devtools
as dependency and enable (#23576)deep: false
for data composables (#23600)@nuxt/image
when it is used (#23717)<NuxtLink>
options (#23724)🔥 Performance
🩹 Fixes
asyncData
errors withnull
(#23428)vue-router
(#23440)config.autoImport
inaddServerImports
(#23472)clearNuxtState
called w/o keys (#23483)addPrerenderRoutes
name (#23509)test
/dev
as manifest buildId when appropriate (#23512)<DevOnly>
(#23466)useFetch
(#23693)lodash-es
+ simplify postcss resolution (#23692)useAsyncData
(#23351)prerenderedAt
to override app manifest (#23781)prerenderedAt
behaviour pending next patch (108b1bdf7)📖 Documentation
listhen
options on nuxi dev page (#23415)handler
foruseAsyncData
(#23389)nitro
to useruntimeConfig
(#23454)bridge.typescript
option must be set. (#23503)nuxt kit
section (#22375)/edge-channel
page to/nightly-release-channel
(#23648)routeRules
example (818dc626c)<NuxtImg>
and<NuxtPicture>
(#23741)🏡 Chore
✅ Tests
🤖 CI
❤️ Contributors
v3.7.4
Compare Source
✅ Upgrading
As usual, our recommendation for upgrading is to run:
👉 Changelog
compare changes
🩹 Fixes
nuxt/*
exports (#23357)💅 Refactors
consola
and improve test dx (#23302)📖 Documentation
nuxt2
command (#23211)code-block
in migration guide (#23224)callHook
method (#23231)srcDir
JSDoc (#23250)nuxtApp.runWithContext
(#23258)devtools.nuxt.com
(#23350)await
to clarifysendRedirect
is async (#23345)tryUseNuxt
to kit context utils list (#23373)🏡 Chore
.devcontainer
(#22810)🤖 CI
linkChecker
job tolink-checker
(#23319)❤️ Contributors
v3.7.3
Compare Source
👉 Changelog
compare changes
🩹 Fixes
#components
(#23188)💅 Refactors
📖 Documentation
❤️ Contributors
v3.7.2
Compare Source
✅ Upgrading
As usual, our recommendation for upgrading is to run:
👉 Changelog
compare changes
🩹 Fixes
joinURL
with remote sources on NuxtIsland (#23093)data-v
attrs from server component props (#23095)useFetch
auto key (#23086)cssCodeSplit
(#23049)spaLoadingTemplate
if file exists (#23048)tsconfig.json
defaults (#23121)0
(#23127)📖 Documentation
name
param toPageMeta
interface description (#23107)experimental.componentIslands
(#23138)nuxi init
command (#23155)🏡 Chore
🤖 CI
❤️ Contributors
v3.7.1
Compare 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
🔥 Performance
🩹 Fixes
ssr: false
(#22869)priority
when registering components dirs (#22882)addLayout
(#22902)true
(#22905)write: false
for type templates (#22972)shouldExternalize
(#22991)destr
in more places overJSON.parse
(#22997)📖 Documentation
<NuxtPage>
(#22912)pageKey
(#22920)env
object for nuxt plugins (#22963)NuxtLayout
(#22989)🏡 Chore
nuxi-edge
rather thannuxi-ng
(9610cf03d)🤖 CI
GITHUB_REF_NAME
to get branch for release (d49ea58de)❤️ Contributors
v3.7.0
Compare Source
👀 Highlights
🐣 A New CLI
We've refactored
nuxi
using unjs/citty and this marks the first Nuxt release that depends on the new version, safely in its own repository. We have grand plans for this - check out some of the features + roadmap discussions in nuxt/cli and please feel free to contribute!Nuxi is now decoupled from the main
nuxt
version - we plan to iterate and release nuxi more quickly in future so you can expect new things coming soon!🕸️ Native Web Streams and
Response
With improvements in unjs/h3 and unjs/nitro, it's now possible to directly return a
Response
object from server routes, meaning it's also possible to return and handle streams natively in Nuxt.👉 Check out the full detail in the unjs/h3 and unjs/nitro release notes.
🔥 HTML Rendering Optimisations
This release comes with a couple of improvements in rendering HTML responses from the server. We now determine whether to preload/prefetch resources at build time (so you can customise this in the
build:manifest
hook). We also now manage rendering the HTML for them directly inunhead
(#22179), which means you can configure the order for<link>
,<meta>
,<script>
,<style>
, and more. And - in our preliminary testing - it's even faster!It's possible to opt-in to upcoming head improvements with the
experimental.headNext
flag. This currently includes a new ordering algorithm based on capo.js (#22431) and allows enabling future optimisations as they are released inunhead
:We'd love your thoughts - you can respond with any issues/feedback in this discussion.
🛠️ Build Environment Shortcuts
In your Nuxt config you can now use
$client
and$server
shortcuts to easily define configuration that is specific to just the Vite client/server (#22302) or webpack client/server (#22304) builds. This previously was only possible with thevite:extendConfig
andwebpack:config
hooks.For example:
⚡️ Vite 4.4
We've chosen to unpin Vite from minor versions, meaning whenever Vite releases a new feature version you can opt-in straight away. Vite 4.4 brings a lot of exciting things, including experimental Lightning CSS support - and much more!
👉 Check out the Vite release notes for more.
💪 TypeScript Updates
We now use purely relative paths in the generated
tsconfig.json
instead of setting abaseUrl
. This means better support for dev environments like docker images where the absolute path may not match your IDE (#22410).We also set a couple of additional compiler flag defaults to match Vite/TS recommendations (#22468).
Plus, you should now get type hinted access to layouts in
setPageLayout
and also in<NuxtLayout name>
(#22363).🦄 Async Context support
If you've ever got an issue with 'Nuxt context unavailable' this might be one for you. We now support native async context for Bun and Node under an experimental flag, in both Nuxt and Nitro (#20918).
This enables using Nuxt composables on the server without needing to ensure they are being called directly in a setup function. It also allows the same in Nitro, with a new
useEvent()
utility that is usable in server routes.To try it out, you can enable
experimental.asyncContext
:👓 Watcher Updates
We've fixed a couple of issues with watchers, meaning that you should need to restart your server less often - and you should see a significant performance increase if you are using layers.
⚗️ Nitro 2.6
There lots more exciting features coming directly from Nitro 2.6, including smaller, lighter servers and new persistent data storage in a
.data
directory.👉 Read more in the full release article.
✅ 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
$client
and$server
vite env overrides (#22302)$client
and$server
overrides (#22304)scrollToTop
page meta (#21741)app:templatesGenerated
hook (#21935)unhead
(#22179)@nuxt/webpack-builder
when needed (#21747)writeTypes
utility (#22385)setPageLayout
/<NuxtLayout>
(#22362)import.meta.*
build flags (#22428)node_modules
(#22478)webpack
/nitro
/postcss
config (#22521)global: 'sync'
components (#22558)app.rootId
optional (#22528)experimental.headNext
unhead integration (#22620)bun
package manager (#22673)routeRules
defined within pages (#20391)hidden
sourcemaps (#22787)nuxt/cli
(#22799)./schema/config.schema.json
subpath (#22813)🔥 Performance
nuxt/config
(#22391)capo.js
head tag order (#22431).toLowerCase()
(#22743)🩹 Fixes
prerender:routes
hook (#22247)scrollBehaviorType
(#22264)asyncData
generic + default (#22258)createClientOnly
render function to ctx (#22289)build.extend
(#22305)validate
return typing to be either error or boolean (#22323)hasNuxtModule
(#22316)builder:watch
(#22333)useFetch
hash (#22378)watch
paths against all layersrcDir
s (#22307)name
is an optional prop for<NuxtLayout>
(0d9a0b753)useFetch
(#22418)baseUrl
and use relative paths in tsconfig (#22410)injectHead
usage (#22447)useCookie
(#22474)internal:nuxt
namespace (9b0d371b0)normalize
call (14bf2b02f)webpack
options should be optional (#22524)app.config.ts
files (#22494)hookable
to externals list (4552d39c4)app.{rootId ([rootTag}
(#22543)](nuxt/nuxt@rootTag}\` (#22543)))import.meta
build vars indefine
as well (#22576)page:finish
(#22566)distDir
after first build (#22614)''
key for root scope in variable collector (#22679)exclude
paths to nitrotsconfig.server.json
(#22768)asyncData
whenimmediate
is disabled (#20980)spaLoadingTemplate
tofalse
(#22798)unctx
where possible (#22811)💅 Refactors
nuxi-ng
for edge releases (#22413)useNitroApp
from subpath (#22785)📖 Documentation
#components
import for dynamic component (#22231).env
section (#22369)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - "before 4am on Monday" (UTC).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.