Skip to content

fix(ui): stable server snapshot in useResponsive (#438) - #446

Merged
thinkclay merged 1 commit into
mainfrom
fix/server-snapshot-438
Jul 30, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/server-snapshot-438

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Summary

Bumps the @scaffald/ui submodule to pick up Scaffald/ui#14, which had been open and unmerged — so the fix described in #438 as "did not resolve this" was in fact never in the tree at our submodule pointer.

_getServerSnapshot returned a fresh { width: 1280, height: 900 } on every call, so React saw the snapshot change on every read — precisely what "The result of getServerSnapshot should be cached to avoid an infinite loop" describes. useResponsive backs Box/Stack/Grid, so it runs many times per SSR page.

Framing this honestly as latent-bug removal, not a confirmed fix for #438 — see my investigation comment on the issue. The warning does not currently reproduce on main with clean caches, so I can't claim causation. But returning an unstable reference from getServerSnapshot violates React's documented contract, the apex renders server-side, and the change is two lines.

Refs #438 (left open — the user-visible half is unresolved, details on the issue)

Verification

@scaffald/ui rebuilds and typechecks clean; _SERVER_SNAPSHOT present in dist; dev server boots and public job pages render with no getServerSnapshot output.

🤖 Generated with Claude Code

Bumps @scaffald/ui to pick up Scaffald/ui#14, which had been open and
unmerged for a week. `_getServerSnapshot` returned a fresh
`{ width, height }` object on every call, so React saw the snapshot change
on every read — exactly what "The result of getServerSnapshot should be
cached to avoid an infinite loop" describes. useResponsive backs
Box/Stack/Grid, so it runs many times per SSR page.

Latent-bug removal: the warning does not currently reproduce on main with
clean caches (full bisect in #438), but returning an unstable reference
from getServerSnapshot violates React's documented contract regardless,
and the apex renders server-side.

Refs #438

Co-Authored-By: Claude Fable 5 <[email protected]>
@thinkclay
thinkclay merged commit 9bb6f3b into main Jul 30, 2026
3 of 11 checks passed
@thinkclay
thinkclay deleted the fix/server-snapshot-438 branch July 30, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant