Other: Send only the route's i18n namespaces to the client
i18n/request.ts loads all 22 namespaces (568 KB of JSON in es) and app/[locale]/layout.tsx:75,95 passes them whole to NextIntlClientProvider. Every HTML document weighs 160-200 KB gzip, and about 158 KB gzip of that is messages, on public pages too (/@handle, booking, help center). Measured in docs/benchmark/performance.md (4x CPU, 4G). First scope: the root layout picks only 'common', each app layout adds a nested provider with its own namespace, and public pages add theirs. Server components keep reading everything through getTranslations. Expected: -130 to 150 KB gzip per document, and less on every router.refresh. Priority: high. Effort: M.
Comments 0
No comments yet.
Sign in to comment