Skip to content

v3.2.0

Compare
Choose a tag to compare
@danielroe danielroe released this 09 Feb 11:06
· 2502 commits to main since this release
5855c1e

3.2.0 is the first minor release since we've started our new release schedule. We've brought it forward by a couple of weeks to include some goodies we want you to be able to play with soon.

πŸ‘€ Highlights

  • ⚑️ Nuxt DevTools

    You can opt-in to Nuxt DevTools per-project by going to the project root and running:

    npx nuxi@latest devtools enable

    Restart your Nuxt server and open your app in browser. Click the Nuxt icon on the bottom (or press Alt+D) to toggle the DevTools.

    More information in the docs!

  • ✨ Better DX for overriding runtimeConfig, including inline type helpers

  • πŸͺ„ Automatically inferred return type for useFetch and $fetch based on method.

    It'll be a type error to use the wrong method when hitting an endpoint.

    Plus, if you have multiple methods served by a single endpoint (like ~/server/api/test.get.ts and ~/server/api/test.post.ts then the response type will match the kind of response you make.

  • πŸͺ useFetch is now integrated with event.$fetch, meaning cookies and context are now passed to api requests automagically within internal requests.

  • πŸ”₯ We now treeshake client-only components out of the server build more effectively using the experimental treeshakeClientOnly feature

    This is turned on by default but if you experience any issues, you can turn this off via:

    export default defineNuxtConfig({
      experimental: {
        treeshakeClientOnly: false
      }
    })
  • πŸ› οΈ New addRouteMiddleware kit utility for module authors

  • πŸ’ͺ Nitropack v2.2 has been released

    Lots of features, including runtime proxy support using route rules, nested fetch calls, binary and raw storage operations, exposed event.context.cf (cloudflare) and built-in session support.

    For full details see release notes

Changelog

compare changes

πŸš€ Enhancements

  • kit: Add addRouteMiddleware method (#18553)
  • cli: Warn when prerendering routes with ssr: false (#18783)
  • schema: Add type hints for runtime config (#18652)
  • nuxt: Support type auto-import (#18859)
  • nuxt: Infer useFetch return based on the method (#18526)
  • cli: Add initial support for enabling/disabling devtools (#18864)
  • nuxt: Upgrade to nitropack 2.2 (#18889)

πŸ”₯ Performance

  • vite: Use stub entry in vite server build when ssr: false (#18782)

🩹 Fixes

  • nuxt: Treeshake client-only components with placeholders (#8789)
  • webpack: Client-side typechecking when ssr: false (#18828)
  • vite: Exclude styles, not all assets (#18752)
  • nuxt: Defer adding route path to preloaded record (#18862)
  • nuxt: Don't exclude pnpm layers from nitro esbuild/imports (#9952)
  • nuxt: Use parser to treeshake <ClientOnly> (#8713)
  • Reorder the types field in package.json (#18880)

πŸ’… Refactors

  • nuxt: Within nuxt app, import directly from source file (#18902)

πŸ“– Documentation

  • Remove extra word (#18750)
  • example: Fix app config link (#18760)
  • Add useError composable (#8912)
  • Clarify augmenting input/output app config (#8953)
  • Add explanation of composable lifecycle (#8116)
  • typescript: Type-checking guide (#18768)
  • schema: Add NuxtHooks interface documentation (#18756)
  • Resolve preloadRouteComponents page heading error (#18804)
  • Update to nuxt 2.16.0 in bridge installation (#18836)
  • Add link to vue hydration mismatch docs (#18842)
  • Update auto-imports for the server part (#18848)
  • Warn about slots in server components (#18854)
  • Add explanation with augmented meta for new routes (#18901)

βœ… Tests

  • Decrease vite logging during tests (5426e5609)

❀️ Contributors