Conversation
🦋 Changeset detectedLatest commit: ec8034b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from No bundle size changes detected. |
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
chanceaclark
left a comment
There was a problem hiding this comment.
Mind just adding a TODO in code for use to move this back using rootParams when we have it available?
|
@jorgemoya, minor nit but the Jira link in the PR description actually points to a Linear issue. |
e2050fc to
b258aed
Compare
b258aed to
0966b72
Compare
The root <html> tag was hardcoded to lang="en" for all locales because
a new root app/layout.tsx to enable the branded /404 page. That fix
solved the 404 but regressed the lang attribute.
Adopt next-intl's documented pattern:
- app/layout.tsx is now a passthrough (returns children) — required by
Next.js but owns no markup.
- app/[locale]/layout.tsx owns <html lang={locale}> and <body> again,
so localized pages get the correct language.
- app/not-found.tsx owns its own <html>/<body>, fonts, and global CSS
so the branded 404 still renders for non-localized requests.
Verified parity with canary on runtime 404 behavior (both serve the
Next.js error-fallback shell for dynamic 404s) and clean output in the
prerendered _not-found.html static file.
Fixes LTRAC-578
Co-Authored-By: Claude <noreply@anthropic.com>
LTRAC-578: chore - Bump changeset to minor
Restructures <html>/<body> ownership across root layout, [locale]
layout, and not-found — customers who customized these files will need
to migrate, so a minor bump is more appropriate than patch.
Refs LTRAC-578
Co-Authored-By: Claude <noreply@anthropic.com>
LTRAC-578: docs - Add TODO for rootParams migration
Note that the passthrough root layout is a workaround — once
Next.js `rootParams` (16.2+) is available on Native Hosting, we
should move <html>/<body> back here and derive `lang` from rootParams.
Refs LTRAC-578
Co-Authored-By: Claude <noreply@anthropic.com>
0966b72 to
ec8034b
Compare
Linear: LTRAC-578
What/Why?
PR #2947 introduced a root
app/layout.tsxthat owns<html>/<body>so/404renders a branded page instead of the default Vercel error screen. Because that root layout sits above[locale], thelangattribute was hardcoded tolang="en"for every locale — regressing accessibility and SEO for non-English storefronts.Full
rootParams(Next.js 16.2) would be the clean fix but isn't usable on Native Hosting yet. This PR adopts next-intl's documented workaround instead:app/layout.tsx→ passthrough (return children). Next.js still requires the file to exist, but it owns no markup.app/[locale]/layout.tsx→ owns<html lang={locale}>+<body>+ fonts +globals.cssagain, so each locale gets its correct language attribute.app/not-found.tsx→ self-sufficient, renders its own<html lang="en">/<body>+ fonts +globals.css. Keeps the branded 404 from fix(core): adds root-level not found page #2947 working for non-localized requests.Why a passthrough and not deleting the root layout: deleting it forces Next.js 16 to synthesize a fallback shell, which produces nested
<html>/<body>tags in the prerendered_not-found.html. A passthrough tells Next.js "trust the children" and avoids the synthesized shell.Testing
pnpm buildsucceeds. Prerendered.next/server/app/_not-found.htmlcontains a single<html lang="en" class="...fonts...">and a single<body class="flex min-h-screen flex-col">wrapping the branded "Not found" content.pnpm start:GET /→ 200,<html lang="en" class="...fonts...">/[locale]/...route will render withlang={locale}(ticket fix)GET /admin/nonexistent/→ 404, renders branded not-found. Runtime serves Next.js's<html id="__next_error__">streaming shell; verified this is identical on canary — baseline Next.js 16 behavior for dynamic 404s, not a regression from this PR. On Vercel edge, the prerendered static file is served directly.Migration
app/layout.tsx(e.g., added<head>elements, body classes, providers) need to move those customizations up toapp/[locale]/layout.tsx(for locale-aware pages) and/orapp/not-found.tsx(for the non-localized fallback).<html lang>via a cookie or similar workaround, it can be deleted — the locale layout handles this now.Fixes LTRAC-578