Queue-North-Website/scripts
null a6b87c7123 fix(ui): React was throwing away the prerendered page on every route
Suspected from the code while planning Batch 17, then confirmed in Chromium:
every page logged React error #418, a hydration mismatch. React answers a
mismatch by discarding the server DOM and re-rendering the page on the client.
So the prerender ran, crawlers received it, and every visitor's browser threw it
away and did the work again.

Two causes, both ours:

1. prerender hoisted the JSON-LD scripts out of the body into <head>. React
   hoists only async scripts with a src, so on the client that script stays
   where its component renders it. The DOM and the client's first render
   therefore disagreed on every page that emits structured data. JSON-LD is
   valid anywhere in the document, so it now stays where React puts it. Title,
   meta and link tags are still hoisted, because React hoists those itself.

2. main.jsx rendered sonner's <Toaster> in the first client pass, and the server
   entry never rendered one, so the client expected a <section> the prerendered
   HTML did not have. It mounts after hydration instead, which costs nothing: a
   toast can only follow an interaction.

Measured in a real browser, all 18 sitemap pages, before and after: hydration
errors 18 to 0, other console and page errors 0. Each page keeps its
server-rendered DOM (an h1 stamped before hydration survives), and still has
exactly one head title and one canonical. Structured data is unchanged in
substance: 27 JSON-LD blocks across 19 pages, and OAI-SearchBot still receives
Service, BreadcrumbList and Organization on the contact-center page.

Closes #226.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 04:37:33 -05:00
..
verify.d security: the scanner never ran its private-key pattern, and verify never saw dist 2026-09-10 04:23:39 -05:00
backup.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
check-env.sh security: the scanner never ran its private-key pattern, and verify never saw dist 2026-09-10 04:23:39 -05:00
deploy.sh fix(deploy): stop two ways this tooling would have broken production 2026-08-18 03:33:20 -05:00
doc-triggers.py chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
docker-test.sh chore: add docker-push.sh, docker-test.sh, npm scripts, bump v0.5.0 2026-05-14 01:18:44 -05:00
forgejo-issue.py chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
healthcheck.sh fix(infra): queuenorth.com is the production origin, and it is this deployment 2026-08-18 02:08:12 -05:00
preflight.sh fix(infra): queuenorth.com is the production origin, and it is this deployment 2026-08-18 02:08:12 -05:00
prerender.js fix(ui): React was throwing away the prerendered page on every route 2026-09-10 04:37:33 -05:00
qa-browser.mjs fix(ui): header CTA clipped at iPad portrait, and reCAPTCHA cut off at 320px 2026-08-18 04:05:37 -05:00
release.sh fix(deploy): stop two ways this tooling would have broken production 2026-08-18 03:33:20 -05:00
restore-check.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
secrets.sh security: the scanner never ran its private-key pattern, and verify never saw dist 2026-09-10 04:23:39 -05:00
status.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
verify.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00