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
6 changes: 6 additions & 0 deletions .changeset/cuddly-dodos-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@react-router/dev": patch
"react-router": patch
---

Move RSCHydratedRouter and utils to `/dom` export.
4 changes: 2 additions & 2 deletions integration/helpers/rsc-parcel/src/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import type { unstable_RSCPayload as RSCPayload } from "react-router";
import {
unstable_createCallServer as createCallServer,
unstable_getRSCStream as getRSCStream,
unstable_RSCHydratedRouter as RSCHydratedRouter,
} from "react-router";
type unstable_RSCPayload as RSCPayload,
} from "react-router/dom";
import {
createFromReadableStream,
createTemporaryReferenceSet,
Expand Down
4 changes: 2 additions & 2 deletions integration/helpers/rsc-vite/src/entry.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
unstable_createCallServer as createCallServer,
unstable_getRSCStream as getRSCStream,
unstable_RSCHydratedRouter as RSCHydratedRouter,
} from "react-router";
import type { unstable_RSCPayload as RSCPayload } from "react-router";
type unstable_RSCPayload as RSCPayload,
} from "react-router/dom";
import { getContext } from "./config/get-context";

setServerCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
unstable_createCallServer as createCallServer,
unstable_getRSCStream as getRSCStream,
unstable_RSCHydratedRouter as RSCHydratedRouter,
} from "react-router";
import type { unstable_RSCPayload as RSCPayload } from "react-router";
type unstable_RSCPayload as RSCPayload,
} from "react-router/dom";

setServerCallback(
createCallServer({
Expand Down
16 changes: 16 additions & 0 deletions packages/react-router/dom-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@ export type { RouterProviderProps } from "./lib/dom-export/dom-router-provider";
export { RouterProvider } from "./lib/dom-export/dom-router-provider";
export type { HydratedRouterProps } from "./lib/dom-export/hydrated-router";
export { HydratedRouter } from "./lib/dom-export/hydrated-router";

// RSC
export {
createCallServer as unstable_createCallServer,
RSCHydratedRouter as unstable_RSCHydratedRouter,
} from "./lib/rsc/browser";
export { getRSCStream as unstable_getRSCStream } from "./lib/rsc/html-stream/browser";

export type {
DecodeActionFunction as unstable_DecodeActionFunction,
DecodeFormStateFunction as unstable_DecodeFormStateFunction,
DecodeReplyFunction as unstable_DecodeReplyFunction,
RSCManifestPayload as unstable_RSCManifestPayload,
RSCPayload as unstable_RSCPayload,
RSCRenderPayload as unstable_RSCRenderPayload,
} from "./lib/rsc/server.rsc";
5 changes: 0 additions & 5 deletions packages/react-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ export type {
EncodeReplyFunction as unstable_EncodeReplyFunction,
RSCHydratedRouterProps as unstable_RSCHydratedRouterProps,
} from "./lib/rsc/browser";
export {
createCallServer as unstable_createCallServer,
RSCHydratedRouter as unstable_RSCHydratedRouter,
} from "./lib/rsc/browser";
export type {
SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction,
RSCStaticRouterProps as unstable_RSCStaticRouterProps,
Expand All @@ -309,7 +305,6 @@ export {
routeRSCServerRequest as unstable_routeRSCServerRequest,
RSCStaticRouter as unstable_RSCStaticRouter,
} from "./lib/rsc/server.ssr";
export { getRSCStream as unstable_getRSCStream } from "./lib/rsc/html-stream/browser";
export { RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary } from "./lib/rsc/errorBoundaries";

// Re-export of RSC types
Expand Down
4 changes: 2 additions & 2 deletions playground/rsc-parcel/src/entry.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
unstable_createCallServer as createCallServer,
unstable_getRSCStream as getRSCStream,
unstable_RSCHydratedRouter as RSCHydratedRouter,
} from "react-router";
import type { unstable_RSCPayload as RSCPayload } from "react-router";
type unstable_RSCPayload as RSCPayload,
} from "react-router/dom";
import {
createFromReadableStream,
createTemporaryReferenceSet,
Expand Down
4 changes: 2 additions & 2 deletions playground/rsc-vite/src/entry.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
unstable_createCallServer as createCallServer,
unstable_getRSCStream as getRSCStream,
unstable_RSCHydratedRouter as RSCHydratedRouter,
} from "react-router";
import type { unstable_RSCPayload as RSCPayload } from "react-router";
type unstable_RSCPayload as RSCPayload,
} from "react-router/dom";

setServerCallback(
createCallServer({
Expand Down