Applies the owner's Lighthouse targets

Three pages no longer need an exception and the homepage target rises to its
measured score, so the gain cannot slip away unnoticed. Also adds the third
unit's code summary and updates the shared docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 20:07:24 +01:00
co-authored by Claude Opus 5.5
parent 498be43020
commit b6d5a85e41
12 changed files with 181 additions and 44 deletions
@@ -123,7 +123,7 @@ Text alternative: client.tsx starts Sentry and hydrates the prerendered page (pr
### config/ (build-time, Node)
- **Purpose**: Server configuration as code
- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-<hash>.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths)
- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-<hash>.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths; unit 3 of prerendering: also the 301 redirects of `canonicalUrls.ts` and the opt-in `--audit-route`, which serves the 404 page with 200 at `/__audit/404` for Lighthouse only); unit 3 adds `canonicalUrls.ts` (one page list for the URL contract) and `compressibleTypes.ts` (one type list for gzip and the IIS MIME pins)
- **Type**: Infrastructure-as-code (small)
### theme.ts / recipes/
@@ -159,6 +159,6 @@ Text alternative: a visitor navigates, the router renders the root layout (AppSh
## Infrastructure Components
- **IaC**: None beyond generated web server configs in `web/deploy/`
- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; server rules still to be changed in unit 3 of prerendering). Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse)
- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; unit 3 of prerendering: one URL contract on nginx, IIS and the preview server: `/x` serves `x.html` with 200, variants of a known page get one 301 to the canonical path with the query kept, unknown URLs and `/404`, `/404.html` give a real 404; the generated nginx block has its own gzip configuration; production upload in three passes (assets, then all HTML and `web.config`, then deletion of stale files, `deploy/upload-production.sh`) after `deploy/check-artifact.sh`; `deploy/verify-deployment.sh` checks the result after a deploy; the IIS rules are generated as text and are unverified until a host exists). Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse)
- **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs)
- **Networking**: N/A
@@ -5,7 +5,7 @@
- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`)
- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami, all home sections, PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal, NoScript CSS and menu links, first-row grid (display fallbacks; also `displayHydration`, `displayPrerender` and the e2e files `displayHtml`, `noJs`, `noJsMenu`, `reveal`, `images`), ContactForm(+Gate) — with axe accessibility checks; `app.test.tsx` renders whole routes
- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI
- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance)
- **Integration / E2E**: Browser tests on `dist/client` (`pnpm e2e`); unit 3 of prerendering adds a real nginx test in CI (the generated block against the preview server, the `lighthouse` job installs nginx and lftp and fails when nginx is missing); Lighthouse CI covers built pages (accessibility, best practices, SEO, performance), the not-found page through `/__audit/404`
## Code Quality Indicators
- **Linting**: ESLint (typescript-eslint, react-hooks, jsx-a11y), enforced in CI
@@ -13,7 +13,8 @@
- **Documentation**: Short Dutch comments explaining *why*, often referencing requirement IDs (FR-xx, BR-xx, NFR-xx, Mx) from earlier AI-DLC features
## Technical Debt
- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering
- Mobile Lighthouse performance exceptions (owner decision 2026-11-01, after the final measurement of prerendering): floor 0.85 for `/` (measured 0.85, raised from 0.8), gezin (0.89) and loveshoot (0.88) until responsive photos exist, and for zwangerschap and portret (both ~0.90, unreliable as a target with one run); all other pages must reach 0.9. Desktop is 0.9 everywhere
- IIS rules are generated but unverified until a host exists; the nginx proof runs on nginx 1.24 in CI, the Pi runs 1.30
- Four routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts`
- No responsive image pipeline (srcset/sizes); photos are single JPEGs
- Comment language is mixed: older code is commented in Dutch, homepage-sections code in English
@@ -8,7 +8,7 @@
- `web/tsconfig.json` — bundler mode, `@/*` → `src/*`
- `web/eslint.config.js` — JS + typescript-eslint + react-hooks + jsx-a11y recommended
- `web/.prettierrc` — 4 spaces, single quotes, semicolons
- `web/lighthouserc.cjs` / `.desktop.cjs` — Lighthouse CI against `pnpm preview` (accessibility and best practices 1.0, performance 0.9; home mobile 0.8)
- `web/lighthouserc.cjs` / `.desktop.cjs` — Lighthouse CI against `pnpm preview` (accessibility and best practices 1.0, performance 0.9; mobile exceptions in a table with a recorded decision per page, 0.85 for `/`, zwangerschap, gezin, loveshoot and portret; the not-found page is audited through `/__audit/404`)
- `.gitea/workflows/continuous_integration.yaml` — jobs `check`, `deploy-test`, `lighthouse`, `deploy-production`
## Key Classes/Modules
@@ -106,15 +106,16 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
- `web/src/monitoring/*` — Sentry/Umami config and loader
- `web/src/navigation.ts` — `RoutePath`, `NavItem` (with `children`, one level), `hasChildren`, `mainNav` (the shoot submenu comes from `shootTypes` via `shootNavItems`), `footerNav`
- ★ `web/src/seo.ts` (+ `preloadImage`), `web/src/lib/{revealPhase,firstRow}.ts`, `sitePages.ts`, `sitemap.ts` — SEO (`/over-mij` is `indexed: false` today)
- ★ `web/lighthouserc.cjs` / `.desktop.cjs` — own list of indexed/noindex paths, guarded by a test
- ★ `web/lighthouserc.cjs` / `.desktop.cjs` — own list of indexed/noindex paths, guarded by a test; data-driven exception table (`mobileExceptions`) tested in `config/lighthouserc.test.ts`
- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, `fakeIntersectionObserver`, setup
- `web/src/test/navArbitraries.ts` — navigation generators (menu events, menu states, pathnames; unit 3, not in `lib/` so the 100 % threshold does not apply); `web/src/test/navViewport.ts` — viewport helper (`matchMedia` stub and the `lg` display rules, because jsdom ignores `@media`)
- `web/src/assets/*` — hero photos (8), `home/` (intro 1–4, andrea, deco 1–2, two review photos), light/dark logos
- `web/config/securityHeaders.ts` — CSP
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
- `web/config/{pageFiles,inlineScripts,externalizeInlineScripts,previewServer}.ts` — prerendering: page file names, moving inline scripts to files after the build, preview server with the real server rules; `web/e2e/` and `web/vitest.e2e.config.ts` — browser tests on `dist/client`
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs
- `web/config/{pageFiles,inlineScripts,externalizeInlineScripts,previewServer,canonicalUrls,compressibleTypes}.ts` — prerendering: page file names, moving inline scripts to files after the build, preview server with the real server rules; `web/e2e/` and `web/vitest.e2e.config.ts` — browser tests on `dist/client`
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs (unit 3: URL contract, gzip block); `web/deploy/{check-artifact,verify-deployment,upload-production}.sh` — artifact guard, post-deploy check, three-pass FTPS upload (unit 3)
- `web/e2e/{serverRules,deployScripts,urls}.e2e.ts`, `web/e2e/support/{fixtureSite,nginx}.ts`, `web/src/test/urlArbitraries.ts` — real-nginx tests and parity with the preview server, deploy script tests, URL behaviour in Chrome, URL generators (unit 3)
- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg; `og-{newborn,zwangerschap,gezin,loveshoot,portret}.jpg` (unit 2: 1200 × 630, the shoot pages' `ogImage`)
## Design Patterns