Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

index.ts

34 lines1.4 KB

1export { useServerFn } from './useServerFn'
2export * from '@tanstack/start-client-core'
3// Explicit re-exports shadow `export *` above so these public-API names are
4// registered on the namespace at link time (via Vite SSR's `defineExport`
5// at fileStartIndex), surviving the cold-start SSR cycle through user
6// middleware. See vitejs/vite#22491 / #22493. Trim list to genuine public
7// API only; internals fall through `export *` and are safe because they
8// aren't imported at top level in the cycle path.
9export {
10 createClientOnlyFn,
11 createCsrfMiddleware,
12 createIsomorphicFn,
13 createMiddleware,
14 createServerFn,
15 createServerOnlyFn,
16 createStart,
17} from '@tanstack/start-client-core'
18​
19// Keep root `@tanstack/react-start` imports from evaluating the client barrel.
20// The barrel also exports `hydrateStart`, which imports the virtual client
21// entry. That virtual entry imports the user's router module, so route modules
22// that import the root package can be pulled back into the same graph and
23// create circular HMR updates. Re-exporting from the Hydrate-only subpath
24// preserves the public API without introducing that import edge.
25export { Hydrate } from '@tanstack/react-start-client/Hydrate'
26export type {
27 HydrateOptions,
28 HydrateProps,
29 HydrationInteractionEvent,
30 HydrationInteractionEvents,
31 HydrationPrefetchStrategy,
32 HydrationStrategy,
33 HydrationWhen,
34} from '@tanstack/react-start-client/Hydrate'