Queue-North-Website/docs
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
..
architecture fix(ui): React was throwing away the prerendered page on every route 2026-09-10 04:37:33 -05:00
data docs: adopt project template, retire the markdown backlog 2026-08-18 01:21:13 -05:00
design docs: adopt project template, retire the markdown backlog 2026-08-18 01:21:13 -05:00
history docs: log Batch 11 and Batch 16 — four false, two real, found by rendering 2026-08-18 04:09:31 -05:00
planning feat(deploy): production always runs a numbered version 2026-08-18 02:54:42 -05:00
qa fix(ui): header CTA clipped at iPad portrait, and reCAPTCHA cut off at 320px 2026-08-18 04:05:37 -05:00
security security: the scanner never ran its private-key pattern, and verify never saw dist 2026-09-10 04:23:39 -05:00
DOC_TRUST_MAP.md fix(security): stop secrets.sh flagging every prerendered page, and clear the dangling doc claims 2026-08-18 01:40:46 -05:00
OPERATIONS.md docs: v0.9.4 is live, production is on a numbered version, and Watchtower is out 2026-08-18 03:38:02 -05:00
TOOLS.md fix(build): the prerender preloaded the logo, hoisted any tag, and hid its errors 2026-09-10 04:32:33 -05:00
WORK_CYCLE.md feat(deploy): production always runs a numbered version 2026-08-18 02:54:42 -05:00