# Components: prerendering All paths are under `web/`. "New" and "changed" refer to master at c4c2f83. ## Build and entry (unit 1) | Component | Status | Responsibility | |---|---|---| | `vite.config.ts` | Changed | Adds the `tanstackStart` plugin with prerendering; the plugin is left out under Vitest | | `src/router.tsx` | New | `getRouter()`: the router options now in `main.tsx` (scroll restoration, default error component) | | `src/routes/__root.tsx` | Changed | Renders the document through `shellComponent` (`html`, `HeadContent`, providers, `Scripts`); imports the fonts | | `src/client.tsx` | New | Browser entry: starts Sentry, then hydrates. Replaces `main.tsx` | | `src/main.tsx`, `index.html` | Removed | Start generates the document; fallback tags are no longer needed | | `config/inlineScripts.ts` | New | Pure logic: finds executable inline scripts in HTML and replaces them with file references | | `config/externalizeInlineScripts.ts` | New | Post-build runner: applies the logic to all HTML in the output, writes the files, fails the build on a violation | | `config/previewServer.ts` | New | Static server for Lighthouse and browser tests, following the nginx rules and using `securityHeaders` | | `e2e/` | New | Browser tests against the built output: hydration, CSP, content without JavaScript | | `src/test/renderApp.tsx` | Changed | Renders the app without the document shell in jsdom | ## Hydration safety (unit 1) | Component | Status | Responsibility | |---|---|---| | `src/hooks/useHydrated.ts` | New | `false` during prerendering and the first browser render, then `true` | | `routes/index.tsx`, `routes/contact.tsx`, `routes/portfolio.tsx` | Changed | Search values take effect after hydration, through `useHydrated` | | `usePageLoaded`, `useInView` | Changed | Same first render on server and client | | `NavigationBar`, `useReveal`, `useHeroSlider`, `TestimonialCarousel`, `ContactSection` | Changed | Breakpoint and media query values start from a server-safe value; `useHeroSlider` also reads `document.hidden` safely | | `UmamiAnalytics` | Changed | Reads the hostname in its effect, not during render | | `Footer`, `ContactDetails`, `lib/contactChannels.ts`, `ContactFormGate`, `ContactForm` | Changed | E-mail address only after hydration (FR-PR-22); `Footer` also renders the year safely | | `src/routes/$.tsx` | New | Catch-all route rendering `NotFound`; source of `404.html` | | `NotFound` | Changed | Shows the shoot section buttons after hydration | ## Display (unit 2) | Component | Status | Responsibility | |---|---|---| | `Reveal`, `useReveal` | Changed | Visible in the HTML; only content below the viewport at load is hidden for its fade-in | | `DeferredImage` | Changed | Real image for visitors without JavaScript; deferred loading with JavaScript stays | | `NoScriptNav` | New | Rendered inside `