landing-static: prerender landing page via route groups#47
Conversation
Split routes into (marketing) and (app) groups so auth only runs on dashboard routes, and prerender / as static HTML at build time.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR restructures the SvelteKit route tree into
Confidence Score: 5/5Safe to merge — the refactor is a clean mechanical split with no logic changes to auth or app routes. Every app route is a pure rename into No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Root["+layout.svelte\nCSS + favicon only"]
Root --> Marketing["(marketing) group\nno layout server"]
Root --> App["(app) group\n+layout.server.ts → userId"]
Marketing --> Landing["/ +page.svelte\nprerender = true ✓"]
Marketing --> SignIn["/sign-in +page.server.ts\nreadUserId → redirect if authed"]
Marketing --> SignUp["/sign-up +page.server.ts\nreadUserId → redirect if authed"]
App --> AppLayout["(app)/+layout.svelte\nAppShell + PostHog identify"]
AppLayout --> Runs["/runs"]
AppLayout --> RunId["/runs/[id]"]
AppLayout --> Regression["/regression"]
AppLayout --> RegressionId["/regression/[id]"]
AppLayout --> RegressionRuns["/regression/runs/[id]"]
Landing -->|"rel=external links\n(crawler stops here)"| Runs
Reviews (1): Last reviewed commit: "Prerender landing page via SvelteKit rou..." | Re-trigger Greptile |

Why?
The landing page at
/was SSR'd on every request because the root layout server load reads auth from cookies. Marketing content is fully static, so we can prerender it as HTML at build time for faster loads and CDN caching on Vercel.What
(marketing)and(app)groups (URLs unchanged)readUserId,AppShell, and PostHog identify into(app)/+layout.*onlyexport const prerender = trueon the landing pagerel="external"so the prerender crawler skips auth-protected/runsTest plan
bun run buildsucceeds and emits prerenderedindex.html/loads marketing content without hitting serverless auth/runsand/regressionstill require auth and render with AppShell/sign-inand/sign-upstill redirect authenticated users