Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(unhead): delay patching until hydration is complete#634

Merged
harlan-zw merged 1 commit into
v3from
fix/race-time-condition
Jan 6, 2026
Merged

fix(unhead): delay patching until hydration is complete#634
harlan-zw merged 1 commit into
v3from
fix/race-time-condition

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes nuxt/nuxt#26272

The issue relates to patches called before the first render (e.g., in Vue's onMounted) so the initial SSR is lost, meaning we can't track side effects.

Fixes issue where patches called before first render (e.g., in Vue's onMounted)
were lost due to timing between patch and render.

Changes:
- Replace `_dirty` flag with cache invalidation via `delete entry._tags`
- Defer client-side patches using `_pending` until next render cycle
- Track `_originalInput` for SSR class side-effect pre-registration
- Add streaming client parity for hydration tracking

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@harlan-zw harlan-zw changed the base branch from main to v3 January 6, 2026 01:45
@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Bundle Size Gzipped
Client (Minimal) 11.2 kB → 10.8 kB 🟢 0.5 kB 4.7 kB → 4.4 kB 🟢 0.3 kB
Server (Minimal) 10.1 kB → 10 kB 🟢 0.1 kB 4.2 kB → 4.1 kB 🟢 0.1 kB
Vue Client (Minimal) 12.3 kB → 11.8 kB 🟢 0.5 kB 5.1 kB → 4.8 kB 🟢 0.3 kB
Vue Server (Minimal) 11 kB → 10.9 kB 🟢 0.1 kB 4.5 kB → 4.5 kB 🟢 0.1 kB

@harlan-zw harlan-zw changed the title fix: hydration race condition with deferred patches fix(unhead): hydration race condition with deferred patches Jan 6, 2026
@harlan-zw harlan-zw changed the title fix(unhead): hydration race condition with deferred patches fix(unhead): delay patching until hydration is complete Jan 6, 2026
@harlan-zw harlan-zw merged commit 3a36e77 into v3 Jan 6, 2026
5 checks passed
@harlan-zw harlan-zw mentioned this pull request Jan 6, 2026
@harlan-zw harlan-zw mentioned this pull request Apr 4, 2026
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