Skip to content

UnresolvedFile SSR Bugs#426

Merged
amadeus merged 3 commits intomainfrom
amadeus/merge-conflict-ssr-fix
Mar 26, 2026
Merged

UnresolvedFile SSR Bugs#426
amadeus merged 3 commits intomainfrom
amadeus/merge-conflict-ssr-fix

Conversation

@amadeus
Copy link
Member

@amadeus amadeus commented Mar 26, 2026

Fixes two UnresolveFile bugs

  • Hydration with react components was broken
  • Fixed maxContextLines not getting synced through from SSR

@vercel
Copy link

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Mar 26, 2026 7:06am
pierrejs-docs Ready Ready Preview Mar 26, 2026 7:06am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes SSR/hydration issues for the React UnresolvedFile integration by ensuring client-side parsing/hydration matches the server-rendered output and by improving hydration setup for UnresolvedFile instances.

Changes:

  • Pass options.maxContextLines through when parsing merge-conflict diffs in the React useUnresolvedFileInstance hook (prevents SSR/client mismatch).
  • Rework UnresolvedFile.hydrate to explicitly wire up shadow DOM nodes from prerendered HTML and perform the necessary renderer/manager setup.
  • Expose selected FileDiff internals as protected so subclasses (like UnresolvedFile) can reuse them during hydration.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/diffs/src/react/utils/useUnresolvedFileInstance.ts Syncs initial merge-conflict diff parsing with SSR via maxContextLines; updates the hook’s options typing.
packages/diffs/src/components/UnresolvedFile.ts Custom hydration flow for SSR: prerender handling + node discovery + renderer/manager initialization + merge-conflict slot setup.
packages/diffs/src/components/FileDiff.ts Changes several internal helpers from private to protected to support subclass orchestration during hydration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@amadeus amadeus merged commit 8ee15e5 into main Mar 26, 2026
8 checks passed
@amadeus amadeus deleted the amadeus/merge-conflict-ssr-fix branch March 26, 2026 07:07
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