[Snyk] Upgrade nuxt from 3.12.4 to 3.17.5 #934
+1
−1
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.
Snyk has created this PR to upgrade nuxt from 3.12.4 to 3.17.5.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 20 versions ahead of your current version.
The recommended version was released a month ago.
Issues fixed by the recommended upgrade:
SNYK-JS-NUXT-9486043
SNYK-JS-VITE-9653016
SNYK-JS-UNDICI-8641354
SNYK-JS-BRACES-6838727
SNYK-JS-CROSSSPAWN-8303230
SNYK-JS-ES5EXT-6095076
SNYK-JS-MICROMATCH-6838728
SNYK-JS-VITE-8648411
SNYK-JS-VITE-9512410
SNYK-JS-BABELHELPERS-9397697
SNYK-JS-NUXTVITEBUILDER-8663232
SNYK-JS-PARSEGITCONFIG-9403763
SNYK-JS-VITE-9576207
SNYK-JS-VITE-9685035
SNYK-JS-VITE-9919777
SNYK-JS-ROLLUP-8073097
SNYK-JS-VITE-8023174
SNYK-JS-INFLIGHT-6095116
SNYK-JS-NANOID-8492085
SNYK-JS-NANOID-8492085
SNYK-JS-BRACEEXPANSION-9789073
SNYK-JS-BRACEEXPANSION-9789073
SNYK-JS-SEND-7926862
SNYK-JS-SERVESTATIC-7926865
SNYK-JS-UNDICI-10176064
SNYK-JS-VITE-8022916
Release notes
Package name: nuxt
✅ 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
🔥 Performance
globby
(#31688)🩹 Fixes
useScriptRybbitAnalytics
from script stubs (d275ae1a0)appConfig
sources are not duplicated (#32216)h()
in ClientOnly (#30664)asyncData
state from nuxt app instance (#32232)srcDir
inbuildCache
(#32260)asyncData
watcher (#32247)📖 Documentation
addRouteMiddleware
path in example (#32171)--env-file
(29f6392cd)nuxt
command consistently (#32237)alert
withwarning
in/guide/pages
(#32270)📦 Build
🏡 Chore
✅ Tests
❤️ Contributors
✅ 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
🔥 Performance
shallowRef
for primitive values (#32152)Intl.Collator
instead oflocaleCompare
(#32167)🩹 Fixes
<ClientOnly>
(#32101)useLazyAsyncData
(#32092)ts-checker-rspack-plugin
(#32115)/
(#32129)DeepPartial
(#31990)<ClientOnly>
(#32131)global
withglobalThis
(#32130)<NuxtLayout>
first renders (#24673)srcDir
to parcel strategy (#32139)📖 Documentation
useNuxtData
default return toundefined
(#32054)imports.dirs
with alias (0dbf314d9)🏡 Chore
✅ Tests
setTimeout
mock (#32142)🤖 CI
❤️ Contributors
✅ 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
🔥 Performance
🩹 Fixes
FormData
(#32013)ignore
patterns (#32020)useFetch
withwatch: false
(#32019)getCachedData
is provided (#32003)nuxtApp
for asyncData functions run on server (#32038)💅 Refactors
asyncData
(e779d6cd5)📖 Documentation
🤖 CI
bug
/enhancement
labels to issue types (3ff743fe0)❤️ Contributors
✅ 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
🔥 Performance
handleHotUpdate
in production (#31971)🩹 Fixes
transition
(#31945)useFetch
(#31963)scrollToTop
(#31914)vfs
even if a file exists inbuildDir
(#31969)useAsyncData
reactive tokey
changes whenimmediate: false
(#31987)WarningFilter
type (2a79dbd68)warningIgnoreFilters
(a62e808ac)📖 Documentation
@ nuxt/kit
documentation (#31793)🏡 Chore
✅ Tests
asyncDataDefaults.value
(91568c5da)🤖 CI
❤️ Contributors
✅ 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
execute
when non-immediate fetch key changes (#31941)escapeHTML
from vue (8e4b8d62f)@ vue/shared
dependency (7d445c963)📦 Build
🏡 Chore
✅ Tests
❤️ Contributors
👀 Highlights
This release brings a major reworking of the async data layer, a new built-in component, better warnings, and performance improvements!
📊 Data Fetching Improvements
A major reorganization of Nuxt's data fetching layer brings significant improvements to
useAsyncData
anduseFetch
.Although we have aimed to maintain backward compatibility and put breaking changes behind the
experimental.granularCachedData
flag (disabled by default), we recommend testing your application thoroughly after upgrading. You can also disableexperimental.purgeCachedData
to revert to the previous behavior if you are relying on cached data being available indefinitely after components usinguseAsyncData
are unmounted.👉 Read the the original PR for full details (#31373), but here are a few highlights.
Consistent Data Across Components
All calls to
useAsyncData
oruseFetch
with the same key now share the underlying refs, ensuring consistency across your application:<script setup>
const { data: users, pending } = useAsyncData('users', fetchUsers)
</script>
<!-- ComponentB.vue -->
<script setup>
// This will reference the same data state as ComponentA
const { data: users, status } = useAsyncData('users', fetchUsers)
// When either component refreshes the data, both will update consistently
</script>
This solves various issues where components could have inconsistent data states.
Reactive Keys
You can now use computed refs, plain refs, or getter functions as keys:
const { data: user } = useAsyncData(
computed(() =>
user-<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">userId</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">}</span></span>
),() => fetchUser(userId.value)
)
// Changing the userId will automatically trigger a new data fetch
// and clean up the old data if no other components are using it
userId.value = '456'
Optimized Data Refetching
Multiple components watching the same data source will now trigger only a single data fetch when dependencies change:
const { data } = useAsyncData(
'users',
() => $fetch(
/api/users?page=<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-c1">query</span><span class="pl-kos">.</span><span class="pl-c1">page</span><span class="pl-kos">}</span></span>
),{ watch: [() => route.query.page] }
)
// When route.query.page changes, only one fetch operation will occur
// All components using this key will update simultaneously
🎭 Built-In Nuxt Components
<NuxtTime>
- A new component for safe time displayWe've added a new
<NuxtTime>
component for SSR-safe time display, which resolves hydration mismatches when working with dates (#31876):The component accepts multiple time formats and gracefully handles both client and server rendering.
Enhanced
<NuxtErrorBoundary>
The
<NuxtErrorBoundary>
component has been converted to a Single File Component and now exposeserror
andclearError
from the component - as well as in the error slot types, giving you greater ability to handle errors in your templates and viauseTemplateRef
(#31847):<template #error="{ error, clearError }">
<div>
<p>{{ error.message }}</p>
<button @ click="clearError">Try again</button>
</div>
</template>
<!-- Content that might error -->
<MyComponent />
</NuxtErrorBoundary>
🔗 Router Improvements
<NuxtLink>
now accepts atrailingSlash
prop, giving you more control over URL formatting (#31820):🔄 Loading Indicator Customization
You can now customize the loading indicator with new props directly on the component (#31532):
hideDelay
: Controls how long to wait before hiding the loading barresetDelay
: Controls how long to wait before resetting loading indicator state📚 Documentation as a Package
The Nuxt documentation is now available as an npm package! You can install
@ nuxt/docs
to access the raw markdown and YAML content used to build the documentation website (#31353).💻 Developer Experience Improvements
We've added several warnings to help catch common mistakes:
runtimeConfig.app
namespace #31774definePageMeta
is used more than once in a file #31634🔌 Enhanced Module Development
Module authors will be happy to know:
experimental.enforceModuleCompatibility
allows Nuxt to throw an error when a module is loaded that isn't compatible with it (#31657). It will be enabled by default in Nuxt v4.addComponentExports
#27155🔥 Performance Improvements
Several performance improvements have been made:
tinyglobby
for faster file globbing #31668.data
directory from type-checking for faster builds #31738purgeCachedData
check #31785✅ Upgrading
Our recommendation for upgrading is to run:
This refreshes your lockfile and pulls in all the latest dependencies that Nuxt relies on, especially from the unjs ecosystem.
👉 Changelog
compare changes
🚀 Enhancements
hideDelay
andresetDelay
props for loading indicator (#31532)@ nuxt/docs
(#31353)loadNuxtConfig
to nitro (#31680)runtimeConfig.app
namespace (#31774)middleware
when scanning page metadata (#30708)Build: