fix: Fix Hydrate re-exports to avoid circular HMR updates#7492
Conversation
📝 WalkthroughWalkthroughThis PR restructures React and Solid Start packages to export ChangesHydrate Subpath Restructuring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit aff3daa
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview4 package(s) bumped directly, 0 bumped as dependents. 🟩 Patch bumps
|
Bundle Size Benchmarks
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.changeset/fair-llamas-hydrate.md (1)
8-8: ⚡ Quick winEnhance the changeset description for clarity.
The current description explains the technical solution but could be clearer about the motivation and user impact. Consider revising to include:
- The problem being solved: The PR title mentions "circular HMR updates" but this isn't reflected in the changeset
- User-facing impact: Whether users need to change their imports (especially for direct client package consumers)
- What changed: More explicitly state that
Hydrateis now exported from a dedicated subpath in client packages📝 Suggested description improvement
-Avoid pulling the client hydration entry into root `@tanstack/react-start` and `@tanstack/solid-start` imports by re-exporting `Hydrate` from framework client Hydrate-only subpaths. +Fix circular HMR updates by moving `Hydrate` exports to dedicated subpaths in client packages. + +`Hydrate` is now exported from `@tanstack/react-start-client/Hydrate` and `@tanstack/solid-start-client/Hydrate` instead of the main client barrels. The root packages (`@tanstack/react-start` and `@tanstack/solid-start`) continue to re-export `Hydrate` from these subpaths, so users importing from root packages are unaffected. + +**Note**: If you import `Hydrate` directly from `@tanstack/react-start-client` or `@tanstack/solid-start-client`, update your imports to use the `/Hydrate` subpath.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.changeset/fair-llamas-hydrate.md at line 8, Update the changeset text to clearly state the problem (circular HMR updates), the user-facing impact, and the specific API change: explain that to prevent circular HMR updates we moved Hydrate export out of the root bundles and now re-export Hydrate from dedicated client "Hydrate-only" subpaths in `@tanstack/react-start` and `@tanstack/solid-start`; state whether consumers of the client packages must update imports (e.g., import { Hydrate } from "`@tanstack/react-start/client-hydrate`" or similar) or if existing root-package imports remain compatible, and briefly note why this reduces bundle pull-in and HMR loops.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.changeset/fair-llamas-hydrate.md:
- Line 8: Update the changeset text to clearly state the problem (circular HMR
updates), the user-facing impact, and the specific API change: explain that to
prevent circular HMR updates we moved Hydrate export out of the root bundles and
now re-export Hydrate from dedicated client "Hydrate-only" subpaths in
`@tanstack/react-start` and `@tanstack/solid-start`; state whether consumers of the
client packages must update imports (e.g., import { Hydrate } from
"`@tanstack/react-start/client-hydrate`" or similar) or if existing root-package
imports remain compatible, and briefly note why this reduces bundle pull-in and
HMR loops.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 14958f33-92df-4f2b-86a5-f57ff2f49cd1
📒 Files selected for processing (8)
.changeset/fair-llamas-hydrate.mdpackages/react-start-client/package.jsonpackages/react-start-client/src/index.tsxpackages/react-start-client/vite.config.tspackages/react-start/src/index.tspackages/solid-start-client/package.jsonpackages/solid-start-client/src/index.tsxpackages/solid-start/src/index.ts
💤 Files with no reviewable changes (2)
- packages/react-start-client/src/index.tsx
- packages/solid-start-client/src/index.tsx
Merging this PR will not alter performance
Comparing Footnotes
|
Summary by CodeRabbit
Hydrateand related utilities are now available through dedicated subpath imports for more granular module loading