Skip to content

feat: hydration issues across tabs and reloads#149

Merged
huang-julien merged 15 commits into
mainfrom
feat/hydration_across_reload
Dec 16, 2025
Merged

feat: hydration issues across tabs and reloads#149
huang-julien merged 15 commits into
mainfrom
feat/hydration_across_reload

Conversation

@huang-julien

@huang-julien huang-julien commented Nov 23, 2025

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #124

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR adds hydration issues across tabs and reloads using a nitro handler + sse to synchronize multiple devtools if there is.

image

@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/hints/@nuxt/hints@149

commit: 06697c2

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR implements real-time synchronization of hydration mismatch detection across multiple browser tabs and page reloads using Server-Sent Events (SSE) and Nitro handlers. The feature allows developers to track and debug hydration issues that occur in their Nuxt applications across different instances.

Key Changes:

  • Introduced a Nitro-based backend with HTTP POST/GET endpoints and SSE streaming to collect and broadcast hydration mismatches
  • Refactored hydration tracking to separate local and remote mismatches with proper Typeing
  • Added real-time synchronization via EventSource to update devtools across multiple tabs

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/runtime/types.d.ts Updated type definitions to use new LocalHydrationMismatch type and added Nitro runtime hooks
src/runtime/hydration/types.ts Defined new interfaces for hydration mismatch payloads and responses
src/runtime/hydration/utils.ts Extracted shared utility constants and HTML formatting function
src/runtime/hydration/sse.nitro.ts Implemented SSE endpoint for real-time hydration mismatch broadcasting
src/runtime/hydration/handler.nitro.ts Created HTTP handler for storing and retrieving hydration mismatches
src/runtime/hydration/composables.ts Updated composable to POST mismatches to the server and refactored to use shared utilities
src/module.ts Registered new server handlers and enabled experimental WebSocket support
client/app/plugins/hydration.ts Added plugin to fetch and listen for hydration mismatches via REST and SSE
client/app/pages/index.vue Updated to use new hydration mismatches reactive ref
client/app/pages/hydration.vue Updated to use new hydration mismatches reactive ref
client/app/composables/host.ts Exported useHostNuxt function for use in the new plugin
client/app/components/HydrationIssue.vue Refactored to support both local and remote hydration mismatches with generic typing
package.json Added self-reference workspace dependency
pnpm-lock.yaml Updated lockfile with workspace dependency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Comment thread src/runtime/hydration/handler.nitro.ts Outdated
Comment thread src/runtime/hydration/handler.nitro.ts
Comment thread client/app/plugins/hydration.ts
Comment thread client/app/plugins/hydration.ts Outdated
Comment thread client/app/plugins/hydration.ts
Comment thread src/runtime/hydration/composables.ts
Comment thread client/app/plugins/hydration.ts
Comment thread src/runtime/hydration/handler.nitro.ts
Comment thread src/runtime/hydration/handler.nitro.ts Outdated
Comment thread src/runtime/hydration/handler.nitro.ts Outdated
@huang-julien
huang-julien marked this pull request as ready for review November 28, 2025 22:23
@huang-julien
huang-julien merged commit 6c1ca4b into main Dec 16, 2025
6 checks passed
@huang-julien
huang-julien deleted the feat/hydration_across_reload branch December 16, 2025 08:37
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.

save hydration mismatches across reloads

2 participants