Skip to content

fix(react): use server snapshots without storage subscriptions - #10

Merged
SoonIter merged 2 commits into
mainfrom
soon-codex/fix-ssr-external-store
Nov 12, 2026
Merged

SoonIter merged 2 commits into
mainfrom
soon-codex/fix-ssr-external-store

Conversation

@SoonIter

Copy link
Copy Markdown
Owner

useSyncExternalStore currently uses the client reconciler implementation, which reads getSnapshot and schedules subscriptions even during Markdown rendering. Browser-only subscriptions can therefore throw window is not defined after the renderer has already returned its Markdown string, as reported in web-infra-dev/rspress#3858.

Intercept this hook with the same behavior as React Fizz: require and read getServerSnapshot, without calling getSnapshot or subscribing. Document this requirement and add regressions for distinct client/server snapshots, browser-only subscriptions after the commit callback, and a missing server snapshot.

Validation: the regression fails before the fix; all 32 tests pass afterward. ESM/CJS builds, declaration generation, Publint, TypeScript checking, and Biome checks pass.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 07:35
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T07:35:48.353544Z
We couldn’t complete this review. Comment @codex review to try again.
f1bd789 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@SoonIter
SoonIter merged commit 6d6cfb9 into main Nov 12, 2026
3 checks passed
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.

2 participants