Make the homepage, library landing pages, and docs materially faster, lighter, and cheaper to render without regressing content quality or navigation UX.
- Homepage route chunk:
dist/client/assets/index-Bq0A5jmY.jsat564.79 kB / 172.14 kB gzip - Shared shell chunk:
dist/client/assets/app-shell-BikUtTEO.jsat349.55 kB / 110.08 kB gzip - Search modal chunk:
dist/client/assets/SearchModal-Bl-tUxqr.jsat195.54 kB / 54.27 kB gzip - Docs shell chunk:
dist/client/assets/DocsLayout-Bga1-HA9.jsat17.61 kB / 6.05 kB gzip - Markdown chrome chunk:
dist/client/assets/MarkdownContent-ia2V1dk8.jsat19.37 kB / 6.39 kB gzip - Global CSS:
dist/client/assets/app-CBMELhsb.cssat319.24 kB / 40.48 kB gzip
- Homepage ships too much in one route chunk.
- Library landing pages pay docs-shell and docs-config cost before the user asks for docs.
- Docs still do too much work per request even with GitHub content caching.
- Hidden docs UI still mounts and runs effects/queries.
- Anonymous docs users still trigger auth-related client queries for framework preference.
- Some "lazy" controls are effectively eager.
- Cut the homepage route chunk hard enough that it is no longer one of the top client payloads.
- Remove docs-config and docs-layout from the critical path for landing pages.
- Turn docs page rendering into mostly cached work.
- Avoid client queries on first paint for content that can be rendered server-side.
- Reduce hidden-work JS on docs mobile and desktop layouts.
Targets:
src/routes/index.tsxsrc/components/OpenSourceStats.tsxsrc/components/ShowcaseSection.tsxsrc/components/PartnersGrid.tsxsrc/components/MaintainerCard.tsx
Changes:
- Break below-the-fold homepage sections into viewport-triggered lazy boundaries.
- Move recent posts off client
useQueryand into route loader or server-rendered data. - Stop client-fetching OSS stats on initial paint. Render a server snapshot first.
- Keep
DeferredApplicationStarterdeferred by visibility or interaction, not just idle timeout. - Avoid eagerly importing large static datasets into the first route chunk where possible.
- Stop rendering both light and dark hero image variants eagerly.
Expected win:
- Lower homepage JS, lower hydration cost, lower first-load network.
Targets:
src/routes/-library-landing.tsxsrc/components/DocsLayout.tsx- landing components under
src/components/landing/
Changes:
- Introduce a dedicated
LibraryLandingLayout. - Remove
DocsLayoutfrom landing pages. - Stop fetching docs
config.jsonin the landing-page critical path unless a landing section actually needs it. - Keep framework/version/docs navigation lightweight on landing pages and hand off to docs only when needed.
Expected win:
- Better landing-page TTFB, less landing-page JS, less docs chrome on non-docs surfaces.
Targets:
src/utils/docs.functions.tssrc/utils/github-content-cache.server.tssrc/utils/markdown/renderRsc.tsxsrc/utils/markdown/processor.rsc.tsxsrc/components/markdown/renderCodeBlock.server.tsx
Changes:
- Cache rendered docs artifacts, not just raw GitHub files.
- Persist
title,description,headings, and rendered output keyed by repo, ref, docs root, and path. - Reuse existing docs artifact cache infra instead of adding a second caching path.
- Make docs requests mostly cache hits unless the source changed.
Expected win:
- Better docs TTFB, less server CPU, fewer repeated markdown and Shiki passes.
Targets:
src/components/DocsLayout.tsxsrc/components/RightRail.tsxsrc/components/RecentPostsWidget.tsx
Changes:
- Do not mount mobile docs menu on desktop.
- Do not mount desktop docs menu on mobile.
- Do not mount right rail when hidden by breakpoint.
- Gate animated partner strip work by actual viewport and reduced-motion preference.
- Ensure hidden rails do not issue queries or observers.
Expected win:
- Lower docs runtime cost, especially on mobile.
Targets:
src/components/FrameworkSelect.tsxsrc/hooks/useCurrentUser.tssrc/components/SearchModal.tsxsrc/components/NavbarAuthControls.tsx
Changes:
- Make framework preference local-first for anonymous users.
- Only sync framework preference to server when user state is already known.
- Avoid triggering
getCurrentUseron docs and landing pages just to resolve a preference. - Audit other shell components for accidental auth fetches during anonymous browsing.
Expected win:
- Fewer unnecessary client requests, cleaner anonymous docs navigation.
Targets:
src/routes/__root.tsxsrc/router.tsxsrc/components/Navbar.tsxsrc/components/markdown/MarkdownContent.tsx
Changes:
- Verify why some intended dynamic imports are not splitting effectively.
- Trim eager shell work around Sentry boot where possible.
- Fix
MarkdownContentsoCopyPageDropdownonly loads on real interaction. - Review navbar asset duplication and avoid eager light/dark image duplication where possible.
Expected win:
- Smaller app shell, less global cost paid by every route.
- Fix obviously accidental eager work.
- Make docs layout mount only what is visible.
- Remove anonymous auth fetches from docs and landing flows.
- Add dedicated library landing shell and remove docs-config from landing critical path.
- Move homepage content and stats to server-first data flows and split below-the-fold sections.
- Add rendered docs artifact caching.
- Rebuild and compare chunks, request timings, and interaction cost.
- Fix
MarkdownContenteager copy-dropdown load - Stop hidden docs rails and menus from mounting
- Gate mobile partner strip animation correctly
- Remove anonymous auth fetches from framework selection and related docs shell code
- Add
LibraryLandingLayout - Remove
DocsLayoutand docs config dependency from landing critical path
- Split homepage below the fold
- Server-render recent posts and stats
- Tighten app-starter deferral
- Cache rendered docs artifacts
- Measure docs TTFB and server CPU improvement
- Shared shell follow-up: Sentry boot, navbar assets, remaining bundle outliers
- Run
pnpm buildafter each major phase. - Track homepage, a representative library landing page, and a representative docs page.
- Compare:
- route chunk size
- app shell size
- docs TTFB
- number of client requests on first load
- whether anonymous docs visits trigger user/auth requests
- smoke-check desktop and mobile docs navigation
LazyLandingCommunitySectionandLazySponsorSectionalready use the right pattern. Reuse that pattern more aggressively.StackBlitzEmbedis alreadyloading="lazy", but a poster-plus-click model may still be worth it for landing pages.- Do not spend time micro-optimizing heading observers or tiny docs chunks before fixing the homepage and landing-page architecture.