Skip to content

Commit

Permalink
chore(deps): react 19 stable (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 10, 2024
1 parent 3cbed11 commit f8624d7
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 71 deletions.
2 changes: 1 addition & 1 deletion examples/child-process/src/entry-ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async function handler(request: Request): Promise<Response> {
const rscPromise = ReactClient.createFromReadableStream<StreamData>(
rscStream1,
{
ssrManifest: {},
serverConsumerManifest: {},
},
);

Expand Down
2 changes: 1 addition & 1 deletion examples/child-process/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["vite/client", "react/experimental", "@types/bun"],
"types": ["vite/client", "@types/bun"],
"jsx": "react-jsx"
}
}
2 changes: 1 addition & 1 deletion examples/react-server/src/entry-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function main() {
ReactDOMClient.createRoot(document).render(reactRootEl);
} else {
// TODO: can we avoid await? (separate script stream?)
const formState = (await initialStreamData).actionResult;
const formState = (await initialStreamData).actionResult as any;
React.startTransition(() => {
ReactDOMClient.hydrateRoot(document, reactRootEl, {
formState,
Expand Down
3 changes: 1 addition & 2 deletions examples/react-server/src/entry-ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ async function renderHtml(request: Request, result: ReactServerHandlerResult) {
const rscPromise = ReactClient.createFromReadableStream<StreamData>(
rscStream1,
{
ssrManifest: {
serverConsumerManifest: {
moduleMap: createModuleMap(),
moduleLoading: null,
},
},
);
Expand Down
6 changes: 3 additions & 3 deletions examples/react-server/src/features/router/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export function Link({
activeProps,
pendingProps,
...props
}: JSX.IntrinsicElements["a"] & {
activeProps?: JSX.IntrinsicElements["a"];
pendingProps?: JSX.IntrinsicElements["a"];
}: React.JSX.IntrinsicElements["a"] & {
activeProps?: React.JSX.IntrinsicElements["a"];
pendingProps?: React.JSX.IntrinsicElements["a"];
}) {
const { isPending, pathname } = useRouter();

Expand Down
5 changes: 3 additions & 2 deletions examples/react-server/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ export type ModuleMap = {
};
};

export interface SsrManifest {
export interface ServerConsumerManifest {
moduleMap: ModuleMap;
// TODO
moduleLoading: null;
serverModuleMap?: unknown;
moduleLoading?: unknown;
}

export type WebpackRequire = (id: string) => Promise<unknown>;
Expand Down
4 changes: 2 additions & 2 deletions examples/react-server/src/types/react-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare module "react-server-dom-webpack/server.edge" {
actionResult: unknown,
body: FormData,
serverManifest?: unknown,
): Promise<unknown>;
): Promise<import("react-dom/client").ReactFormState | null>;
}

// https://github.com/facebook/react/blob/89021fb4ec9aa82194b0788566e736a4cedfc0e4/packages/react-server-dom-webpack/src/ReactFlightDOMClientEdge.js
Expand All @@ -48,7 +48,7 @@ declare module "react-server-dom-webpack/client.edge" {
export function createFromReadableStream<T>(
stream: ReadableStream<Uint8Array>,
options: {
ssrManifest: import(".").SsrManifest;
serverConsumerManifest: import(".").ServerConsumerManifest;
},
): Promise<T>;
}
Expand Down
10 changes: 0 additions & 10 deletions examples/react-server/src/types/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,3 @@ declare module "react-dom/server" {
formState: unknown;
}
}

declare module "react-dom/client" {
interface HydrationOptions {
formState: unknown;
}

interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS {
Document: Document;
}
}
2 changes: 1 addition & 1 deletion examples/react-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["vite/client", "react/experimental"],
"types": ["vite/client"],
"jsx": "react-jsx"
}
}
2 changes: 1 addition & 1 deletion examples/web-worker-rsc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["vite/client", "react/experimental"],
"types": ["vite/client"],
"jsx": "react-jsx"
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"@playwright/test": "^1.45.2",
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^20.14.11",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.1",
"esbuild": "^0.23.0",
"magic-string": "^0.30.10",
"miniflare": "^3.20240925.0",
"react": "19.0.0-rc-eb3ad065-20240822",
"react-dom": "19.0.0-rc-eb3ad065-20240822",
"react-server-dom-webpack": "19.0.0-rc-eb3ad065-20240822",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-server-dom-webpack": "^19.0.0",
"tsup": "^8.1.2",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
Expand Down
80 changes: 38 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8624d7

Please sign in to comment.