v3.5.0 #20879
danielroe
announced in
Announcements
v3.5.0
#20879
Replies: 4 comments 1 reply
-
Regarding the experimental 'fully typed pages': Is there any benefit switching to this over the Typed Router module? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I hope we get a fix for unjs/h3#385 soon, currently images are broken over proxy |
Beta Was this translation helpful? Give feedback.
0 replies
-
Awesome work! |
Beta Was this translation helpful? Give feedback.
0 replies
-
env is not working after this update.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👀 Highlights
⚡️ Vue 3.3 released!
Vue 3.3 has been released, with lots of exciting features, particularly around type support. This also brings a significant improvement to data fetching when navigating between nested pages (#20777), thanks to @antfu and @baiwusanyu-c.
defineOptions
macroRead the full release announcement for more details.
🙌 Nitropack v2.4
We've been working on lots of improvements to Nitro and these have landed already in Nitro v2.4 - you may already have this upgrade, which contains a lot of bug fixes, updates to the module worker format for Cloudflare, Vercel KV support and more.
One note: if you're deploying to Vercel or Netlify and want to benefit from incremental static regeneration, you should now update your route rules:
Read the full release notes.
💖 New defaults
Rich JSON payload serialisation is now enabled by default (#19205, #20770). This is both faster and allows serialising complex objects in the payload passed from the Nuxt server to client (and also when extracting payload data for prerendered sites).
This now means that various rich JS types are supported out-of-the-box: regular expressions, dates, Map and Set and BigInt as well as NuxtError - and Vue-specific objects like
ref
,reactive
,shallowRef
andshallowReactive
.You can find an example in our test suite.
This is all possible due to Rich-Harris/devalue#58. For a long time, Nuxt has been using our own fork of devalue owing to issues serialising Errors and other non-POJO objects, but we now have transitioned back to the original.
You can even register your own custom types with a new object-syntax Nuxt plugin:
You can read more about how this works here.
🛝 Interactive server components
This feature should be considered highly experimental, but thanks to some great work from @huang-julien we now support interactive content within server components via slots (#20284).
You can follow the server component roadmap at #19772.
⏰ Environment config
You can now configure fully typed, per-environment overrides in your
nuxt.config
:If you're authoring layers, you can also use the
$meta
key to provide metadata that you or the consumers of your layer might use.Read more: #20329.
💪 Fully typed pages
You can benefit from fully typed routing within your Nuxt app via this experimental integration with https://github.com/posva/unplugin-vue-router - thanks to some great work from @posva! Out of the box, this will enable typed usage of
navigateTo
,<NuxtLink>
,router.push()
and more. You can even get typed params within a page by usingconst route = useRoute('route-name')
.🔎 'Bundler' module resolution
We now have full support within Nuxt for the
bundler
strategy of module resolution. We would recommend adopting this if possible. It has type support for subpath exports, for example, but more exactly matches the behaviour of build tools like Vite and Nuxt thanNode16
resolution.This turns on TypeScript's ability to 'follow' Node subpath exports. For example, if a library has a subpath export like
mylib/path
that is mapped tomylib/dist/path.mjs
then the types for this can be pulled in frommylib/dist/path.d.ts
rather than requiring the library author to createmylib/path.d.ts
.⚗️ Separate server types
We plan to improve clarity within your IDE between the 'nitro' and 'vue' part of your app, and we've shipped the first part of this via a separate generated
tsconfig.json
for your~/server
directory (#20559). You can use by adding an additional~/server/tsconfig.json
with the following content:Although right now these values won't be respected when type checking, you should get better type hints in your IDE.
💀 Deprecations
Although we have not typed or documented the
build.extend
hook from Nuxt 2, we have been calling it within the webpack builder. We are now explicitly deprecating this and will remove it in a future minor version.✅ 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
prepend
option toaddImportsDir
(#20307)vite:configResolved
hook (#20411)webpack:configResolved
hook (#20412)addVitePlugin
andaddWebpackPlugin
(#20525)nuxi analyze
from cli (#20387)nuxtApp.runWithContext
(#20608)typedPages
option (#20367)runWithContext
withincallWithNuxt
(#20775)useRequestURL
helper (#20765)<DevOnly>
(#20817)addBuildPlugin
for builder-agnostic implementation (#20587)NuxtClientFallback
(#20336)🩹 Fixes
@nuxt/devtools
module before core modules (#20595)<FragmentWrapper>
(#20607)useError
is called with nuxt app context (#20585)nuxt_component
ssr style andisVue
(#20679)build.extend
hook (#20605)fs.allow
dirs to include app files (#20755).env
changes (#20501)<DevOnly>
from parsed html (#20840)pages:extend
to enable pages module (#20806)scrollBehavior
(#20859)💅 Refactors
runtimeCompiler
option out of experimental (#20606)resolvePath
(#20756)📖 Documentation
useCookie
does not share state (#20665)navigateTo
examples (#20678)useSeoMeta
anduseServerSeoMeta
pages (#20656)<NuxtLayout>
when migratingerror.vue
(#20690)await
before lazy composable examples (7e7e006e9)pinia
(#20778)🏡 Chore
markdownlint-cli
update and prevent auto-update (675445f98)@ts-ignore
(4f0d3d4ae).only
in tests (ad97cb45a).mjs
files (#20711)pnpm-workspace.yaml
(#20751)externalVue
removal (a33d2e7ae)✅ Tests
🤖 CI
❤️ Contributors
This discussion was created from the release v3.5.0.
Beta Was this translation helpful? Give feedback.
All reactions