v0.3.5
What's Changed
Changed
-
Iframe-link rewrite moved from JS to server-side
Sec-Fetch-Dest
detection. v0.3.4 shipped a capture-phase click listener in
render-cell.twigthat rewrote/styleguide/{component,page,foundations}/X
hrefs to the/render/...endpoint before browser navigation. The same
goal is now achieved at the routing layer:Styleguide::run()calls a
newRouter::synthesizeEmbeddedRoute()helper that swaps the SPA route
for therenderequivalent whenever the request carries
Sec-Fetch-Dest: iframe(the browser's authoritative signal for any
sub-frame load — the initial iframe SRC and every same-target link
click within it).Consumer-visible behaviour is unchanged: iframe links to
/styleguide/page/Xstill load render-cell contents (no nested chrome).
But the implementation now lives in one testable PHP method instead of
a JS interceptor inside every iframe, the link'shrefin component
markup stays semantically correct as the SPA URL, and the synthesis
rule is covered by 6 new unit tests inRouterTest.Top-level navigation (
Sec-Fetch-Dest: document) and any other Dest
value (image, script, …) pass through unchanged — only sub-frame
requests trigger the swap. Older browsers without the
Sec-Fetch-Destheader (Safari < 16.4) fall through to the SPA shell
as before; previewing in those browsers will show the old nested
chrome inside the iframe, but the dev-tools target (Chrome / Firefox
/ Edge / Safari 16.4+) gets the clean path.
Full Changelog: v0.3.4...v0.3.5