@vitejs/plugin-rsc 0.5.34 → 0.5.36
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.
- package/README.md +15 -0
- package/dist/browser.d.ts +1 -1
- package/dist/{cjs-AWVWfddx.js → cjs-DhDj_zQT.js} +2 -2
- package/dist/client-Dq3oGLRS.d.ts +8 -0
- package/dist/{client-reference-DEZtXTv1.d.ts → client-reference-Bk5pzNGN.d.ts} +1 -1
- package/dist/client.node-BEQT2PT-.d.ts +9 -0
- package/dist/client.shared-D1HxyClg.js +10 -0
- package/dist/client.shared-VT232QCM.d.ts +16 -0
- package/dist/core/browser.js +1 -1
- package/dist/core/plugin.d.ts +2 -3
- package/dist/core/rsc.d.ts +1 -1
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +1 -7
- package/dist/core/ssr.js +1 -1
- package/dist/{index-C5IY2S-e.d.ts → index-CROaL0MT.d.ts} +34 -8
- package/dist/index.js +1 -1
- package/dist/{picocolors-391UXIDd.js → picocolors-DibqjEBF.js} +1 -1
- package/dist/{plugin-Cbs9j6lP.js → plugin-Bqv0ikDW.js} +55 -37
- package/dist/plugin.js +1 -1
- package/dist/plugins/cjs.d.ts +2 -3
- package/dist/plugins/cjs.js +1 -1
- package/dist/react/browser.d.ts +10 -10
- package/dist/react/rsc/client.d.ts +1 -1
- package/dist/react/rsc/client.js +2 -5
- package/dist/react/rsc/client.node.d.ts +2 -0
- package/dist/react/rsc/client.node.js +16 -0
- package/dist/react/rsc/server.d.ts +2 -2
- package/dist/react/rsc/server.node.d.ts +3 -0
- package/dist/react/rsc/server.node.js +24 -0
- package/dist/react/rsc/static.d.ts +4 -5
- package/dist/react/rsc/static.node.d.ts +6 -0
- package/dist/react/rsc/static.node.js +11 -0
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/ssr.d.ts +9 -9
- package/dist/react/ssr.node.d.ts +12 -0
- package/dist/react/ssr.node.js +21 -0
- package/dist/rsc/client.d.ts +1 -1
- package/dist/rsc/client.node.d.ts +2 -0
- package/dist/rsc/client.node.js +3 -0
- package/dist/rsc/server.d.ts +5 -5
- package/dist/rsc/server.node.d.ts +19 -0
- package/dist/rsc/server.node.js +13 -0
- package/dist/rsc/static.d.ts +4 -5
- package/dist/rsc/static.node.d.ts +16 -0
- package/dist/rsc/static.node.js +12 -0
- package/dist/{rsc-C3UdJLOW.d.ts → rsc-D8UlANI2.d.ts} +1 -1
- package/dist/rsc.d.ts +3 -3
- package/dist/rsc.node.d.ts +6 -0
- package/dist/rsc.node.js +7 -0
- package/dist/{scope-Bdx33sQv.js → scope-Ck0n25my.js} +2 -4
- package/dist/{server-ZBjqNTqU.d.ts → server-YwgjVtsE.d.ts} +2 -2
- package/dist/server.node-DU77AeKU.d.ts +15 -0
- package/dist/shared-BWJvctW6.js +34 -0
- package/dist/shared-DH8gaClP.js +90 -0
- package/dist/shared-DJBuYpZL.d.ts +20 -0
- package/dist/ssr-C-U7jY5S.d.ts +8 -0
- package/dist/ssr.d.ts +3 -21
- package/dist/ssr.js +1 -87
- package/dist/ssr.node.d.ts +5 -0
- package/dist/ssr.node.js +4 -0
- package/dist/transforms/index.js +67 -60
- package/dist/utils/encryption-runtime.d.ts +3 -4
- package/dist/utils/encryption-runtime.js +4 -2
- package/dist/utils/rpc.d.ts +3 -4
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +909 -495
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +399 -265
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +901 -477
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +380 -219
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +925 -484
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +385 -221
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +726 -388
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +566 -397
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +734 -397
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +477 -238
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +1029 -620
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +481 -261
- package/dist/vendor/react-server-dom/esm/react-server-dom-webpack-node-loader.production.js +2 -2
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/package.json +16 -16
- package/dist/client-Bhch3O41.d.ts +0 -19
- package/dist/dist-uqdtSkzK.js +0 -64
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ npm create vite@latest -- --template rsc
|
|
|
33
33
|
- [`./examples/ssg`](./examples/ssg) - Static site generation with MDX and client components for interactivity.
|
|
34
34
|
- [`./examples/ppr`](./examples/ppr) - Partial prerendering with a reusable static HTML shell and request-time RSC content.
|
|
35
35
|
- [`./examples/no-ssr`](./examples/no-ssr) - RSC application without an SSR environment.
|
|
36
|
+
- [`./examples/node-stream`](./examples/node-stream) - Starter application served end to end through Node.js request, response, and stream APIs.
|
|
36
37
|
- [`./examples/client-first`](./examples/client-first) - Experimental client-owned page that consumes RSC function results.
|
|
37
38
|
- [`./examples/action-reachability`](./examples/action-reachability) - Route-aware dispatch for a retained server action.
|
|
38
39
|
- [`./examples/browser-mode`](./examples/browser-mode) - Advanced setup that runs both RSC and React client environments in the browser with custom module loading.
|
|
@@ -524,6 +525,20 @@ This module provides Vite-integrated RSC runtime APIs based on
|
|
|
524
525
|
- `encodeReply`: Serializes server function arguments
|
|
525
526
|
- `createTemporaryReferenceSet`: Creates a temporary reference set shared by deserialization and reply serialization
|
|
526
527
|
|
|
528
|
+
### Node.js stream APIs variants
|
|
529
|
+
|
|
530
|
+
Node.js environments can use runtime-specific entry points that integrate React's native Node.js stream APIs with Vite's generated manifests:
|
|
531
|
+
|
|
532
|
+
| Environment | Entry point | Node.js stream API |
|
|
533
|
+
| ------------ | ------------------------------------ | ------------------------ |
|
|
534
|
+
| RSC server | `@vitejs/plugin-rsc/rsc/server.node` | `renderToPipeableStream` |
|
|
535
|
+
| RSC client | `@vitejs/plugin-rsc/rsc/client.node` | `createFromNodeStream` |
|
|
536
|
+
| RSC static | `@vitejs/plugin-rsc/rsc/static.node` | `prerenderToNodeStream` |
|
|
537
|
+
| RSC combined | `@vitejs/plugin-rsc/rsc.node` | Server and client APIs |
|
|
538
|
+
| SSR | `@vitejs/plugin-rsc/ssr.node` | `createFromNodeStream` |
|
|
539
|
+
|
|
540
|
+
See [`examples/node-stream`](./examples/node-stream) for an end-to-end Node.js handler using these APIs.
|
|
541
|
+
|
|
527
542
|
### `@vitejs/plugin-rsc/browser`
|
|
528
543
|
|
|
529
544
|
This module provides Vite-integrated RSC runtime APIs based on
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CallServerCallback } from "./index-
|
|
1
|
+
import { n as CallServerCallback } from "./index-CROaL0MT.js";
|
|
2
2
|
import { t as setRequireModule } from "./browser-DI_Wyg5Y.js";
|
|
3
3
|
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
|
|
4
4
|
export { type CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as buildScopeTree } from "./scope-Bdx33sQv.js";
|
|
1
|
+
import { t as buildScopeTree } from "./scope-Ck0n25my.js";
|
|
3
2
|
import { n as parseIdQuery } from "./shared-B6H2TbnP.js";
|
|
4
3
|
import fs from "node:fs";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
6
|
import * as esModuleLexer from "es-module-lexer";
|
|
8
7
|
import MagicString from "magic-string";
|
|
8
|
+
import { createDebug } from "obug";
|
|
9
9
|
import { parseAstAsync } from "vite";
|
|
10
10
|
import { findClosestPkgJsonPath } from "vitefu";
|
|
11
11
|
import { walk } from "estree-walker";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { o as CreateFromReadableStreamEdgeOptions, r as ClientTemporaryReferenceSet, u as EncodeReplyFunction } from "./index-CROaL0MT.js";
|
|
2
|
+
import { t as CreateFromStreamExtraOptions } from "./client.shared-VT232QCM.js";
|
|
3
|
+
//#region src/react/rsc/client.d.ts
|
|
4
|
+
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamEdgeOptions, extraOptions?: CreateFromStreamExtraOptions): Promise<T>;
|
|
5
|
+
declare const encodeReply: EncodeReplyFunction;
|
|
6
|
+
declare const createClientTemporaryReferenceSet: () => ClientTemporaryReferenceSet;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { createFromReadableStream as n, encodeReply as r, createClientTemporaryReferenceSet as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ClientReferenceMetadata } from "./rsc-
|
|
1
|
+
import { t as ClientReferenceMetadata } from "./rsc-D8UlANI2.js";
|
|
2
2
|
import { i as ResolvedAssetDeps } from "./plugin-CKqXjp8D.js";
|
|
3
3
|
//#region src/rsc/client-reference.d.ts
|
|
4
4
|
type OnClientReference = (metadata: ClientReferenceMetadata & {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i as CreateFromNodeStreamOptions, o as CreateFromReadableStreamEdgeOptions, r as ClientTemporaryReferenceSet, u as EncodeReplyFunction } from "./index-CROaL0MT.js";
|
|
2
|
+
import { t as CreateFromStreamExtraOptions } from "./client.shared-VT232QCM.js";
|
|
3
|
+
//#region src/react/rsc/client.node.d.ts
|
|
4
|
+
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamEdgeOptions, extraOptions?: CreateFromStreamExtraOptions): Promise<T>;
|
|
5
|
+
declare function createFromNodeStream<T>(stream: import("node:stream").Readable, options?: CreateFromNodeStreamOptions, extraOptions?: CreateFromStreamExtraOptions): Promise<T>;
|
|
6
|
+
declare const encodeReply: EncodeReplyFunction;
|
|
7
|
+
declare const createClientTemporaryReferenceSet: () => ClientTemporaryReferenceSet;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { encodeReply as i, createFromNodeStream as n, createFromReadableStream as r, createClientTemporaryReferenceSet as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createServerDecodeClientManifest, createServerManifest } from "./core/rsc.js";
|
|
2
|
+
//#region src/react/rsc/client.shared.ts
|
|
3
|
+
function createServerConsumerManifest(options) {
|
|
4
|
+
return {
|
|
5
|
+
serverModuleMap: createServerManifest({ preserveServerReferences: options?.preserveServerReferences }),
|
|
6
|
+
moduleMap: createServerDecodeClientManifest()
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createServerConsumerManifest as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/react/rsc/client.shared.d.ts
|
|
2
|
+
type CreateFromStreamExtraOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Preserve server references for re-serialization without loading their modules.
|
|
5
|
+
* Preserved references cannot be invoked in the current RSC environment.
|
|
6
|
+
*
|
|
7
|
+
* Disabled by default because this API also decodes bound server action
|
|
8
|
+
* arguments, which must revive references as callable implementations.
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
preserveServerReferences?: boolean;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CreateFromStreamExtraOptions as t };
|
package/dist/core/browser.js
CHANGED
package/dist/core/plugin.d.ts
CHANGED
package/dist/core/rsc.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createServerManifest, i as createServerDecodeClientManifest, n as CreateClientManifestOptions, o as loadServerAction, r as createClientManifest, s as setRequireModule, t as ClientReferenceMetadata } from "../rsc-
|
|
1
|
+
import { a as createServerManifest, i as createServerDecodeClientManifest, n as CreateClientManifestOptions, o as loadServerAction, r as createClientManifest, s as setRequireModule, t as ClientReferenceMetadata } from "../rsc-D8UlANI2.js";
|
|
2
2
|
export { ClientReferenceMetadata, CreateClientManifestOptions, createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/rsc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as tinyassert, t as memoize } from "../shared-BWJvctW6.js";
|
|
2
2
|
import { a as removeReferenceCacheTag, i as createReferenceCacheTag, n as SERVER_REFERENCE_PREFIX, o as setInternalRequire, r as SERVER_REFERENCE_PRESERVE_PREFIX, t as SERVER_DECODE_CLIENT_PREFIX } from "../shared-Y4B6DJ99.js";
|
|
3
3
|
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
4
4
|
//#region src/core/rsc.ts
|
package/dist/core/ssr.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/core/ssr.d.ts
|
|
3
|
-
declare function setRequireModule(options: {
|
|
4
|
-
load: (id: string) => unknown;
|
|
5
|
-
}): void;
|
|
6
|
-
declare function createServerConsumerManifest(): ServerConsumerManifest;
|
|
7
|
-
//#endregion
|
|
1
|
+
import { n as setRequireModule, t as createServerConsumerManifest } from "../ssr-C-U7jY5S.js";
|
|
8
2
|
export { createServerConsumerManifest, setRequireModule };
|
package/dist/core/ssr.js
CHANGED
|
@@ -22,40 +22,61 @@ interface ServerConsumerManifest {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
type CallServerCallback = (id: string, args: unknown[]) => Promise<unknown>;
|
|
25
|
-
interface
|
|
26
|
-
debugChannel?: DebugChannel;
|
|
25
|
+
interface RenderStreamOptions {
|
|
27
26
|
environmentName?: string | (() => string);
|
|
28
27
|
filterStackFrame?: (url: string, functionName: string) => boolean;
|
|
29
28
|
identifierPrefix?: string;
|
|
30
|
-
signal?: AbortSignal;
|
|
31
29
|
startTime?: number;
|
|
32
30
|
temporaryReferences?: ServerTemporaryReferenceSet;
|
|
33
31
|
onError?: (error: unknown) => void;
|
|
34
32
|
onPostpone?: (reason: string) => void;
|
|
35
33
|
}
|
|
34
|
+
interface RenderToReadableStreamOptions extends RenderStreamOptions {
|
|
35
|
+
debugChannel?: WebDebugChannel;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}
|
|
38
|
+
interface RenderToPipeableStreamOptions extends RenderStreamOptions {
|
|
39
|
+
debugChannel?: import("node:stream").Readable | import("node:stream").Writable;
|
|
40
|
+
}
|
|
41
|
+
interface PrerenderOptions extends RenderStreamOptions {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}
|
|
44
|
+
type PrerenderToNodeStreamOptions = PrerenderOptions;
|
|
36
45
|
interface PrerenderResult {
|
|
37
46
|
prelude: ReadableStream<Uint8Array>;
|
|
38
47
|
}
|
|
48
|
+
interface PrerenderToNodeStreamResult {
|
|
49
|
+
prelude: import("node:stream").Readable;
|
|
50
|
+
}
|
|
39
51
|
interface CreateFromReadableStreamBrowserOptions {
|
|
40
52
|
callServer?: CallServerCallback;
|
|
41
|
-
debugChannel?:
|
|
53
|
+
debugChannel?: WebDebugChannel;
|
|
42
54
|
encodeFormAction?: EncodeFormActionCallback;
|
|
43
55
|
endTime?: number;
|
|
44
56
|
environmentName?: string;
|
|
45
57
|
replayConsoleLogs?: boolean;
|
|
46
58
|
startTime?: number;
|
|
47
59
|
temporaryReferences?: ClientTemporaryReferenceSet;
|
|
60
|
+
unstable_allowPartialStream?: boolean;
|
|
48
61
|
}
|
|
49
|
-
interface
|
|
50
|
-
debugChannel?: DebugChannel;
|
|
62
|
+
interface CreateFromStreamOptions {
|
|
51
63
|
encodeFormAction?: EncodeFormActionCallback;
|
|
52
64
|
endTime?: number;
|
|
53
65
|
environmentName?: string;
|
|
54
66
|
nonce?: string;
|
|
55
67
|
replayConsoleLogs?: boolean;
|
|
56
68
|
startTime?: number;
|
|
69
|
+
unstable_allowPartialStream?: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface CreateFromReadableStreamEdgeOptions extends CreateFromStreamOptions {
|
|
72
|
+
debugChannel?: {
|
|
73
|
+
readable?: ReadableStream<Uint8Array>;
|
|
74
|
+
};
|
|
57
75
|
temporaryReferences?: ClientTemporaryReferenceSet;
|
|
58
76
|
}
|
|
77
|
+
interface CreateFromNodeStreamOptions extends CreateFromStreamOptions {
|
|
78
|
+
debugChannel?: import("node:stream").Readable;
|
|
79
|
+
}
|
|
59
80
|
interface DecodeReplyOptions {
|
|
60
81
|
temporaryReferences?: ServerTemporaryReferenceSet;
|
|
61
82
|
arraySizeLimit?: number;
|
|
@@ -75,11 +96,16 @@ type ReactCustomFormAction = {
|
|
|
75
96
|
};
|
|
76
97
|
type EncodeReplyFunction = (value: unknown[], options?: EncodeReplyOptions) => Promise<string | FormData>;
|
|
77
98
|
type DecodeReplyFunction = (body: string | FormData, options?: DecodeReplyOptions) => Promise<unknown[]>;
|
|
78
|
-
type
|
|
99
|
+
type DecodeReplyFromBusboyFunction = (body: import("node:stream").Writable, options?: DecodeReplyOptions) => Promise<unknown[]>;
|
|
100
|
+
interface PipeableStream {
|
|
101
|
+
abort(reason?: unknown): void;
|
|
102
|
+
pipe<T extends NodeJS.WritableStream>(destination: T): T;
|
|
103
|
+
}
|
|
104
|
+
type WebDebugChannel = {
|
|
79
105
|
readable?: ReadableStream<Uint8Array>;
|
|
80
106
|
writable?: WritableStream<Uint8Array>;
|
|
81
107
|
};
|
|
82
108
|
type ServerTemporaryReferenceSet = unknown;
|
|
83
109
|
type ClientTemporaryReferenceSet = unknown;
|
|
84
110
|
//#endregion
|
|
85
|
-
export {
|
|
111
|
+
export { RenderToPipeableStreamOptions as _, CreateFromReadableStreamBrowserOptions as a, ServerTemporaryReferenceSet as b, DecodeReplyFunction as c, ModuleMap as d, PipeableStream as f, PrerenderToNodeStreamResult as g, PrerenderToNodeStreamOptions as h, CreateFromNodeStreamOptions as i, EncodeFormActionCallback as l, PrerenderResult as m, CallServerCallback as n, CreateFromReadableStreamEdgeOptions as o, PrerenderOptions as p, ClientTemporaryReferenceSet as r, DecodeReplyFromBusboyFunction as s, BundlerConfig as t, EncodeReplyFunction as u, RenderToReadableStreamOptions as v, ServerConsumerManifest as y };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
1
|
+
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-Bqv0ikDW.js";
|
|
2
2
|
export { vitePluginRsc as default, getPluginApi };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __commonJSMin } from "./plugin-
|
|
1
|
+
import { a as __commonJSMin } from "./plugin-Bqv0ikDW.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
3
3
|
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
4
|
let p = process || {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as createDebug } from "./dist-uqdtSkzK.js";
|
|
2
1
|
import vitePluginRscCore from "./core/plugin.js";
|
|
3
|
-
import { i as hasDirective } from "./scope-
|
|
4
|
-
import { t as cjsModuleRunnerPlugin } from "./cjs-
|
|
2
|
+
import { i as hasDirective } from "./scope-Ck0n25my.js";
|
|
3
|
+
import { t as cjsModuleRunnerPlugin } from "./cjs-DhDj_zQT.js";
|
|
5
4
|
import { i as toCssVirtual, n as parseIdQuery, r as parseReferenceValidationVirtual, t as parseCssVirtual } from "./shared-B6H2TbnP.js";
|
|
6
5
|
import { findDirectives, transformDirectiveProxyExport, transformExpandExportAll, transformServerActionServer, transformWrapExport } from "./transforms/index.js";
|
|
7
6
|
import { o as generateEncryptionKey, s as toBase64 } from "./encryption-utils-BNbYHtC4.js";
|
|
@@ -14,6 +13,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
14
13
|
import { exactRegex, prefixRegex } from "@rolldown/pluginutils";
|
|
15
14
|
import * as esModuleLexer from "es-module-lexer";
|
|
16
15
|
import MagicString from "magic-string";
|
|
16
|
+
import { createDebug } from "obug";
|
|
17
17
|
import { toNodeHandler } from "srvx/node";
|
|
18
18
|
import { stripLiteral } from "strip-literal";
|
|
19
19
|
import * as vite from "vite";
|
|
@@ -40,7 +40,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
40
40
|
}
|
|
41
41
|
return to;
|
|
42
42
|
};
|
|
43
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
43
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
44
44
|
value: mod,
|
|
45
45
|
enumerable: true
|
|
46
46
|
}) : target, mod));
|
|
@@ -426,9 +426,10 @@ function scanBuildStripPlugin({ manager }) {
|
|
|
426
426
|
const importGlobRE = /\bimport\.meta\.glob(?:<\w+>)?\s*\(/g;
|
|
427
427
|
async function transformScanBuildStrip(code) {
|
|
428
428
|
const [imports] = esModuleLexer.parse(code);
|
|
429
|
-
let output = imports.map((e) => e.
|
|
429
|
+
let output = imports.map((e) => e.specifier && `import ${JSON.stringify(e.specifier)};\n`).filter(Boolean).join("");
|
|
430
430
|
if (importGlobRE.test(code)) {
|
|
431
|
-
|
|
431
|
+
const ast = await parseAstAsync(code);
|
|
432
|
+
walk(ast, { enter(node) {
|
|
432
433
|
if (node.type === "CallExpression" && node.callee.type === "MemberExpression" && node.callee.object.type === "MetaProperty" && node.callee.object.meta.type === "Identifier" && node.callee.object.meta.name === "import" && node.callee.object.property.type === "Identifier" && node.callee.object.property.name === "meta" && node.callee.property.type === "Identifier" && node.callee.property.name === "glob") {
|
|
433
434
|
const importMetaGlob = code.slice(node.start, node.end);
|
|
434
435
|
output += `console.log(${importMetaGlob});\n`;
|
|
@@ -710,7 +711,7 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
|
|
|
710
711
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
711
712
|
const manager = new RscPluginManager();
|
|
712
713
|
const buildApp = async (builder) => {
|
|
713
|
-
const colors = await import("./picocolors-
|
|
714
|
+
const colors = await import("./picocolors-DibqjEBF.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
714
715
|
const logStep = (msg) => {
|
|
715
716
|
builder.config.logger.info(colors.blue(msg));
|
|
716
717
|
};
|
|
@@ -902,10 +903,12 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
902
903
|
environmentName: "rsc",
|
|
903
904
|
entryName: "index"
|
|
904
905
|
};
|
|
905
|
-
const
|
|
906
|
+
const entryFile = path.join(manager.config.environments[options.environmentName].build.outDir, `${options.entryName}.js`);
|
|
907
|
+
const fetchHandler = getFetchHandlerExport(await import(
|
|
906
908
|
/* @vite-ignore */
|
|
907
|
-
pathToFileURL(
|
|
908
|
-
))
|
|
909
|
+
pathToFileURL(entryFile).href
|
|
910
|
+
));
|
|
911
|
+
const handler = toNodeHandler(fetchHandler);
|
|
909
912
|
server.middlewares.use((req, _res, next) => {
|
|
910
913
|
delete req.headers["accept-encoding"];
|
|
911
914
|
next();
|
|
@@ -1066,18 +1069,20 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
1066
1069
|
const source = getEntrySource(environment.config, entryName);
|
|
1067
1070
|
const resolvedEntry = await environment.pluginContainer.resolveId(source);
|
|
1068
1071
|
assert(resolvedEntry, `[vite-rsc] failed to resolve entry '${source}'`);
|
|
1069
|
-
|
|
1072
|
+
const runnerProxy = new Proxy({}, { get(_target, p, _receiver) {
|
|
1070
1073
|
if (typeof p !== "string" || p === "then") return;
|
|
1071
1074
|
return async (...args) => {
|
|
1072
1075
|
return (await environment.runner.import(resolvedEntry.id))[p](...args);
|
|
1073
1076
|
};
|
|
1074
|
-
} })
|
|
1077
|
+
} });
|
|
1078
|
+
return createRpcServer(runnerProxy);
|
|
1075
1079
|
}
|
|
1076
1080
|
server.middlewares.use(async (req, res, next) => {
|
|
1077
1081
|
const url = new URL(req.url ?? "/", `http://localhost`);
|
|
1078
1082
|
if (url.pathname === "/__vite_rsc_load_module_dev_proxy") {
|
|
1079
1083
|
try {
|
|
1080
|
-
|
|
1084
|
+
const handler = await createHandler(url);
|
|
1085
|
+
await toNodeHandler(handler)(req, res);
|
|
1081
1086
|
} catch (e) {
|
|
1082
1087
|
next(e);
|
|
1083
1088
|
}
|
|
@@ -1155,8 +1160,11 @@ export function createRpcClient(params) {
|
|
|
1155
1160
|
}
|
|
1156
1161
|
}
|
|
1157
1162
|
},
|
|
1158
|
-
generateBundle
|
|
1159
|
-
|
|
1163
|
+
generateBundle: {
|
|
1164
|
+
order: "post",
|
|
1165
|
+
handler(_options, bundle) {
|
|
1166
|
+
if (this.environment.name !== "client") return;
|
|
1167
|
+
if (manager.isScanBuild) return;
|
|
1160
1168
|
const rscBundle = manager.bundles["rsc"];
|
|
1161
1169
|
if (!manager.config.environments.rsc.build.cssCodeSplit) {
|
|
1162
1170
|
let cssBundleName;
|
|
@@ -1179,12 +1187,12 @@ export function createRpcClient(params) {
|
|
|
1179
1187
|
});
|
|
1180
1188
|
}
|
|
1181
1189
|
const serverResources = {};
|
|
1182
|
-
const rscAssetDeps = collectAssetDeps(rscBundle);
|
|
1190
|
+
const rscAssetDeps = collectAssetDeps(rscBundle).idToDeps;
|
|
1183
1191
|
for (const [id, meta] of Object.entries(manager.serverResourcesMetaMap)) serverResources[meta.key] = assetsURLOfDeps({
|
|
1184
1192
|
js: [],
|
|
1185
1193
|
css: rscAssetDeps[id]?.deps.css ?? []
|
|
1186
1194
|
}, manager);
|
|
1187
|
-
const assetDeps = collectAssetDeps(bundle);
|
|
1195
|
+
const { idToDeps: assetDeps, chunkToDeps } = collectAssetDeps(bundle);
|
|
1188
1196
|
let clientEntryUrl;
|
|
1189
1197
|
let clientEntryDeps;
|
|
1190
1198
|
const clientReferenceDeps = {};
|
|
@@ -1196,11 +1204,12 @@ export function createRpcClient(params) {
|
|
|
1196
1204
|
clientReferenceDeps[meta.referenceKey] = assetsURLOfDeps(deps, manager);
|
|
1197
1205
|
}
|
|
1198
1206
|
if (!rscPluginOptions.customClientEntry) {
|
|
1199
|
-
const entry =
|
|
1207
|
+
const entry = [...chunkToDeps].find(([chunk]) => chunk.name === "index" && chunk.isEntry);
|
|
1200
1208
|
if (!entry) throw new Error(`[vite-rsc] Client build must have an entry chunk named "index". Use 'customClientEntry' option to disable this requirement.`);
|
|
1201
|
-
|
|
1209
|
+
const [entryChunk, entryDeps] = entry;
|
|
1210
|
+
clientEntryDeps = assetsURLOfDeps(entryDeps, manager);
|
|
1202
1211
|
for (const [key, deps] of Object.entries(clientReferenceDeps)) clientReferenceDeps[key] = mergeAssetDeps(deps, clientEntryDeps);
|
|
1203
|
-
clientEntryUrl = assetsURL(
|
|
1212
|
+
clientEntryUrl = assetsURL(entryChunk.fileName, manager);
|
|
1204
1213
|
}
|
|
1205
1214
|
manager.buildAssetsManifest = {
|
|
1206
1215
|
clientEntryUrl,
|
|
@@ -1232,7 +1241,8 @@ export function createRpcClient(params) {
|
|
|
1232
1241
|
for (const match of stripLiteral(code).matchAll(/import\s*\.\s*meta\s*\.\s*viteRsc\s*\.\s*loadBootstrapScriptContent\(([\s\S]*?)\)/dg)) {
|
|
1233
1242
|
const [argStart, argEnd] = match.indices[1];
|
|
1234
1243
|
const argCode = code.slice(argStart, argEnd).trim();
|
|
1235
|
-
|
|
1244
|
+
const entryName = evalValue(argCode);
|
|
1245
|
+
assert(entryName, `[vite-rsc] expected 'loadBootstrapScriptContent("index")' but got ${argCode}`);
|
|
1236
1246
|
let replacement = `Promise.resolve("import(" + JSON.stringify(__vite_rsc_assets_manifest.clientEntryUrl) + ")")`;
|
|
1237
1247
|
const [start, end] = match.indices[0];
|
|
1238
1248
|
output.overwrite(start, end, replacement);
|
|
@@ -1314,7 +1324,8 @@ function createTransformExpandExportAllContext(ctx) {
|
|
|
1314
1324
|
},
|
|
1315
1325
|
load: async (id) => {
|
|
1316
1326
|
const raw = await fs.promises.readFile(id, "utf-8");
|
|
1317
|
-
|
|
1327
|
+
const result = await (vite.transformWithOxc ?? vite.transformWithEsbuild)(raw, id, { sourcemap: false });
|
|
1328
|
+
return parseAstAsync(result.code);
|
|
1318
1329
|
}
|
|
1319
1330
|
};
|
|
1320
1331
|
}
|
|
@@ -1366,14 +1377,15 @@ function vitePluginUseClient(useClientPluginOptions, manager) {
|
|
|
1366
1377
|
warnInoncistentClientOptimization(this, id);
|
|
1367
1378
|
importId = `/@id/__x00__virtual:vite-rsc/client-in-server-package-proxy/${encodeURIComponent(id)}`;
|
|
1368
1379
|
referenceKey = importId;
|
|
1369
|
-
} else if (packageSource)
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1380
|
+
} else if (packageSource) {
|
|
1381
|
+
if (this.environment.mode === "dev") {
|
|
1382
|
+
importId = `/@id/__x00__virtual:vite-rsc/client-package-proxy/${packageSource}`;
|
|
1383
|
+
referenceKey = importId;
|
|
1384
|
+
} else {
|
|
1385
|
+
importId = packageSource;
|
|
1386
|
+
referenceKey = hashString(packageSource);
|
|
1387
|
+
}
|
|
1388
|
+
} else if (this.environment.mode === "dev") {
|
|
1377
1389
|
importId = normalizeViteImportAnalysisUrl(manager.server.environments[browserEnvironmentName], id);
|
|
1378
1390
|
referenceKey = importId;
|
|
1379
1391
|
} else {
|
|
@@ -1823,7 +1835,10 @@ function collectAssetDeps(bundle) {
|
|
|
1823
1835
|
chunk,
|
|
1824
1836
|
deps
|
|
1825
1837
|
};
|
|
1826
|
-
return
|
|
1838
|
+
return {
|
|
1839
|
+
idToDeps,
|
|
1840
|
+
chunkToDeps
|
|
1841
|
+
};
|
|
1827
1842
|
}
|
|
1828
1843
|
function collectAssetDepsInner(fileName, bundle) {
|
|
1829
1844
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -1857,11 +1872,13 @@ function vitePluginRscCss(rscCssOptions = {}, manager) {
|
|
|
1857
1872
|
visited.add(id);
|
|
1858
1873
|
const mod = environment.moduleGraph.getModuleById(id);
|
|
1859
1874
|
if (mod?.file) visitedFiles.add(mod.file);
|
|
1860
|
-
for (const next of mod?.importedModules ?? []) if (next.id)
|
|
1861
|
-
if (next.
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1875
|
+
for (const next of mod?.importedModules ?? []) if (next.id) {
|
|
1876
|
+
if (isCSSRequest(next.id)) {
|
|
1877
|
+
if (next.file) visitedFiles.add(next.file);
|
|
1878
|
+
if (hasSpecialCssQuery(next.id)) continue;
|
|
1879
|
+
cssIds.add(next.id);
|
|
1880
|
+
} else recurse(next.id);
|
|
1881
|
+
}
|
|
1865
1882
|
}
|
|
1866
1883
|
recurse(entryId);
|
|
1867
1884
|
const cssLinkPrecedence = rscCssOptions?.cssLinkPrecedence ?? true;
|
|
@@ -1886,7 +1903,7 @@ function vitePluginRscCss(rscCssOptions = {}, manager) {
|
|
|
1886
1903
|
if (options === false) return false;
|
|
1887
1904
|
if (options?.filter && !options.filter(filename)) return false;
|
|
1888
1905
|
if (!/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)\b/.test(code) || !/\.[tj]sx?$/.test(filename)) return false;
|
|
1889
|
-
if (!esModuleLexer.parse(code)[0].some((i) => i.
|
|
1906
|
+
if (!esModuleLexer.parse(code)[0].some((i) => i.type === "static" && i.specifier && isCSSRequest(i.specifier))) return false;
|
|
1890
1907
|
return (_name, meta) => !!(meta.isFunction && meta.declName && /^[A-Z]/.test(meta.declName) || meta.defaultExportIdentifierName && /^[A-Z]/.test(meta.defaultExportIdentifierName));
|
|
1891
1908
|
}
|
|
1892
1909
|
return [
|
|
@@ -2067,6 +2084,7 @@ function generateResourcesCode(depsCode, manager, options = {}) {
|
|
|
2067
2084
|
return React.createElement(React.Fragment, null, [...deps.css.map((href) => React.createElement("link", {
|
|
2068
2085
|
key: "css:" + href,
|
|
2069
2086
|
rel: "stylesheet",
|
|
2087
|
+
crossOrigin: "anonymous",
|
|
2070
2088
|
...precedence ? { precedence } : {},
|
|
2071
2089
|
href,
|
|
2072
2090
|
"data-rsc-css-href": href
|
package/dist/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
1
|
+
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-Bqv0ikDW.js";
|
|
2
2
|
export { vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugins/cjs.d.ts
CHANGED
package/dist/plugins/cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cjsModuleRunnerPlugin } from "../cjs-
|
|
1
|
+
import { t as cjsModuleRunnerPlugin } from "../cjs-DhDj_zQT.js";
|
|
2
2
|
export { cjsModuleRunnerPlugin };
|
package/dist/react/browser.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CreateFromReadableStreamBrowserOptions, n as CallServerCallback, r as ClientTemporaryReferenceSet, u as EncodeReplyFunction } from "../index-CROaL0MT.js";
|
|
2
2
|
import { t as setRequireModule } from "../browser-DI_Wyg5Y.js";
|
|
3
3
|
//#region src/react/browser.d.ts
|
|
4
|
-
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamBrowserOptions): Promise<T>;
|
|
5
|
-
declare function createFromFetch<T>(promiseForResponse: Promise<Response>, options?: CreateFromReadableStreamBrowserOptions): Promise<T>;
|
|
6
|
-
declare const encodeReply: EncodeReplyFunction;
|
|
7
|
-
declare const createServerReference: (...args: any[]) => unknown;
|
|
8
|
-
declare function callServer(...args: any[]): any;
|
|
9
|
-
declare function setServerCallback(fn: CallServerCallback): void;
|
|
10
|
-
declare const createTemporaryReferenceSet: () => ClientTemporaryReferenceSet;
|
|
11
|
-
declare function findSourceMapURL(filename: string, environmentName: string): string | null;
|
|
4
|
+
export declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamBrowserOptions): Promise<T>;
|
|
5
|
+
export declare function createFromFetch<T>(promiseForResponse: Promise<Response>, options?: CreateFromReadableStreamBrowserOptions): Promise<T>;
|
|
6
|
+
export declare const encodeReply: EncodeReplyFunction;
|
|
7
|
+
export declare const createServerReference: (...args: any[]) => unknown;
|
|
8
|
+
export declare function callServer(...args: any[]): any;
|
|
9
|
+
export declare function setServerCallback(fn: CallServerCallback): void;
|
|
10
|
+
export declare const createTemporaryReferenceSet: () => ClientTemporaryReferenceSet;
|
|
11
|
+
export declare function findSourceMapURL(filename: string, environmentName: string): string | null;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { type CallServerCallback,
|
|
13
|
+
export { type CallServerCallback, setRequireModule };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createFromReadableStream, r as encodeReply, t as createClientTemporaryReferenceSet } from "../../client-
|
|
1
|
+
import { n as createFromReadableStream, r as encodeReply, t as createClientTemporaryReferenceSet } from "../../client-Dq3oGLRS.js";
|
|
2
2
|
export { createClientTemporaryReferenceSet, createFromReadableStream, encodeReply };
|
package/dist/react/rsc/client.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as createServerConsumerManifest } from "../../client.shared-D1HxyClg.js";
|
|
2
2
|
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
3
|
//#region src/react/rsc/client.ts
|
|
4
4
|
function createFromReadableStream(stream, options = {}, extraOptions) {
|
|
5
5
|
return ReactClient.createFromReadableStream(stream, {
|
|
6
|
-
serverConsumerManifest:
|
|
7
|
-
serverModuleMap: createServerManifest({ preserveServerReferences: extraOptions?.preserveServerReferences }),
|
|
8
|
-
moduleMap: createServerDecodeClientManifest()
|
|
9
|
-
},
|
|
6
|
+
serverConsumerManifest: createServerConsumerManifest(extraOptions),
|
|
10
7
|
...options
|
|
11
8
|
});
|
|
12
9
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as createServerConsumerManifest } from "../../client.shared-D1HxyClg.js";
|
|
2
|
+
import * as ReactClientNode from "@vitejs/plugin-rsc/vendor/react-server-dom/client.node";
|
|
3
|
+
//#region src/react/rsc/client.node.ts
|
|
4
|
+
function createFromReadableStream(stream, options = {}, extraOptions) {
|
|
5
|
+
return ReactClientNode.createFromReadableStream(stream, {
|
|
6
|
+
serverConsumerManifest: createServerConsumerManifest(extraOptions),
|
|
7
|
+
...options
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function createFromNodeStream(stream, options = {}, extraOptions) {
|
|
11
|
+
return ReactClientNode.createFromNodeStream(stream, createServerConsumerManifest(extraOptions), options);
|
|
12
|
+
}
|
|
13
|
+
const encodeReply = ReactClientNode.encodeReply;
|
|
14
|
+
const createClientTemporaryReferenceSet = ReactClientNode.createTemporaryReferenceSet;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { createClientTemporaryReferenceSet, createFromNodeStream, createFromReadableStream, encodeReply };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as loadServerAction, s as setRequireModule } from "../../rsc-
|
|
2
|
-
import { a as registerClientReference, i as decodeReply, n as decodeAction, o as registerServerReference, r as decodeFormState, s as renderToReadableStream, t as createTemporaryReferenceSet } from "../../server-
|
|
1
|
+
import { o as loadServerAction, s as setRequireModule } from "../../rsc-D8UlANI2.js";
|
|
2
|
+
import { a as registerClientReference, i as decodeReply, n as decodeAction, o as registerServerReference, r as decodeFormState, s as renderToReadableStream, t as createTemporaryReferenceSet } from "../../server-YwgjVtsE.js";
|
|
3
3
|
export { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { o as loadServerAction, s as setRequireModule } from "../../rsc-D8UlANI2.js";
|
|
2
|
+
import { a as decodeReplyFromBusboy, c as renderToPipeableStream, i as decodeReply, l as renderToReadableStream, n as decodeAction, o as registerClientReference, r as decodeFormState, s as registerServerReference, t as createTemporaryReferenceSet } from "../../server.node-DU77AeKU.js";
|
|
3
|
+
export { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decodeReplyFromBusboy, loadServerAction, registerClientReference, registerServerReference, renderToPipeableStream, renderToReadableStream, setRequireModule };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "../../core/rsc.js";
|
|
2
|
+
import * as ReactServerNode from "@vitejs/plugin-rsc/vendor/react-server-dom/server.node";
|
|
3
|
+
//#region src/react/rsc/server.node.ts
|
|
4
|
+
function renderToReadableStream(data, options, extraOptions) {
|
|
5
|
+
return ReactServerNode.renderToReadableStream(data, createClientManifest({ onClientReference: extraOptions?.onClientReference }), options);
|
|
6
|
+
}
|
|
7
|
+
function renderToPipeableStream(data, options, extraOptions) {
|
|
8
|
+
return ReactServerNode.renderToPipeableStream(data, createClientManifest({ onClientReference: extraOptions?.onClientReference }), options);
|
|
9
|
+
}
|
|
10
|
+
function registerClientReference(proxy, id, name) {
|
|
11
|
+
return ReactServerNode.registerClientReference(proxy, id, name);
|
|
12
|
+
}
|
|
13
|
+
const registerServerReference = ReactServerNode.registerServerReference;
|
|
14
|
+
const decodeReply = (body, options) => ReactServerNode.decodeReply(body, createServerManifest(), options);
|
|
15
|
+
const decodeReplyFromBusboy = (body, options) => ReactServerNode.decodeReplyFromBusboy(body, createServerManifest(), options);
|
|
16
|
+
function decodeAction(body) {
|
|
17
|
+
return ReactServerNode.decodeAction(body, createServerManifest());
|
|
18
|
+
}
|
|
19
|
+
function decodeFormState(actionResult, body) {
|
|
20
|
+
return ReactServerNode.decodeFormState(actionResult, body, createServerManifest());
|
|
21
|
+
}
|
|
22
|
+
const createTemporaryReferenceSet = ReactServerNode.createTemporaryReferenceSet;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decodeReplyFromBusboy, loadServerAction, registerClientReference, registerServerReference, renderToPipeableStream, renderToReadableStream, setRequireModule };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as CreateClientManifestOptions } from "../../rsc-
|
|
1
|
+
import { m as PrerenderResult, p as PrerenderOptions } from "../../index-CROaL0MT.js";
|
|
2
|
+
import { n as CreateClientManifestOptions } from "../../rsc-D8UlANI2.js";
|
|
3
3
|
//#region src/react/rsc/static.d.ts
|
|
4
|
-
declare function prerender<T>(data: T, options?:
|
|
5
|
-
//#endregion
|
|
6
|
-
export { prerender };
|
|
4
|
+
export declare function prerender<T>(data: T, options?: PrerenderOptions, extraOptions?: CreateClientManifestOptions): Promise<PrerenderResult>;
|
|
5
|
+
//#endregion
|