Skip to content

perf(www): the landing gets its own root layout and scroll-mounted islands - #44

Merged
dbjpanda merged 1 commit into
mainfrom
www/landing-root-layout
Sep 24, 2026
Merged

dbjpanda merged 1 commit into
mainfrom
www/landing-root-layout

Conversation

@dbjpanda

Copy link
Copy Markdown
Contributor

What

Two root layouts. app/(site)/ now holds the shared fumadocs shell (provider, global.css, search) and every route that needs it: docs, blog, compare, brand, api/search, og, llms*. app/(home)/ is a root layout of its own: <html>/<body>, a next-themes provider with the same settings and storage key as fumadocs', Tailwind's preflight, and landing-base.css, which mirrors the design tokens from global.css. The landing used two utilities from the global sheet and paid for all of it on every visit.

Islands. The showcases with no copy (dashboard scene, beam diagram, footer particle wordmark) mount when the reader scrolls within 600 px, through a dynamic import in a client wrapper, so their JS is not downloaded or hydrated up front. Each island reserves its measured height per breakpoint (.island--* in home.css). Everything with text (hero, steps, feature cards, components, pillars, comparison table, bento, FAQ) stays server-rendered and hydrates exactly as before.

Measured (local production build, software GL as PageSpeed runs it)

before after
Mobile performance 88 91–92 (3 runs)
Mobile LCP 3.9 s 3.2–3.5 s
Mobile CLS 0 0
Desktop performance 100 100
Landing stylesheets / script chunks 4 / 27 3 / 11
Accessibility, SEO 100, 100 100, 100

Checked

  • Every route family 200 (landing, docs, blog, compare, brand, api/search, docs OG images), /docs 308, 404 page renders.
  • Root metadata files still apply to both layouts: sitemap, robots, opengraph-image, icons, canonical, site verification.
  • Theme toggle: set light on the landing → docs open light → toggle back on the landing. Docs search opens from the sidebar button.
  • Islands mount on scroll at 1309 px and 390 px with the reserved heights matching their content.
  • tsc clean.

Note

The remaining mobile gap to 100 is the simulated slow-4G bandwidth model against ~500 KB of landing JS (React, motion, the hero editor, three.js after load) and three preloaded fonts. Next step if wanted: audit motion usage in FeatureCards and the hero editor's highlighter.

…lands

Two root layouts. app/(site) keeps the fumadocs shell for docs, blog,
compare, brand and the API routes: provider, global stylesheet, search.
app/(home) is now a root layout of its own with a next-themes provider,
Tailwind's preflight and a mirror of the design tokens (landing-base.css),
and nothing else. The landing used two utilities from the global sheet
and paid for all of it, ~95 KB of CSS before compression plus the search
bundle, on every visit. Same theme storage key, so the toggle on either
side is seen by the other.

The showcases that carry no copy (the dashboard scene, the beam diagram,
the particle wordmark) mount when the reader scrolls within a screen of
them, through a dynamic import that nothing preloads. Each reserves its
measured height first, so nothing moves. Every section with text stays
server-rendered and hydrates as before.

Mobile Lighthouse (software GL, simulated slow 4G): 88 -> 91-92, LCP
3.9 s -> 3.2-3.5 s, CLS 0. Desktop stays 100. Metadata files at app/
(sitemap, robots, icons, share images) apply to both layouts unchanged.
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
concile Ready Ready Preview Sep 24, 2026 10:20pm UTC

@dbjpanda
dbjpanda merged commit 3de629d into main Sep 24, 2026
7 of 8 checks passed
@dbjpanda
dbjpanda deleted the www/landing-root-layout branch September 24, 2026 22:28

This branch was successfully deployed

1 active deployment
Preview — 0b6092e0 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant