tezvyn:

Nuxt 4.4 Adds Custom Fetch Factories and Router v5

AI-drafted, machine-checkedSource: Nuxt Blogintermediate
Nuxt 4.4 Adds Custom Fetch Factories and Router v5

Nuxt 4.4 ships createUseFetch factories, Vue Router v5, and 28x faster dev route updates. Custom fetch instances with typed defaults cut API boilerplate, while the router upgrade drops unplugin-vue-router and clears the path for stable typed routes.

WHY IT MATTERS: Nuxt 4.4 targets the three places Vue teams lose time: API boilerplate, dev server lag, and accessibility gaps. The new createUseFetch factory lets you bake baseURL, interceptors, and server flags into reusable composables that stay fully typed and SSR-compatible. That means less copy-paste in every page and fewer runtime misconfigurations when calling internal APIs. For teams running large codebases, the migration to unrouting cuts dev-server route recalculation by up to 28x when you edit existing pages, and makes route generation deterministic regardless of file ordering. If you ship ISR or SWR in serverless environments, the new payloadExtraction client mode stops the double-lambda cold-start problem where a cached route triggers an immediate second render.

WHAT CHANGED: Four concrete changes land in this release. First, createUseFetch and createUseAsyncData accept either a defaults object or a merge function, giving you full control over how per-call options combine with global config. Second, Vue Router v5 replaces the previous major version and removes the unplugin-vue-router dependency entirely; for most apps this is transparent, and it sets up typed routes to leave experimental status next. Third, definePageMeta now accepts a layout object with typed props, so layouts can receive per-page parameters like sidebar visibility or titles without provide/inject workarounds. Fourth, the new useAnnouncer composable and NuxtAnnouncer component expose polite and assertive ARIA live regions for dynamic content changes such as search results or form errors, supplementing the existing route announcer.

WHAT TO WATCH: Check whether you import unplugin-vue-router directly and remove it if so. Test createUseFetch against your current API composables to see if you can collapse multiple wrappers into one factory. If you use ISR or SWR with payload extraction, evaluate the new client mode to reduce serverless concurrency costs. The typed routes feature is still experimental but likely to stabilize soon given the router v5 foundation.

Source: Nuxt Blog

Read the original → Nuxt Blog

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.