@vitejs/plugin-rsc 0.5.8 → 0.5.10
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/dist/browser.d.ts +3 -3
- package/dist/browser.js +2 -2
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/browser.js +15 -1
- package/dist/core/rsc.d.ts +11 -1
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +8 -1
- package/dist/core/ssr.js +21 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{plugin-COe11H-Q.js → plugin-DNlyqBiD.js} +2 -2
- package/dist/plugin.d.ts +147 -3
- package/dist/plugin.js +1 -1
- package/dist/react/browser.d.ts +14 -4
- package/dist/react/browser.js +38 -2
- package/dist/react/rsc.d.ts +15 -2
- package/dist/react/rsc.js +34 -2
- package/dist/react/ssr.d.ts +8 -2
- package/dist/react/ssr.js +16 -2
- package/dist/rsc.d.ts +3 -3
- package/dist/rsc.js +3 -3
- package/dist/ssr.d.ts +2 -2
- package/dist/ssr.js +2 -2
- package/dist/transforms/index.d.ts +1 -1
- package/dist/utils/encryption-runtime.d.ts +4 -1
- package/dist/utils/encryption-runtime.js +19 -3
- package/package.json +3 -3
- package/dist/browser-BJvYpz0J.js +0 -35
- package/dist/browser-Dtp2JGlz.js +0 -17
- package/dist/browser-_r3sM3qR.d.ts +0 -13
- package/dist/encryption-runtime-C6wgt7G4.d.ts +0 -5
- package/dist/encryption-runtime-DlHpEnUc.js +0 -20
- package/dist/plugin-24ZutaDY.d.ts +0 -147
- package/dist/rsc-BIM0wUrP.js +0 -36
- package/dist/rsc-GHO-HEzG.d.ts +0 -12
- package/dist/rsc-g5utSLBE.d.ts +0 -15
- package/dist/ssr-B-bLmlbm.js +0 -18
- package/dist/ssr-Bnw-VQBr.d.ts +0 -7
- package/dist/ssr-CB7zlVBC.d.ts +0 -9
- package/dist/ssr-CDPTWY93.js +0 -23
- /package/dist/{browser-nNQlWmRe.d.ts → browser-BmyjVnfA.d.ts} +0 -0
- /package/dist/{index-CM9Mmb_C.d.ts → index-CFOPl4Gi.d.ts} +0 -0
- /package/dist/{index-CvmuS4Ks.d.ts → index-DqoQPvhP.d.ts} +0 -0
- /package/dist/{picocolors-AGVbN-ya.js → picocolors-BxaHL81J.js} +0 -0
- /package/dist/{rsc-BwsRzIFM.js → rsc-BRh4PjTs.js} +0 -0
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CallServerCallback } from "./index-
|
|
2
|
-
import { t as setRequireModule } from "./browser-
|
|
3
|
-
import {
|
|
1
|
+
import { n as CallServerCallback } from "./index-DqoQPvhP.js";
|
|
2
|
+
import { t as setRequireModule } from "./browser-BmyjVnfA.js";
|
|
3
|
+
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { setRequireModule } from "./core/browser.js";
|
|
2
|
+
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
|
|
3
3
|
import * as clientReferences from "virtual:vite-rsc/client-references";
|
|
4
4
|
|
|
5
5
|
//#region src/browser.ts
|
package/dist/core/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as setRequireModule } from "../browser-
|
|
1
|
+
import { t as setRequireModule } from "../browser-BmyjVnfA.js";
|
|
2
2
|
export { setRequireModule };
|
package/dist/core/browser.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as memoize } from "../dist-BRSdGcl7.js";
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-DEpnONZf.js";
|
|
2
3
|
|
|
4
|
+
//#region src/core/browser.ts
|
|
5
|
+
let init = false;
|
|
6
|
+
function setRequireModule(options) {
|
|
7
|
+
if (init) return;
|
|
8
|
+
init = true;
|
|
9
|
+
const requireModule = memoize((id) => {
|
|
10
|
+
return options.load(removeReferenceCacheTag(id));
|
|
11
|
+
});
|
|
12
|
+
globalThis.__vite_rsc_client_require__ = requireModule;
|
|
13
|
+
setInternalRequire();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
3
17
|
export { setRequireModule };
|
package/dist/core/rsc.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ModuleMap, t as BundlerConfig } from "../index-DqoQPvhP.js";
|
|
2
|
+
|
|
3
|
+
//#region src/core/rsc.d.ts
|
|
4
|
+
declare function setRequireModule(options: {
|
|
5
|
+
load: (id: string) => unknown;
|
|
6
|
+
}): void;
|
|
7
|
+
declare function loadServerAction(id: string): Promise<Function>;
|
|
8
|
+
declare function createServerManifest(): BundlerConfig;
|
|
9
|
+
declare function createServerDecodeClientManifest(): ModuleMap;
|
|
10
|
+
declare function createClientManifest(): BundlerConfig;
|
|
11
|
+
//#endregion
|
|
2
12
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/rsc.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-
|
|
1
|
+
import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-BRh4PjTs.js";
|
|
2
2
|
|
|
3
3
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/ssr.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as ServerConsumerManifest } from "../index-DqoQPvhP.js";
|
|
2
|
+
|
|
3
|
+
//#region src/core/ssr.d.ts
|
|
4
|
+
declare function setRequireModule(options: {
|
|
5
|
+
load: (id: string) => unknown;
|
|
6
|
+
}): void;
|
|
7
|
+
declare function createServerConsumerManifest(): ServerConsumerManifest;
|
|
8
|
+
//#endregion
|
|
2
9
|
export { createServerConsumerManifest, setRequireModule };
|
package/dist/core/ssr.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as memoize } from "../dist-BRSdGcl7.js";
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-DEpnONZf.js";
|
|
2
3
|
|
|
4
|
+
//#region src/core/ssr.ts
|
|
5
|
+
let init = false;
|
|
6
|
+
function setRequireModule(options) {
|
|
7
|
+
if (init) return;
|
|
8
|
+
init = true;
|
|
9
|
+
const requireModule = memoize((id) => {
|
|
10
|
+
return options.load(removeReferenceCacheTag(id));
|
|
11
|
+
});
|
|
12
|
+
const clientRequire = (id) => {
|
|
13
|
+
return requireModule(id);
|
|
14
|
+
};
|
|
15
|
+
globalThis.__vite_rsc_client_require__ = clientRequire;
|
|
16
|
+
setInternalRequire();
|
|
17
|
+
}
|
|
18
|
+
function createServerConsumerManifest() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
3
23
|
export { createServerConsumerManifest, setRequireModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import
|
|
1
|
+
import "./index-CFOPl4Gi.js";
|
|
2
|
+
import vitePluginRsc, { PluginApi, RscPluginOptions, getPluginApi } from "./plugin.js";
|
|
3
3
|
export { type PluginApi, type RscPluginOptions, vitePluginRsc as default, getPluginApi };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./transforms-BcLQCXiC.js";
|
|
2
2
|
import "./rpc-CRpYrgKq.js";
|
|
3
|
-
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
3
|
+
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-DNlyqBiD.js";
|
|
4
4
|
import "./cjs-DHD_0drE.js";
|
|
5
5
|
|
|
6
6
|
export { vitePluginRsc as default, getPluginApi };
|
|
@@ -285,7 +285,7 @@ function vitePluginFindSourceMapURL() {
|
|
|
285
285
|
}
|
|
286
286
|
async function findSourceMapURL(server, filename, environmentName) {
|
|
287
287
|
if (filename.startsWith("file://")) {
|
|
288
|
-
filename = fileURLToPath(filename);
|
|
288
|
+
filename = slash(fileURLToPath(filename));
|
|
289
289
|
if (isFileLoadingAllowed(server.config, filename) && fs.existsSync(filename)) {
|
|
290
290
|
const content = fs.readFileSync(filename, "utf-8");
|
|
291
291
|
return {
|
|
@@ -406,7 +406,7 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
|
|
|
406
406
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
407
407
|
const manager = new RscPluginManager();
|
|
408
408
|
const buildApp = async (builder) => {
|
|
409
|
-
const colors = await import("./picocolors-
|
|
409
|
+
const colors = await import("./picocolors-BxaHL81J.js").then(__toDynamicImportESM());
|
|
410
410
|
const logStep = (msg) => {
|
|
411
411
|
builder.config.logger.info(colors.blue(msg));
|
|
412
412
|
};
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,3 +1,147 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { s as TransformWrapExportFilter } from "./index-CFOPl4Gi.js";
|
|
2
|
+
import MagicString from "magic-string";
|
|
3
|
+
import { Plugin, ResolvedConfig, Rollup, ViteDevServer, parseAstAsync } from "vite";
|
|
4
|
+
|
|
5
|
+
//#region src/plugin.d.ts
|
|
6
|
+
type ClientReferenceMeta = {
|
|
7
|
+
importId: string;
|
|
8
|
+
referenceKey: string;
|
|
9
|
+
packageSource?: string;
|
|
10
|
+
exportNames: string[];
|
|
11
|
+
renderedExports: string[];
|
|
12
|
+
serverChunk?: string;
|
|
13
|
+
groupChunkId?: string;
|
|
14
|
+
};
|
|
15
|
+
type ServerRerferenceMeta = {
|
|
16
|
+
importId: string;
|
|
17
|
+
referenceKey: string;
|
|
18
|
+
exportNames: string[];
|
|
19
|
+
};
|
|
20
|
+
declare class RscPluginManager {
|
|
21
|
+
server: ViteDevServer;
|
|
22
|
+
config: ResolvedConfig;
|
|
23
|
+
rscBundle: Rollup.OutputBundle;
|
|
24
|
+
buildAssetsManifest: AssetsManifest | undefined;
|
|
25
|
+
isScanBuild: boolean;
|
|
26
|
+
clientReferenceMetaMap: Record<string, ClientReferenceMeta>;
|
|
27
|
+
clientReferenceGroups: Record<string, ClientReferenceMeta[]>;
|
|
28
|
+
serverReferenceMetaMap: Record<string, ServerRerferenceMeta>;
|
|
29
|
+
serverResourcesMetaMap: Record<string, {
|
|
30
|
+
key: string;
|
|
31
|
+
}>;
|
|
32
|
+
stabilize(): void;
|
|
33
|
+
toRelativeId(id: string): string;
|
|
34
|
+
}
|
|
35
|
+
type RscPluginOptions = {
|
|
36
|
+
/**
|
|
37
|
+
* shorthand for configuring `environments.(name).build.rollupOptions.input.index`
|
|
38
|
+
*/
|
|
39
|
+
entries?: Partial<Record<"client" | "ssr" | "rsc", string>>;
|
|
40
|
+
/** @default { enviornmentName: "rsc", entryName: "index" } */
|
|
41
|
+
serverHandler?: {
|
|
42
|
+
environmentName: string;
|
|
43
|
+
entryName: string;
|
|
44
|
+
} | false;
|
|
45
|
+
/** @default false */
|
|
46
|
+
loadModuleDevProxy?: boolean;
|
|
47
|
+
rscCssTransform?: false | {
|
|
48
|
+
filter?: (id: string) => boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* This option allows customizing how client build copies assets from server build.
|
|
52
|
+
* By default, all assets are copied, but frameworks can establish server asset convention
|
|
53
|
+
* to tighten security using this option.
|
|
54
|
+
*/
|
|
55
|
+
copyServerAssetsToClient?: (fileName: string) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* This option allows disabling action closure encryption for debugging purpose.
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
enableActionEncryption?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* By default, the plugin uses a build-time generated encryption key for
|
|
63
|
+
* "use server" closure argument binding.
|
|
64
|
+
* This can be overwritten by configuring `defineEncryptionKey` option,
|
|
65
|
+
* for example, to obtain a key through environment variable during runtime.
|
|
66
|
+
* cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
|
|
67
|
+
*/
|
|
68
|
+
defineEncryptionKey?: string;
|
|
69
|
+
/** Escape hatch for Waku's `allowServer` */
|
|
70
|
+
keepUseCientProxy?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Enable build-time validation of 'client-only' and 'server-only' imports
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
validateImports?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
|
|
78
|
+
* for better composability with other plugins.
|
|
79
|
+
* @default true since Vite 7
|
|
80
|
+
*/
|
|
81
|
+
useBuildAppHook?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Custom environment configuration
|
|
84
|
+
* @experimental
|
|
85
|
+
* @default { browser: 'client', ssr: 'ssr', rsc: 'rsc' }
|
|
86
|
+
*/
|
|
87
|
+
environment?: {
|
|
88
|
+
browser?: string;
|
|
89
|
+
ssr?: string;
|
|
90
|
+
rsc?: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Custom chunking strategy for client reference modules.
|
|
94
|
+
*
|
|
95
|
+
* This function allows you to group multiple client components into
|
|
96
|
+
* custom chunks instead of having each module in its own chunk.
|
|
97
|
+
* By default, client chunks are grouped by `meta.serverChunk`.
|
|
98
|
+
*/
|
|
99
|
+
clientChunks?: (meta: {
|
|
100
|
+
/** client reference module id */
|
|
101
|
+
id: string;
|
|
102
|
+
/** normalized client reference module id */
|
|
103
|
+
normalizedId: string;
|
|
104
|
+
/** server chunk which includes a corresponding client reference proxy module */
|
|
105
|
+
serverChunk: string;
|
|
106
|
+
}) => string | undefined;
|
|
107
|
+
};
|
|
108
|
+
type PluginApi = {
|
|
109
|
+
manager: RscPluginManager;
|
|
110
|
+
};
|
|
111
|
+
/** @experimental */
|
|
112
|
+
declare function getPluginApi(config: Pick<ResolvedConfig, "plugins">): PluginApi | undefined;
|
|
113
|
+
/** @experimental */
|
|
114
|
+
declare function vitePluginRscMinimal(rscPluginOptions?: RscPluginOptions, manager?: RscPluginManager): Plugin[];
|
|
115
|
+
declare function vitePluginRsc(rscPluginOptions?: RscPluginOptions): Plugin[];
|
|
116
|
+
declare class RuntimeAsset {
|
|
117
|
+
runtime: string;
|
|
118
|
+
constructor(value: string);
|
|
119
|
+
}
|
|
120
|
+
type AssetsManifest = {
|
|
121
|
+
bootstrapScriptContent: string | RuntimeAsset;
|
|
122
|
+
clientReferenceDeps: Record<string, AssetDeps>;
|
|
123
|
+
serverResources?: Record<string, Pick<AssetDeps, "css">>;
|
|
124
|
+
};
|
|
125
|
+
type AssetDeps = {
|
|
126
|
+
js: (string | RuntimeAsset)[];
|
|
127
|
+
css: (string | RuntimeAsset)[];
|
|
128
|
+
};
|
|
129
|
+
type ResolvedAssetsManifest = {
|
|
130
|
+
bootstrapScriptContent: string;
|
|
131
|
+
clientReferenceDeps: Record<string, ResolvedAssetDeps>;
|
|
132
|
+
serverResources?: Record<string, Pick<ResolvedAssetDeps, "css">>;
|
|
133
|
+
};
|
|
134
|
+
type ResolvedAssetDeps = {
|
|
135
|
+
js: string[];
|
|
136
|
+
css: string[];
|
|
137
|
+
};
|
|
138
|
+
declare function transformRscCssExport(options: {
|
|
139
|
+
ast: Awaited<ReturnType<typeof parseAstAsync>>;
|
|
140
|
+
code: string;
|
|
141
|
+
id?: string;
|
|
142
|
+
filter: TransformWrapExportFilter;
|
|
143
|
+
}): Promise<{
|
|
144
|
+
output: MagicString;
|
|
145
|
+
} | undefined>;
|
|
146
|
+
//#endregion
|
|
147
|
+
export { AssetDeps, AssetsManifest, PluginApi, ResolvedAssetDeps, ResolvedAssetsManifest, type RscPluginManager, RscPluginOptions, vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./transforms-BcLQCXiC.js";
|
|
2
2
|
import "./rpc-CRpYrgKq.js";
|
|
3
|
-
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
3
|
+
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-DNlyqBiD.js";
|
|
4
4
|
import "./cjs-DHD_0drE.js";
|
|
5
5
|
|
|
6
6
|
export { vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/react/browser.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { n as CallServerCallback } from "../index-
|
|
2
|
-
import { t as setRequireModule } from "../browser-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { n as CallServerCallback } from "../index-DqoQPvhP.js";
|
|
2
|
+
import { t as setRequireModule } from "../browser-BmyjVnfA.js";
|
|
3
|
+
|
|
4
|
+
//#region src/react/browser.d.ts
|
|
5
|
+
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
6
|
+
declare function createFromFetch<T>(promiseForResponse: Promise<Response>, options?: object): Promise<T>;
|
|
7
|
+
declare const encodeReply: (v: unknown[], options?: unknown) => Promise<string | FormData>;
|
|
8
|
+
declare const createServerReference: (...args: any[]) => unknown;
|
|
9
|
+
declare function callServer(...args: any[]): any;
|
|
10
|
+
declare function setServerCallback(fn: CallServerCallback): void;
|
|
11
|
+
declare const createTemporaryReferenceSet: () => unknown;
|
|
12
|
+
declare function findSourceMapURL(filename: string, environmentName: string): string | null;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { type CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/react/browser.js
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { setRequireModule } from "../core/browser.js";
|
|
2
|
+
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.browser";
|
|
3
3
|
|
|
4
|
+
//#region src/react/browser.ts
|
|
5
|
+
function createFromReadableStream(stream, options = {}) {
|
|
6
|
+
return ReactClient.createFromReadableStream(stream, {
|
|
7
|
+
callServer,
|
|
8
|
+
findSourceMapURL,
|
|
9
|
+
...options
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function createFromFetch(promiseForResponse, options = {}) {
|
|
13
|
+
return ReactClient.createFromFetch(promiseForResponse, {
|
|
14
|
+
callServer,
|
|
15
|
+
findSourceMapURL,
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const encodeReply = ReactClient.encodeReply;
|
|
20
|
+
const createServerReference = ReactClient.createServerReference;
|
|
21
|
+
function callServer(...args) {
|
|
22
|
+
return globalThis.__viteRscCallServer(...args);
|
|
23
|
+
}
|
|
24
|
+
function setServerCallback(fn) {
|
|
25
|
+
globalThis.__viteRscCallServer = fn;
|
|
26
|
+
}
|
|
27
|
+
const createTemporaryReferenceSet = ReactClient.createTemporaryReferenceSet;
|
|
28
|
+
function findSourceMapURL(filename, environmentName) {
|
|
29
|
+
const url = new URL(
|
|
30
|
+
/* @vite-ignore */
|
|
31
|
+
"/__vite_rsc_findSourceMapURL",
|
|
32
|
+
import.meta.url
|
|
33
|
+
);
|
|
34
|
+
url.searchParams.set("filename", filename);
|
|
35
|
+
url.searchParams.set("environmentName", environmentName);
|
|
36
|
+
return url.toString();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
4
40
|
export { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/react/rsc.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { loadServerAction, setRequireModule } from "../core/rsc.js";
|
|
2
|
+
import { ReactFormState } from "react-dom/client";
|
|
3
|
+
|
|
4
|
+
//#region src/react/rsc.d.ts
|
|
5
|
+
declare function renderToReadableStream<T>(data: T, options?: object): ReadableStream<Uint8Array>;
|
|
6
|
+
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
7
|
+
declare function registerClientReference<T>(proxy: T, id: string, name: string): T;
|
|
8
|
+
declare const registerServerReference: <T>(ref: T, id: string, name: string) => T;
|
|
9
|
+
declare function decodeReply(body: string | FormData, options?: unknown): Promise<unknown[]>;
|
|
10
|
+
declare function decodeAction(body: FormData): Promise<() => Promise<void>>;
|
|
11
|
+
declare function decodeFormState(actionResult: unknown, body: FormData): Promise<ReactFormState | undefined>;
|
|
12
|
+
declare const createTemporaryReferenceSet: () => unknown;
|
|
13
|
+
declare const encodeReply: (v: unknown[], options?: unknown) => Promise<string | FormData>;
|
|
14
|
+
declare const createClientTemporaryReferenceSet: () => unknown;
|
|
15
|
+
//#endregion
|
|
3
16
|
export { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/react/rsc.js
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
import { a as setRequireModule, i as loadServerAction } from "../rsc-
|
|
2
|
-
import
|
|
1
|
+
import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-BRh4PjTs.js";
|
|
2
|
+
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
|
+
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
3
4
|
|
|
5
|
+
//#region src/react/rsc.ts
|
|
6
|
+
function renderToReadableStream(data, options) {
|
|
7
|
+
return ReactServer.renderToReadableStream(data, createClientManifest(), options);
|
|
8
|
+
}
|
|
9
|
+
function createFromReadableStream(stream, options = {}) {
|
|
10
|
+
return ReactClient.createFromReadableStream(stream, {
|
|
11
|
+
serverConsumerManifest: {
|
|
12
|
+
serverModuleMap: createServerManifest(),
|
|
13
|
+
moduleMap: createServerDecodeClientManifest()
|
|
14
|
+
},
|
|
15
|
+
...options
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function registerClientReference(proxy, id, name) {
|
|
19
|
+
return ReactServer.registerClientReference(proxy, id, name);
|
|
20
|
+
}
|
|
21
|
+
const registerServerReference = ReactServer.registerServerReference;
|
|
22
|
+
function decodeReply(body, options) {
|
|
23
|
+
return ReactServer.decodeReply(body, createServerManifest(), options);
|
|
24
|
+
}
|
|
25
|
+
function decodeAction(body) {
|
|
26
|
+
return ReactServer.decodeAction(body, createServerManifest());
|
|
27
|
+
}
|
|
28
|
+
function decodeFormState(actionResult, body) {
|
|
29
|
+
return ReactServer.decodeFormState(actionResult, body, createServerManifest());
|
|
30
|
+
}
|
|
31
|
+
const createTemporaryReferenceSet = ReactServer.createTemporaryReferenceSet;
|
|
32
|
+
const encodeReply = ReactClient.encodeReply;
|
|
33
|
+
const createClientTemporaryReferenceSet = ReactClient.createTemporaryReferenceSet;
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
4
36
|
export { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/react/ssr.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { setRequireModule } from "../core/ssr.js";
|
|
2
|
+
|
|
3
|
+
//#region src/react/ssr.d.ts
|
|
4
|
+
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
5
|
+
declare function createServerReference(id: string): unknown;
|
|
6
|
+
declare const callServer: null;
|
|
7
|
+
declare const findSourceMapURL: null;
|
|
8
|
+
//#endregion
|
|
3
9
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/react/ssr.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { createServerConsumerManifest, setRequireModule } from "../core/ssr.js";
|
|
2
|
+
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
3
|
|
|
4
|
+
//#region src/react/ssr.ts
|
|
5
|
+
function createFromReadableStream(stream, options = {}) {
|
|
6
|
+
return ReactClient.createFromReadableStream(stream, {
|
|
7
|
+
serverConsumerManifest: createServerConsumerManifest(),
|
|
8
|
+
...options
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function createServerReference(id) {
|
|
12
|
+
return ReactClient.createServerReference(id);
|
|
13
|
+
}
|
|
14
|
+
const callServer = null;
|
|
15
|
+
const findSourceMapURL = null;
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
4
18
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/rsc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./core/rsc.js";
|
|
2
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./react/rsc.js";
|
|
3
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./utils/encryption-runtime.js";
|
|
4
4
|
export { createClientManifest, createClientTemporaryReferenceSet, createFromReadableStream, createServerManifest, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decryptActionBoundArgs, encodeReply, encryptActionBoundArgs, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/rsc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as toReferenceValidationVirtual } from "./shared-AtH_QTi7.js";
|
|
2
|
-
import { a as setRequireModule, i as loadServerAction, r as createServerManifest, t as createClientManifest } from "./rsc-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { a as setRequireModule, i as loadServerAction, r as createServerManifest, t as createClientManifest } from "./rsc-BRh4PjTs.js";
|
|
3
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./react/rsc.js";
|
|
4
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./utils/encryption-runtime.js";
|
|
5
5
|
import serverReferences from "virtual:vite-rsc/server-references";
|
|
6
6
|
|
|
7
7
|
//#region src/rsc.tsx
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createServerConsumerManifest, setRequireModule } from "./core/ssr.js";
|
|
2
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./react/ssr.js";
|
|
3
3
|
export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/ssr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as toReferenceValidationVirtual, i as toCssVirtual } from "./shared-AtH_QTi7.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createServerConsumerManifest, setRequireModule } from "./core/ssr.js";
|
|
3
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./react/ssr.js";
|
|
4
4
|
import * as clientReferences from "virtual:vite-rsc/client-references";
|
|
5
5
|
import assetsManifest from "virtual:vite-rsc/assets-manifest";
|
|
6
6
|
import * as ReactDOM from "react-dom";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as transformDirectiveProxyExport, c as TransformWrapExportOptions, d as transformHoistInlineDirective, i as TransformProxyExportOptions, l as transformWrapExport, n as getExportNames, o as transformProxyExport, r as hasDirective, s as TransformWrapExportFilter, t as transformServerActionServer, u as findDirectives } from "../index-
|
|
1
|
+
import { a as transformDirectiveProxyExport, c as TransformWrapExportOptions, d as transformHoistInlineDirective, i as TransformProxyExportOptions, l as transformWrapExport, n as getExportNames, o as transformProxyExport, r as hasDirective, s as TransformWrapExportFilter, t as transformServerActionServer, u as findDirectives } from "../index-CFOPl4Gi.js";
|
|
2
2
|
export { TransformProxyExportOptions, TransformWrapExportFilter, TransformWrapExportOptions, findDirectives, getExportNames, hasDirective, transformDirectiveProxyExport, transformHoistInlineDirective, transformProxyExport, transformServerActionServer, transformWrapExport };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/encryption-runtime.d.ts
|
|
2
|
+
declare function encryptActionBoundArgs(originalValue: unknown): Promise<string>;
|
|
3
|
+
declare function decryptActionBoundArgs(encrypted: ReturnType<typeof encryptActionBoundArgs>): Promise<unknown>;
|
|
4
|
+
//#endregion
|
|
2
5
|
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import
|
|
1
|
+
import { r as once } from "../dist-BRSdGcl7.js";
|
|
2
|
+
import { a as fromBase64, i as encryptBuffer, n as concatArrayStream, r as decryptBuffer, t as arrayToStream } from "../encryption-utils-6p8t4Xqm.js";
|
|
3
|
+
import "../rsc-BRh4PjTs.js";
|
|
4
|
+
import { createFromReadableStream, renderToReadableStream } from "../react/rsc.js";
|
|
5
|
+
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
4
6
|
|
|
7
|
+
//#region src/utils/encryption-runtime.ts
|
|
8
|
+
async function encryptActionBoundArgs(originalValue) {
|
|
9
|
+
return encryptBuffer(await concatArrayStream(renderToReadableStream(originalValue)), await getEncryptionKey());
|
|
10
|
+
}
|
|
11
|
+
async function decryptActionBoundArgs(encrypted) {
|
|
12
|
+
const serializedBuffer = await decryptBuffer(await encrypted, await getEncryptionKey());
|
|
13
|
+
return createFromReadableStream(arrayToStream(new Uint8Array(serializedBuffer)));
|
|
14
|
+
}
|
|
15
|
+
const getEncryptionKey = /* @__PURE__ */ once(async () => {
|
|
16
|
+
const resolved = await encryptionKeySource();
|
|
17
|
+
return await crypto.subtle.importKey("raw", fromBase64(resolved), { name: "AES-GCM" }, true, ["encrypt", "decrypt"]);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
5
21
|
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-rsc",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "React Server Components (RSC) support for Vite.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"estree-walker": "^3.0.3",
|
|
44
44
|
"magic-string": "^0.30.21",
|
|
45
45
|
"periscopic": "^4.0.2",
|
|
46
|
-
"srvx": "^0.
|
|
46
|
+
"srvx": "^0.10.0",
|
|
47
47
|
"strip-literal": "^3.1.0",
|
|
48
48
|
"turbo-stream": "^3.1.0",
|
|
49
49
|
"vitefu": "^1.1.1"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-dom": "^19.2.3",
|
|
64
64
|
"react-server-dom-webpack": "^19.2.3",
|
|
65
65
|
"tinyexec": "^1.0.2",
|
|
66
|
-
"tsdown": "^0.
|
|
66
|
+
"tsdown": "^0.18.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "*",
|
package/dist/browser-BJvYpz0J.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.browser";
|
|
2
|
-
|
|
3
|
-
//#region src/react/browser.ts
|
|
4
|
-
function createFromReadableStream(stream, options = {}) {
|
|
5
|
-
return ReactClient.createFromReadableStream(stream, {
|
|
6
|
-
callServer,
|
|
7
|
-
findSourceMapURL,
|
|
8
|
-
...options
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function createFromFetch(promiseForResponse, options = {}) {
|
|
12
|
-
return ReactClient.createFromFetch(promiseForResponse, {
|
|
13
|
-
callServer,
|
|
14
|
-
findSourceMapURL,
|
|
15
|
-
...options
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const encodeReply = ReactClient.encodeReply;
|
|
19
|
-
const createServerReference = ReactClient.createServerReference;
|
|
20
|
-
function callServer(...args) {
|
|
21
|
-
return globalThis.__viteRscCallServer(...args);
|
|
22
|
-
}
|
|
23
|
-
function setServerCallback(fn) {
|
|
24
|
-
globalThis.__viteRscCallServer = fn;
|
|
25
|
-
}
|
|
26
|
-
const createTemporaryReferenceSet = ReactClient.createTemporaryReferenceSet;
|
|
27
|
-
function findSourceMapURL(filename, environmentName) {
|
|
28
|
-
const url = new URL("/__vite_rsc_findSourceMapURL", window.location.origin);
|
|
29
|
-
url.searchParams.set("filename", filename);
|
|
30
|
-
url.searchParams.set("environmentName", environmentName);
|
|
31
|
-
return url.toString();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
export { createTemporaryReferenceSet as a, setServerCallback as c, createServerReference as i, createFromFetch as n, encodeReply as o, createFromReadableStream as r, findSourceMapURL as s, callServer as t };
|
package/dist/browser-Dtp2JGlz.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { n as memoize } from "./dist-BRSdGcl7.js";
|
|
2
|
-
import { a as setInternalRequire, i as removeReferenceCacheTag } from "./shared-DEpnONZf.js";
|
|
3
|
-
|
|
4
|
-
//#region src/core/browser.ts
|
|
5
|
-
let init = false;
|
|
6
|
-
function setRequireModule(options) {
|
|
7
|
-
if (init) return;
|
|
8
|
-
init = true;
|
|
9
|
-
const requireModule = memoize((id) => {
|
|
10
|
-
return options.load(removeReferenceCacheTag(id));
|
|
11
|
-
});
|
|
12
|
-
globalThis.__vite_rsc_client_require__ = requireModule;
|
|
13
|
-
setInternalRequire();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { setRequireModule as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { n as CallServerCallback } from "./index-CvmuS4Ks.js";
|
|
2
|
-
|
|
3
|
-
//#region src/react/browser.d.ts
|
|
4
|
-
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
5
|
-
declare function createFromFetch<T>(promiseForResponse: Promise<Response>, options?: object): Promise<T>;
|
|
6
|
-
declare const encodeReply: (v: unknown[], options?: unknown) => Promise<string | FormData>;
|
|
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: () => unknown;
|
|
11
|
-
declare function findSourceMapURL(filename: string, environmentName: string): string | null;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { createTemporaryReferenceSet as a, setServerCallback as c, createServerReference as i, createFromFetch as n, encodeReply as o, createFromReadableStream as r, findSourceMapURL as s, callServer as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
//#region src/utils/encryption-runtime.d.ts
|
|
2
|
-
declare function encryptActionBoundArgs(originalValue: unknown): Promise<string>;
|
|
3
|
-
declare function decryptActionBoundArgs(encrypted: ReturnType<typeof encryptActionBoundArgs>): Promise<unknown>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { encryptActionBoundArgs as n, decryptActionBoundArgs as t };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { r as once } from "./dist-BRSdGcl7.js";
|
|
2
|
-
import { a as fromBase64, i as encryptBuffer, n as concatArrayStream, r as decryptBuffer, t as arrayToStream } from "./encryption-utils-6p8t4Xqm.js";
|
|
3
|
-
import { n as createFromReadableStream, u as renderToReadableStream } from "./rsc-BIM0wUrP.js";
|
|
4
|
-
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
5
|
-
|
|
6
|
-
//#region src/utils/encryption-runtime.ts
|
|
7
|
-
async function encryptActionBoundArgs(originalValue) {
|
|
8
|
-
return encryptBuffer(await concatArrayStream(renderToReadableStream(originalValue)), await getEncryptionKey());
|
|
9
|
-
}
|
|
10
|
-
async function decryptActionBoundArgs(encrypted) {
|
|
11
|
-
const serializedBuffer = await decryptBuffer(await encrypted, await getEncryptionKey());
|
|
12
|
-
return createFromReadableStream(arrayToStream(new Uint8Array(serializedBuffer)));
|
|
13
|
-
}
|
|
14
|
-
const getEncryptionKey = /* @__PURE__ */ once(async () => {
|
|
15
|
-
const resolved = await encryptionKeySource();
|
|
16
|
-
return await crypto.subtle.importKey("raw", fromBase64(resolved), { name: "AES-GCM" }, true, ["encrypt", "decrypt"]);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { encryptActionBoundArgs as n, decryptActionBoundArgs as t };
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { s as TransformWrapExportFilter } from "./index-CM9Mmb_C.js";
|
|
2
|
-
import MagicString from "magic-string";
|
|
3
|
-
import { Plugin, ResolvedConfig, Rollup, ViteDevServer, parseAstAsync } from "vite";
|
|
4
|
-
|
|
5
|
-
//#region src/plugin.d.ts
|
|
6
|
-
type ClientReferenceMeta = {
|
|
7
|
-
importId: string;
|
|
8
|
-
referenceKey: string;
|
|
9
|
-
packageSource?: string;
|
|
10
|
-
exportNames: string[];
|
|
11
|
-
renderedExports: string[];
|
|
12
|
-
serverChunk?: string;
|
|
13
|
-
groupChunkId?: string;
|
|
14
|
-
};
|
|
15
|
-
type ServerRerferenceMeta = {
|
|
16
|
-
importId: string;
|
|
17
|
-
referenceKey: string;
|
|
18
|
-
exportNames: string[];
|
|
19
|
-
};
|
|
20
|
-
declare class RscPluginManager {
|
|
21
|
-
server: ViteDevServer;
|
|
22
|
-
config: ResolvedConfig;
|
|
23
|
-
rscBundle: Rollup.OutputBundle;
|
|
24
|
-
buildAssetsManifest: AssetsManifest | undefined;
|
|
25
|
-
isScanBuild: boolean;
|
|
26
|
-
clientReferenceMetaMap: Record<string, ClientReferenceMeta>;
|
|
27
|
-
clientReferenceGroups: Record<string, ClientReferenceMeta[]>;
|
|
28
|
-
serverReferenceMetaMap: Record<string, ServerRerferenceMeta>;
|
|
29
|
-
serverResourcesMetaMap: Record<string, {
|
|
30
|
-
key: string;
|
|
31
|
-
}>;
|
|
32
|
-
stabilize(): void;
|
|
33
|
-
toRelativeId(id: string): string;
|
|
34
|
-
}
|
|
35
|
-
type RscPluginOptions = {
|
|
36
|
-
/**
|
|
37
|
-
* shorthand for configuring `environments.(name).build.rollupOptions.input.index`
|
|
38
|
-
*/
|
|
39
|
-
entries?: Partial<Record<"client" | "ssr" | "rsc", string>>;
|
|
40
|
-
/** @default { enviornmentName: "rsc", entryName: "index" } */
|
|
41
|
-
serverHandler?: {
|
|
42
|
-
environmentName: string;
|
|
43
|
-
entryName: string;
|
|
44
|
-
} | false;
|
|
45
|
-
/** @default false */
|
|
46
|
-
loadModuleDevProxy?: boolean;
|
|
47
|
-
rscCssTransform?: false | {
|
|
48
|
-
filter?: (id: string) => boolean;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* This option allows customizing how client build copies assets from server build.
|
|
52
|
-
* By default, all assets are copied, but frameworks can establish server asset convention
|
|
53
|
-
* to tighten security using this option.
|
|
54
|
-
*/
|
|
55
|
-
copyServerAssetsToClient?: (fileName: string) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* This option allows disabling action closure encryption for debugging purpose.
|
|
58
|
-
* @default true
|
|
59
|
-
*/
|
|
60
|
-
enableActionEncryption?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* By default, the plugin uses a build-time generated encryption key for
|
|
63
|
-
* "use server" closure argument binding.
|
|
64
|
-
* This can be overwritten by configuring `defineEncryptionKey` option,
|
|
65
|
-
* for example, to obtain a key through environment variable during runtime.
|
|
66
|
-
* cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
|
|
67
|
-
*/
|
|
68
|
-
defineEncryptionKey?: string;
|
|
69
|
-
/** Escape hatch for Waku's `allowServer` */
|
|
70
|
-
keepUseCientProxy?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Enable build-time validation of 'client-only' and 'server-only' imports
|
|
73
|
-
* @default true
|
|
74
|
-
*/
|
|
75
|
-
validateImports?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
|
|
78
|
-
* for better composability with other plugins.
|
|
79
|
-
* @default true since Vite 7
|
|
80
|
-
*/
|
|
81
|
-
useBuildAppHook?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Custom environment configuration
|
|
84
|
-
* @experimental
|
|
85
|
-
* @default { browser: 'client', ssr: 'ssr', rsc: 'rsc' }
|
|
86
|
-
*/
|
|
87
|
-
environment?: {
|
|
88
|
-
browser?: string;
|
|
89
|
-
ssr?: string;
|
|
90
|
-
rsc?: string;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* Custom chunking strategy for client reference modules.
|
|
94
|
-
*
|
|
95
|
-
* This function allows you to group multiple client components into
|
|
96
|
-
* custom chunks instead of having each module in its own chunk.
|
|
97
|
-
* By default, client chunks are grouped by `meta.serverChunk`.
|
|
98
|
-
*/
|
|
99
|
-
clientChunks?: (meta: {
|
|
100
|
-
/** client reference module id */
|
|
101
|
-
id: string;
|
|
102
|
-
/** normalized client reference module id */
|
|
103
|
-
normalizedId: string;
|
|
104
|
-
/** server chunk which includes a corresponding client reference proxy module */
|
|
105
|
-
serverChunk: string;
|
|
106
|
-
}) => string | undefined;
|
|
107
|
-
};
|
|
108
|
-
type PluginApi = {
|
|
109
|
-
manager: RscPluginManager;
|
|
110
|
-
};
|
|
111
|
-
/** @experimental */
|
|
112
|
-
declare function getPluginApi(config: Pick<ResolvedConfig, "plugins">): PluginApi | undefined;
|
|
113
|
-
/** @experimental */
|
|
114
|
-
declare function vitePluginRscMinimal(rscPluginOptions?: RscPluginOptions, manager?: RscPluginManager): Plugin[];
|
|
115
|
-
declare function vitePluginRsc(rscPluginOptions?: RscPluginOptions): Plugin[];
|
|
116
|
-
declare class RuntimeAsset {
|
|
117
|
-
runtime: string;
|
|
118
|
-
constructor(value: string);
|
|
119
|
-
}
|
|
120
|
-
type AssetsManifest = {
|
|
121
|
-
bootstrapScriptContent: string | RuntimeAsset;
|
|
122
|
-
clientReferenceDeps: Record<string, AssetDeps>;
|
|
123
|
-
serverResources?: Record<string, Pick<AssetDeps, "css">>;
|
|
124
|
-
};
|
|
125
|
-
type AssetDeps = {
|
|
126
|
-
js: (string | RuntimeAsset)[];
|
|
127
|
-
css: (string | RuntimeAsset)[];
|
|
128
|
-
};
|
|
129
|
-
type ResolvedAssetsManifest = {
|
|
130
|
-
bootstrapScriptContent: string;
|
|
131
|
-
clientReferenceDeps: Record<string, ResolvedAssetDeps>;
|
|
132
|
-
serverResources?: Record<string, Pick<ResolvedAssetDeps, "css">>;
|
|
133
|
-
};
|
|
134
|
-
type ResolvedAssetDeps = {
|
|
135
|
-
js: string[];
|
|
136
|
-
css: string[];
|
|
137
|
-
};
|
|
138
|
-
declare function transformRscCssExport(options: {
|
|
139
|
-
ast: Awaited<ReturnType<typeof parseAstAsync>>;
|
|
140
|
-
code: string;
|
|
141
|
-
id?: string;
|
|
142
|
-
filter: TransformWrapExportFilter;
|
|
143
|
-
}): Promise<{
|
|
144
|
-
output: MagicString;
|
|
145
|
-
} | undefined>;
|
|
146
|
-
//#endregion
|
|
147
|
-
export { ResolvedAssetsManifest as a, getPluginApi as c, vitePluginRscMinimal as d, ResolvedAssetDeps as i, transformRscCssExport as l, AssetsManifest as n, RscPluginManager as o, PluginApi as r, RscPluginOptions as s, AssetDeps as t, vitePluginRsc as u };
|
package/dist/rsc-BIM0wUrP.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "./rsc-BwsRzIFM.js";
|
|
2
|
-
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
|
-
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
4
|
-
|
|
5
|
-
//#region src/react/rsc.ts
|
|
6
|
-
function renderToReadableStream(data, options) {
|
|
7
|
-
return ReactServer.renderToReadableStream(data, createClientManifest(), options);
|
|
8
|
-
}
|
|
9
|
-
function createFromReadableStream(stream, options = {}) {
|
|
10
|
-
return ReactClient.createFromReadableStream(stream, {
|
|
11
|
-
serverConsumerManifest: {
|
|
12
|
-
serverModuleMap: createServerManifest(),
|
|
13
|
-
moduleMap: createServerDecodeClientManifest()
|
|
14
|
-
},
|
|
15
|
-
...options
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function registerClientReference(proxy, id, name) {
|
|
19
|
-
return ReactServer.registerClientReference(proxy, id, name);
|
|
20
|
-
}
|
|
21
|
-
const registerServerReference = ReactServer.registerServerReference;
|
|
22
|
-
function decodeReply(body, options) {
|
|
23
|
-
return ReactServer.decodeReply(body, createServerManifest(), options);
|
|
24
|
-
}
|
|
25
|
-
function decodeAction(body) {
|
|
26
|
-
return ReactServer.decodeAction(body, createServerManifest());
|
|
27
|
-
}
|
|
28
|
-
function decodeFormState(actionResult, body) {
|
|
29
|
-
return ReactServer.decodeFormState(actionResult, body, createServerManifest());
|
|
30
|
-
}
|
|
31
|
-
const createTemporaryReferenceSet = ReactServer.createTemporaryReferenceSet;
|
|
32
|
-
const encodeReply = ReactClient.encodeReply;
|
|
33
|
-
const createClientTemporaryReferenceSet = ReactClient.createTemporaryReferenceSet;
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { decodeFormState as a, registerClientReference as c, decodeAction as i, registerServerReference as l, createFromReadableStream as n, decodeReply as o, createTemporaryReferenceSet as r, encodeReply as s, createClientTemporaryReferenceSet as t, renderToReadableStream as u };
|
package/dist/rsc-GHO-HEzG.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { r as ModuleMap, t as BundlerConfig } from "./index-CvmuS4Ks.js";
|
|
2
|
-
|
|
3
|
-
//#region src/core/rsc.d.ts
|
|
4
|
-
declare function setRequireModule(options: {
|
|
5
|
-
load: (id: string) => unknown;
|
|
6
|
-
}): void;
|
|
7
|
-
declare function loadServerAction(id: string): Promise<Function>;
|
|
8
|
-
declare function createServerManifest(): BundlerConfig;
|
|
9
|
-
declare function createServerDecodeClientManifest(): ModuleMap;
|
|
10
|
-
declare function createClientManifest(): BundlerConfig;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { setRequireModule as a, loadServerAction as i, createServerDecodeClientManifest as n, createServerManifest as r, createClientManifest as t };
|
package/dist/rsc-g5utSLBE.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactFormState } from "react-dom/client";
|
|
2
|
-
|
|
3
|
-
//#region src/react/rsc.d.ts
|
|
4
|
-
declare function renderToReadableStream<T>(data: T, options?: object): ReadableStream<Uint8Array>;
|
|
5
|
-
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
6
|
-
declare function registerClientReference<T>(proxy: T, id: string, name: string): T;
|
|
7
|
-
declare const registerServerReference: <T>(ref: T, id: string, name: string) => T;
|
|
8
|
-
declare function decodeReply(body: string | FormData, options?: unknown): Promise<unknown[]>;
|
|
9
|
-
declare function decodeAction(body: FormData): Promise<() => Promise<void>>;
|
|
10
|
-
declare function decodeFormState(actionResult: unknown, body: FormData): Promise<ReactFormState | undefined>;
|
|
11
|
-
declare const createTemporaryReferenceSet: () => unknown;
|
|
12
|
-
declare const encodeReply: (v: unknown[], options?: unknown) => Promise<string | FormData>;
|
|
13
|
-
declare const createClientTemporaryReferenceSet: () => unknown;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { decodeFormState as a, registerClientReference as c, decodeAction as i, registerServerReference as l, createFromReadableStream as n, decodeReply as o, createTemporaryReferenceSet as r, encodeReply as s, createClientTemporaryReferenceSet as t, renderToReadableStream as u };
|
package/dist/ssr-B-bLmlbm.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { t as createServerConsumerManifest } from "./ssr-CDPTWY93.js";
|
|
2
|
-
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
|
-
|
|
4
|
-
//#region src/react/ssr.ts
|
|
5
|
-
function createFromReadableStream(stream, options = {}) {
|
|
6
|
-
return ReactClient.createFromReadableStream(stream, {
|
|
7
|
-
serverConsumerManifest: createServerConsumerManifest(),
|
|
8
|
-
...options
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function createServerReference(id) {
|
|
12
|
-
return ReactClient.createServerReference(id);
|
|
13
|
-
}
|
|
14
|
-
const callServer = null;
|
|
15
|
-
const findSourceMapURL = null;
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { findSourceMapURL as i, createFromReadableStream as n, createServerReference as r, callServer as t };
|
package/dist/ssr-Bnw-VQBr.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region src/react/ssr.d.ts
|
|
2
|
-
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
3
|
-
declare function createServerReference(id: string): unknown;
|
|
4
|
-
declare const callServer: null;
|
|
5
|
-
declare const findSourceMapURL: null;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { findSourceMapURL as i, createFromReadableStream as n, createServerReference as r, callServer as t };
|
package/dist/ssr-CB7zlVBC.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { i as ServerConsumerManifest } from "./index-CvmuS4Ks.js";
|
|
2
|
-
|
|
3
|
-
//#region src/core/ssr.d.ts
|
|
4
|
-
declare function setRequireModule(options: {
|
|
5
|
-
load: (id: string) => unknown;
|
|
6
|
-
}): void;
|
|
7
|
-
declare function createServerConsumerManifest(): ServerConsumerManifest;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { setRequireModule as n, createServerConsumerManifest as t };
|
package/dist/ssr-CDPTWY93.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { n as memoize } from "./dist-BRSdGcl7.js";
|
|
2
|
-
import { a as setInternalRequire, i as removeReferenceCacheTag } from "./shared-DEpnONZf.js";
|
|
3
|
-
|
|
4
|
-
//#region src/core/ssr.ts
|
|
5
|
-
let init = false;
|
|
6
|
-
function setRequireModule(options) {
|
|
7
|
-
if (init) return;
|
|
8
|
-
init = true;
|
|
9
|
-
const requireModule = memoize((id) => {
|
|
10
|
-
return options.load(removeReferenceCacheTag(id));
|
|
11
|
-
});
|
|
12
|
-
const clientRequire = (id) => {
|
|
13
|
-
return requireModule(id);
|
|
14
|
-
};
|
|
15
|
-
globalThis.__vite_rsc_client_require__ = clientRequire;
|
|
16
|
-
setInternalRequire();
|
|
17
|
-
}
|
|
18
|
-
function createServerConsumerManifest() {
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { setRequireModule as n, createServerConsumerManifest as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|