Skip to content

Conversation

@orionmiz
Copy link
Collaborator

@orionmiz orionmiz commented Oct 23, 2025

Fixes #635

Fixes SSR error "Missing getServerSnapshot, which is required for server-rendered content" by adding the third parameter to useSyncExternalStore in plugin-history-sync.

The getServerSnapshot parameter is required for SSR environments to provide an initial snapshot value during server rendering.

🤖 Generated with Claude Code

…ity (#635)

Fixes SSR error "Missing getServerSnapshot, which is required for server-rendered content"
by adding the third parameter to useSyncExternalStore in plugin-history-sync.

The getServerSnapshot parameter is required for SSR environments to provide an initial
snapshot value during server rendering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2025

🦋 Changeset detected

Latest commit: ac50fb1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/plugin-history-sync Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 23, 2025

Deploying stackflow-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: ac50fb1
Status: ✅  Deploy successful!
Preview URL: https://2cadc78b.stackflow-demo.pages.dev
Branch Preview URL: https://claude-fix-issue-635-011cupq.stackflow-demo.pages.dev

View logs

@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Resolved server-side rendering (SSR) compatibility issue in the history sync plugin that was preventing proper rendering of server-rendered content in SSR environments.

Summary by CodeRabbit

  • Refactor
    • Optimized internal synchronization mechanism for activity tracking to improve consistency and reliability.

Walkthrough

A third argument, getActivityActivationCounts, was added to the useSyncExternalStore call in the history sync plugin to provide the server snapshot parameter for SSR.

Changes

Cohort / File(s) Change Summary
Hook parameter addition
extensions/plugin-history-sync/src/historySyncPlugin.tsx
Passed getActivityActivationCounts as the third (server snapshot) argument to useSyncExternalStore

Sequence Diagram(s)

(No diagram provided — change is a single-argument addition to a hook call; no control-flow changes.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "fix(plugin-history-sync): add getServerSnapshot to useSyncExternalStore for SSR compatibility" clearly and concisely describes the primary change in the changeset. It identifies the package being modified, the specific code change (adding getServerSnapshot parameter), and the motivation (SSR compatibility). The title is specific enough that a developer reviewing the repository history would immediately understand this patch addresses an SSR-related issue without needing to read the full description.
Linked Issues Check ✅ Passed The code changes fully address the objective from linked issue #635. The PR adds the getServerSnapshot parameter as the third argument to useSyncExternalStore in historySyncPlugin.tsx, which directly resolves the reported error "Missing getServerSnapshot, which is required for server-rendered content." The changeset documentation confirms the patch adds SSR compatibility by introducing the required getServerSnapshot parameter, matching the issue's requirement to provide this implementation in SSR environments.
Out of Scope Changes Check ✅ Passed All changes in this pull request are directly in scope with the linked issue #635. The modification to historySyncPlugin.tsx adds only the required getServerSnapshot parameter to useSyncExternalStore, and the new changeset file documents this specific patch release. No unrelated changes, refactoring, or other out-of-scope modifications appear to have been introduced alongside the core fix.
Description Check ✅ Passed The pull request description is directly related to the changeset and provides meaningful context about the fix. It explains the specific SSR error being resolved, identifies the root cause (missing getServerSnapshot parameter), and clarifies why the parameter is required in SSR environments. The description references the linked issue (#635) and provides sufficient detail to understand the problem and solution without being verbose.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-issue-635-011CUPQPYvD8cK437EReGmS3

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 78282e7 and ac50fb1.

📒 Files selected for processing (1)
  • .changeset/fix-ssr-getServerSnapshot.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Include a Changeset entry for any user-facing package change

Files:

  • .changeset/fix-ssr-getServerSnapshot.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: stackflow-docs
🔇 Additional comments (1)
.changeset/fix-ssr-getServerSnapshot.md (1)

1-5: Changeset entry correctly documents the SSR compatibility fix.

The changeset follows the correct format with proper YAML front matter, appropriate patch bump level for this bug fix, and a clear description of the SSR error being resolved. The entry correctly documents a user-facing package change per coding guidelines.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 23, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stackflow-docs ac50fb1 Commit Preview URL Oct 23 2025, 03:31 AM

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

@stackflow/demo

yarn add https://pkg.pr.new/@stackflow/[email protected]

commit: ac50fb1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@orionmiz orionmiz merged commit 567352a into main Oct 23, 2025
9 checks passed
@orionmiz orionmiz deleted the claude/fix-issue-635-011CUPQPYvD8cK437EReGmS3 branch October 23, 2025 03:43
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.

SSR 시 오류 발생 (@stackflow/plugin-history-sync)

3 participants