Skip to content

Commit dea842d

Browse files
authored
fix: move RSCHydratedRouter and utils to /dom export (#14457)
1 parent 1d1b188 commit dea842d

File tree

8 files changed

+32
-15
lines changed

8 files changed

+32
-15
lines changed

.changeset/cuddly-dodos-report.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@react-router/dev": patch
3+
"react-router": patch
4+
---
5+
6+
Move RSCHydratedRouter and utils to `/dom` export.

integration/helpers/rsc-parcel/src/browser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import { startTransition, StrictMode } from "react";
44
import { hydrateRoot } from "react-dom/client";
5-
import type { unstable_RSCPayload as RSCPayload } from "react-router";
65
import {
76
unstable_createCallServer as createCallServer,
87
unstable_getRSCStream as getRSCStream,
98
unstable_RSCHydratedRouter as RSCHydratedRouter,
10-
} from "react-router";
9+
type unstable_RSCPayload as RSCPayload,
10+
} from "react-router/dom";
1111
import {
1212
createFromReadableStream,
1313
createTemporaryReferenceSet,

integration/helpers/rsc-vite/src/entry.browser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
unstable_createCallServer as createCallServer,
1111
unstable_getRSCStream as getRSCStream,
1212
unstable_RSCHydratedRouter as RSCHydratedRouter,
13-
} from "react-router";
14-
import type { unstable_RSCPayload as RSCPayload } from "react-router";
13+
type unstable_RSCPayload as RSCPayload,
14+
} from "react-router/dom";
1515
import { getContext } from "./config/get-context";
1616

1717
setServerCallback(

packages/react-router-dev/config/default-rsc-entries/entry.client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
unstable_createCallServer as createCallServer,
1313
unstable_getRSCStream as getRSCStream,
1414
unstable_RSCHydratedRouter as RSCHydratedRouter,
15-
} from "react-router";
16-
import type { unstable_RSCPayload as RSCPayload } from "react-router";
15+
type unstable_RSCPayload as RSCPayload,
16+
} from "react-router/dom";
1717

1818
setServerCallback(
1919
createCallServer({

packages/react-router/dom-export.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,19 @@ export type { RouterProviderProps } from "./lib/dom-export/dom-router-provider";
88
export { RouterProvider } from "./lib/dom-export/dom-router-provider";
99
export type { HydratedRouterProps } from "./lib/dom-export/hydrated-router";
1010
export { HydratedRouter } from "./lib/dom-export/hydrated-router";
11+
12+
// RSC
13+
export {
14+
createCallServer as unstable_createCallServer,
15+
RSCHydratedRouter as unstable_RSCHydratedRouter,
16+
} from "./lib/rsc/browser";
17+
export { getRSCStream as unstable_getRSCStream } from "./lib/rsc/html-stream/browser";
18+
19+
export type {
20+
DecodeActionFunction as unstable_DecodeActionFunction,
21+
DecodeFormStateFunction as unstable_DecodeFormStateFunction,
22+
DecodeReplyFunction as unstable_DecodeReplyFunction,
23+
RSCManifestPayload as unstable_RSCManifestPayload,
24+
RSCPayload as unstable_RSCPayload,
25+
RSCRenderPayload as unstable_RSCRenderPayload,
26+
} from "./lib/rsc/server.rsc";

packages/react-router/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,6 @@ export type {
297297
EncodeReplyFunction as unstable_EncodeReplyFunction,
298298
RSCHydratedRouterProps as unstable_RSCHydratedRouterProps,
299299
} from "./lib/rsc/browser";
300-
export {
301-
createCallServer as unstable_createCallServer,
302-
RSCHydratedRouter as unstable_RSCHydratedRouter,
303-
} from "./lib/rsc/browser";
304300
export type {
305301
SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction,
306302
RSCStaticRouterProps as unstable_RSCStaticRouterProps,
@@ -309,7 +305,6 @@ export {
309305
routeRSCServerRequest as unstable_routeRSCServerRequest,
310306
RSCStaticRouter as unstable_RSCStaticRouter,
311307
} from "./lib/rsc/server.ssr";
312-
export { getRSCStream as unstable_getRSCStream } from "./lib/rsc/html-stream/browser";
313308
export { RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary } from "./lib/rsc/errorBoundaries";
314309

315310
// Re-export of RSC types

playground/rsc-parcel/src/entry.browser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
unstable_createCallServer as createCallServer,
77
unstable_getRSCStream as getRSCStream,
88
unstable_RSCHydratedRouter as RSCHydratedRouter,
9-
} from "react-router";
10-
import type { unstable_RSCPayload as RSCPayload } from "react-router";
9+
type unstable_RSCPayload as RSCPayload,
10+
} from "react-router/dom";
1111
import {
1212
createFromReadableStream,
1313
createTemporaryReferenceSet,

playground/rsc-vite/src/entry.browser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
unstable_createCallServer as createCallServer,
1111
unstable_getRSCStream as getRSCStream,
1212
unstable_RSCHydratedRouter as RSCHydratedRouter,
13-
} from "react-router";
14-
import type { unstable_RSCPayload as RSCPayload } from "react-router";
13+
type unstable_RSCPayload as RSCPayload,
14+
} from "react-router/dom";
1515

1616
setServerCallback(
1717
createCallServer({

0 commit comments

Comments
 (0)