Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/fair-llamas-hydrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@tanstack/react-start': patch
'@tanstack/react-start-client': patch
'@tanstack/solid-start': patch
'@tanstack/solid-start-client': patch
---

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.
6 changes: 6 additions & 0 deletions packages/react-start-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
"default": "./dist/esm/hydration.js"
}
},
"./Hydrate": {
"import": {
"types": "./dist/esm/Hydrate.d.ts",
"default": "./dist/esm/Hydrate.js"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
Expand Down
14 changes: 0 additions & 14 deletions packages/react-start-client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,3 @@

export { StartClient } from './StartClient'
export { hydrateStart } from './hydrateStart'
export { Hydrate } from './Hydrate'
export type {
HydrateOptions,
HydrateProps,
HydrateWhen,
HydrationInteractionEvent,
HydrationInteractionEvents,
HydrationPrefetchContext,
HydrationPrefetchFunction,
HydrationPrefetchStrategy,
HydrationPrefetchWaitReason,
HydrationStrategy,
HydrationWhen,
} from './Hydrate'
2 changes: 1 addition & 1 deletion packages/react-start-client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default mergeConfig(
tanstackViteConfig({
tsconfigPath: './tsconfig.build.json',
srcDir: './src',
entry: ['./src/index.tsx', './src/hydration.ts'],
entry: ['./src/index.tsx', './src/Hydrate.tsx', './src/hydration.ts'],
cjs: false,
}),
)
11 changes: 9 additions & 2 deletions packages/react-start/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export {
createServerOnlyFn,
createStart,
} from '@tanstack/start-client-core'
export { Hydrate } from '@tanstack/react-start-client'

// Keep root `@tanstack/react-start` imports from evaluating the client barrel.
// The barrel also exports `hydrateStart`, which imports the virtual client
// entry. That virtual entry imports the user's router module, so route modules
// that import the root package can be pulled back into the same graph and
// create circular HMR updates. Re-exporting from the Hydrate-only subpath
// preserves the public API without introducing that import edge.
export { Hydrate } from '@tanstack/react-start-client/Hydrate'
export type {
HydrateOptions,
HydrateProps,
Expand All @@ -24,4 +31,4 @@ export type {
HydrationPrefetchStrategy,
HydrationStrategy,
HydrationWhen,
} from '@tanstack/react-start-client'
} from '@tanstack/react-start-client/Hydrate'
6 changes: 6 additions & 0 deletions packages/solid-start-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
"default": "./dist/esm/hydration.js"
}
},
"./Hydrate": {
"import": {
"types": "./dist/esm/Hydrate.d.ts",
"default": "./dist/esm/Hydrate.js"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
Expand Down
14 changes: 0 additions & 14 deletions packages/solid-start-client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
export { StartClient } from './StartClient'
export { hydrateStart } from './hydrateStart'
export { Hydrate } from './Hydrate'
export type {
HydrateOptions,
HydrateProps,
HydrateWhen,
HydrationInteractionEvent,
HydrationInteractionEvents,
HydrationPrefetchContext,
HydrationPrefetchFunction,
HydrationPrefetchStrategy,
HydrationPrefetchWaitReason,
HydrationStrategy,
HydrationWhen,
} from './Hydrate'
11 changes: 9 additions & 2 deletions packages/solid-start/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export {
createServerOnlyFn,
createStart,
} from '@tanstack/start-client-core'
export { Hydrate } from '@tanstack/solid-start-client'

// Keep root `@tanstack/solid-start` imports from evaluating the client barrel.
// The barrel also exports `hydrateStart`, which imports the virtual client
// entry. That virtual entry imports the user's router module, so route modules
// that import the root package can be pulled back into the same graph and
// create circular HMR updates. Re-exporting from the Hydrate-only subpath
// preserves the public API without introducing that import edge.
export { Hydrate } from '@tanstack/solid-start-client/Hydrate'
export type {
HydrateOptions,
HydrateProps,
Expand All @@ -24,4 +31,4 @@ export type {
HydrationPrefetchStrategy,
HydrationStrategy,
HydrationWhen,
} from '@tanstack/solid-start-client'
} from '@tanstack/solid-start-client/Hydrate'
Loading