rwsdk 1.0.0-alpha.17 → 1.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,7 @@
1
1
  export declare const renderToRscStream: ({ input, onError, }: {
2
- input: any;
2
+ input: {
3
+ node: React.ReactNode;
4
+ actionResult: unknown;
5
+ };
3
6
  onError?: (error: unknown) => void;
4
7
  }) => ReadableStream;
@@ -1,7 +1,17 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { renderToReadableStream as baseRenderToRscStream } from "react-server-dom-webpack/server.edge";
2
3
  import { createClientManifest } from "./createClientManifest.js";
3
4
  export const renderToRscStream = ({ input, onError, }) => {
4
- return baseRenderToRscStream(input, createClientManifest(), {
5
+ const { node: inputNode, actionResult } = input;
6
+ // context(justinvdm, 2025-09-26): We add a marker here for our stitching logic in
7
+ // renderDocumentHtmlStream() to find and use. It needs to live here rather than there,
8
+ // since it needs to live in the RSC payload for hydration to work.
9
+ const wrappedNode = (_jsxs(_Fragment, { children: [inputNode, _jsx("div", { id: "rwsdk-app-end" })] }));
10
+ const wrappedInput = {
11
+ node: wrappedNode,
12
+ actionResult,
13
+ };
14
+ return baseRenderToRscStream(wrappedInput, createClientManifest(), {
5
15
  onError,
6
16
  });
7
17
  };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { renderDocumentHtmlStream } from "./render/renderDocumentHtmlStream";
3
3
  import { normalizeActionResult } from "./render/normalizeActionResult";
4
4
  import { renderToRscStream } from "./render/renderToRscStream";
@@ -68,7 +68,6 @@ export const defineApp = (routes) => {
68
68
  else {
69
69
  pageElement = _jsx(Page, { ...requestInfo });
70
70
  }
71
- pageElement = (_jsxs(_Fragment, { children: [pageElement, _jsx("div", { id: "rwsdk-app-end" })] }));
72
71
  return pageElement;
73
72
  };
74
73
  const renderPage = async (requestInfo, Page, onError) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "1.0.0-alpha.17",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {