perf(landing): defer Features preview, memoize integration grid, trim dead weight#5303
Conversation
The preview is code-split (ssr:false) but was mounted eagerly, so its reactflow + framer-motion chunk (~85-100 KB gz) downloaded right after hydration despite sitting below the fold. Gate the dynamic mount on an IntersectionObserver (400px preload margin, loads once), reusing the existing dimension-stable aspect-[1116/615] placeholder so there's zero CLS.
Derive the category facets and a per-integration lowercased search index once from the (stable) integration list instead of rebuilding + re-lowercasing ~3.5k strings on every keystroke, and memo IntegrationRow so the ~220 rows don't all re-render per keystroke. Match semantics are identical (per-field includes).
Remove unreferenced public/static/mothership.gif (1.5 MB) and public/landing/sim-mothership.webp (87 KB), the unused static Season font weights (only the variable woff2 is loaded), and the unused CtaChat component.
The resize effect re-subscribed on every phase change (~30x/loop); read the current phase from a ref so the listener is added once for the component's life.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Features preview ( Integrations grid: category facets and a per-integration lowercased search index are built once via Hero visual: window Cleanup: removes the unused Reviewed by Cursor Bugbot for commit 3bfabc2. Configure here. |
Greptile SummaryThis PR improves landing-page performance without changing the visible page behavior. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "perf(landing): load preview eagerly when..." | Re-trigger Greptile |
…ailable Graceful degradation for browsers/WebViews without IntersectionObserver — set inView immediately instead of leaving the preview stuck on its placeholder (addresses Greptile P2).
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3bfabc2. Configure here.
Summary
Landing performance wins from a verified audit (each finding adversarially confirmed before implementing). No behavior, SEO, or render-mode change — all confirmed empirically.
Defer the Features workflow preview (biggest win)
landing-preview-mount.tsxis code-split (ssr:false) but was mounted eagerly, so its reactflow + framer-motion chunk (~85–100 KB gz) downloaded right after hydration despite sitting below the fold. It's now gated on anIntersectionObserver(400px preload margin, loads once), reusing the existing dimension-stableaspect-[1116/615]placeholder → zero CLS. SEO-neutral (the preview was alreadyssr:false, so SSR only ever emitted the placeholder).Memoize the integration grid
integration-grid.tsxrebuilt category facets and re-lowercased ~3,480 operation/trigger strings on every keystroke, and re-rendered all ~220 rows. Now: facets + a per-integration lowercased search index are derived once (useMemoover the stable list), andIntegrationRowismemo'd (both props are stable references). Match semantics are identical (per-fieldincludes, not a joined string — verified:?q=slackreturns the same 6 results).Hero resize listener
Subscribes once via a
phaseRefinstead of re-subscribing on every animation phase (~30×/loop).Delete dead weight
Orphaned
public/static/mothership.gif(1.5 MB) +public/landing/sim-mothership.webp(87 KB), the unused static Season font weights (only the loaded variable.woff2is kept), and the unusedCtaChatcomponent — all re-verified unreferenced across the repo.Not included (deliberately)
next/imageunoptimized— left as-is.Testing
tsc --noEmit0 errors;biome checkcleannext build: compiled successfully, 712/712 pages, 0 errors; font deletions safe (nonext/fonterrors); render modes unchanged/integrations?q=slackreturns the identical filtered set (223 → 6);/workflows(a gated-preview consumer) → 200memoprop stability, deletion safety) — no issuesType of Change