Vue Ecosystem Updates: Vue Router v5.6.1 Fixes SSR Guards and Vue i18n v11.4.25 Speeds Up LocalizationThematic roundup · digest for December 3
Watercolor and fine-ink study: a clean routing compass and a light stack of localization cards in the calm green-and-graphite palette of the Vue ecosystem.
Thematic roundup2 sections≈ 4 min

Vue Ecosystem Updates: Vue Router v5.6.1 Fixes SSR Guards and Vue i18n v11.4.25 Speeds Up Localization

On the server, a user physically cannot click "Back," yet your SSR process was still attaching leave guards on every request and piling them up in memory. A similar quirk lived in translations: a "Save" button label never changes, yet the library built a full formatting context on every render as if handling plurals. Two December 2, 2026 patches (Vue Router v5.6.1 and Vue i18n v11.4.25) eliminate both wastes with zero app code changes.

Vue Router v5.6.1: skipping in-component guards on SSR, trailingSlash, and unplugin helpers

The headline production fix in Vue Router v5.6.1 lands in PR #2861 for in-component navigation guards (onBeforeRouteLeave and onBeforeRouteUpdate, see navigation guard docs).

During SSR, frameworks often create one matcher via createRouterMatcher and reuse it across requests. When a page used onBeforeRouteLeave or onBeforeRouteUpdate, registerGuard attached a closure to the RouteRecordNormalized entry's leaveGuards or updateGuards array. Because SSR has no onUnmounted phase, the request finished while the closure stayed in memory forever—creating a quiet memory leak under load.

registerGuard now returns early with if (inject(ssrContextKey, null)) return. Checking Vue 3's ssrContextKey instead of !isBrowser keeps unit tests in Node and jsdom working.

The second update touches vue-router/experimental (PR #2989). MatcherPatternPathStatic matches static routes directly without regexes. Previously, trailingSlash: 'ignore' pushed every static route except / onto the dynamic regex matcher. The constructor now takes a third trailingSlash: false | null = false parameter:

import { MatcherPatternPathStatic } from 'vue-router/experimental'

// Default (trailingSlash = false): exact match
const strict = new MatcherPatternPathStatic('/team')
strict.match('/team')   // {}
strict.match('/team/')  // null

// trailingSlash = null: matches both without falling back to regex
const flexible = new MatcherPatternPathStatic('/team', false, null)
flexible.match('/team')  // {}
flexible.match('/team/') // {}
flexible.build()         // '/team'

// Required trailing slash goes directly in the path
const slashed = new MatcherPatternPathStatic('/team/')
slashed.match('/team/') // {}

trailingSlash: true was dropped during the PR to keep match() and build() simple, and the resolver codegen trims trailing false values and extra flags for /. The SSR guard fix is in the stable API, while MatcherPatternPathStatic remains experimental.

For frameworks like Nuxt, PR #2982 exports compileStringPathMatcher, compileFilePathMatcher, and comparePathScore from vue-router/unplugin (the changelog mentions compilePathMatcher, which was split in two) to generate resolvers from pages like definePage({ path: '/café' }). unplugin parsing also got two fixes: PR #2981 unescapes static segments like /foo\:bar to /foo:bar, and PR #2983 decodes percent-encoded names in getPascalCaseRouteName (café.vue → Café).

Vue i18n v11.4.25: compiled message caching and a fast path for static strings

Vue i18n v11.4.25 backports two @intlify/core-base optimizations that speed up translation rendering automatically.

PR #2860 speeds up the compile cache. Previously, every compileCache lookup called onCacheKey(message) to rebuild a string key. Now a Map-based sourceCompileCache looks up compiled functions directly by source string (clearCompileCache() clears both, and strings with detectError aren't cached).

PR #2897 skips overhead on static strings. Normally t() allocates a MessageContext for interpolation, plurals, and linked messages. Now markStaticMessage inspects the AST: if it isn't a plural (NodeTypes.Plural) and has no {count} or @:other links, it attaches [StaticMessageSymbol] = text. The authors used Symbol('__staticMessage') rather than a string key to prevent prototype pollution via Object.prototype (inspired by CVE-2024-52809):

import { createI18n } from 'vue-i18n'

const i18n = createI18n({
  legacy: false,
  locale: 'ru',
  messages: {
    ru: {
      // Static strings: get StaticMessageSymbol and skip MessageContext
      nav: { save: 'Сохранить', cancel: 'Отмена' },
      // Strings with placeholders take the full path
      cart: { items: 'Товаров в корзине: {count}' },
    },
  },
})

// Fast path without MessageContext allocation
i18n.global.t('nav.save') // 'Сохранить'
// Standard path with parameter interpolation
i18n.global.t('cart.items', { count: 3 }) // 'Товаров в корзине: 3'

When translate() sees StaticMessageSymbol, it skips createMessageContext and returns the string straight away, while postTranslation hooks and devtools events still fire. Custom context.processor functions, placeholders, pluralization (|), and @:key links take the normal path. Both runtime messages and precompiled ASTs from @intlify/unplugin-vue-i18n (optimization docs) get the speedup just by upgrading.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 11