@vitejs/plugin-rsc 0.5.9 → 0.5.11
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 +35 -4
- 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-YfacRKGB.js → plugin-BcfVRLx-.js} +41 -11
- package/dist/plugin.d.ts +150 -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/types/index.d.ts +1 -1
- 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/README.md
CHANGED
|
@@ -224,11 +224,13 @@ The plugin provides an additional helper for multi environment interaction.
|
|
|
224
224
|
|
|
225
225
|
#### `import.meta.viteRsc.loadModule`
|
|
226
226
|
|
|
227
|
-
- Type: `(environmentName: "ssr" | "rsc", entryName
|
|
227
|
+
- Type: `(environmentName: "ssr" | "rsc", entryName?: string) => Promise<T>`
|
|
228
228
|
|
|
229
|
-
This allows importing `ssr` environment module specified by `environments.ssr.build.rollupOptions.input[entryName]` inside `rsc` environment and vice versa.
|
|
229
|
+
This allows importing `ssr` environment module specified by `environments.ssr.build.rollupOptions.input[entryName]` inside `rsc` environment and vice versa. When `entryName` is omitted, the function automatically uses the single entry from the target environment's `rollupOptions.input`.
|
|
230
230
|
|
|
231
|
-
During development, by default, this API assumes both `rsc` and `ssr` environments execute under the main Vite process
|
|
231
|
+
During development, by default, this API assumes both `rsc` and `ssr` environments execute under the main Vite process as `RunnableDevEnvironment`. Internally, `loadModule` uses the global `__VITE_ENVIRONMENT_RUNNER_IMPORT__` function to import modules in the target environment (see [`__VITE_ENVIRONMENT_RUNNER_IMPORT__`](#__vite_environment_runner_import__) below).
|
|
232
|
+
|
|
233
|
+
When enabling `rsc({ loadModuleDevProxy: true })` plugin option, the loaded module is implemented as a proxy with `fetch`-based RPC to call in node environment on the main Vite process, which for example, allows `rsc` environment inside cloudflare workers to access `ssr` environment on the main Vite process. This proxy mechanism uses [turbo-stream](https://github.com/jacob-ebey/turbo-stream) for serializing data types beyond JSON, with custom encoders/decoders to additionally support `Request` and `Response` instances.
|
|
232
234
|
|
|
233
235
|
During production build, this API will be rewritten into a static import of the specified entry of other environment build and the modules are executed inside the same runtime.
|
|
234
236
|
|
|
@@ -327,6 +329,35 @@ import.meta.hot.on('rsc:update', async () => {
|
|
|
327
329
|
})
|
|
328
330
|
```
|
|
329
331
|
|
|
332
|
+
### Global API
|
|
333
|
+
|
|
334
|
+
#### `__VITE_ENVIRONMENT_RUNNER_IMPORT__`
|
|
335
|
+
|
|
336
|
+
- Type: `(environmentName: string, id: string) => Promise<any>`
|
|
337
|
+
|
|
338
|
+
This global function provides a standardized way to import a module in a given environment during development. It is used internally by `import.meta.viteRsc.loadModule` to execute modules in the target environment.
|
|
339
|
+
|
|
340
|
+
By default, the plugin sets this global to import via the environment's module runner:
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async (environmentName, id) => {
|
|
344
|
+
return server.environments[environmentName].runner.import(id)
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Custom Environment Integration:**
|
|
349
|
+
|
|
350
|
+
Frameworks with custom environment setups (e.g., environments running in separate workers or with custom module loading) can override this global to provide their own module import logic.
|
|
351
|
+
|
|
352
|
+
```js
|
|
353
|
+
// Custom logic to import module between multiple environments inside worker
|
|
354
|
+
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async (environmentName, id) => {
|
|
355
|
+
return myWorkerRunners[environmentname].import(id)
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
This allows `import.meta.viteRsc.loadModule` to work seamlessly with different runtime configurations without requiring changes to user code.
|
|
360
|
+
|
|
330
361
|
## Plugin API
|
|
331
362
|
|
|
332
363
|
### `@vitejs/plugin-rsc`
|
|
@@ -519,7 +550,7 @@ Types for global API are defined in `@vitejs/plugin-rsc/types`. For example, you
|
|
|
519
550
|
```ts
|
|
520
551
|
import.meta.viteRsc.loadModule
|
|
521
552
|
// ^^^^^^^^^^
|
|
522
|
-
// <T>(environmentName: string, entryName
|
|
553
|
+
// <T>(environmentName: string, entryName?: string) => Promise<T>
|
|
523
554
|
```
|
|
524
555
|
|
|
525
556
|
See also [Vite documentation](https://vite.dev/guide/api-hmr.html#intellisense-for-typescript) for `vite/client` types.
|
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-BcfVRLx-.js";
|
|
4
4
|
import "./cjs-DHD_0drE.js";
|
|
5
5
|
|
|
6
6
|
export { vitePluginRsc as default, getPluginApi };
|
|
@@ -128,10 +128,27 @@ function normalizeRelativePath(s) {
|
|
|
128
128
|
s = normalizePath(s);
|
|
129
129
|
return s[0] === "." ? s : "./" + s;
|
|
130
130
|
}
|
|
131
|
-
function getEntrySource(config, name
|
|
131
|
+
function getEntrySource(config, name) {
|
|
132
132
|
const input = config.build.rollupOptions.input;
|
|
133
|
-
|
|
134
|
-
return input[name];
|
|
133
|
+
if (!name) return getFallbackRollupEntry(input).source;
|
|
134
|
+
if (typeof input === "object" && !Array.isArray(input) && name in input && typeof input[name] === "string") return input[name];
|
|
135
|
+
throw new Error(`[vite-rsc:getEntrySource] expected 'build.rollupOptions.input' to be an object with a '${name}' property that is a string, but got ${JSON.stringify(input)}`);
|
|
136
|
+
}
|
|
137
|
+
function getFallbackRollupEntry(input = {}) {
|
|
138
|
+
const inputEntries = Object.entries(normalizeRollupOpitonsInput(input));
|
|
139
|
+
if (inputEntries.length === 1) {
|
|
140
|
+
const [name, source] = inputEntries[0];
|
|
141
|
+
return {
|
|
142
|
+
name,
|
|
143
|
+
source
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
throw new Error(`[vite-rsc] cannot determine fallback entry name from multiple entries, please specify the entry name explicitly`);
|
|
147
|
+
}
|
|
148
|
+
function normalizeRollupOpitonsInput(input = {}) {
|
|
149
|
+
if (typeof input === "string") input = [input];
|
|
150
|
+
if (Array.isArray(input)) return Object.fromEntries(input.map((file) => [path.basename(file).slice(0, -path.extname(file).length), file]));
|
|
151
|
+
return input;
|
|
135
152
|
}
|
|
136
153
|
function hashString(v) {
|
|
137
154
|
return createHash("sha256").update(v).digest().toString("hex").slice(0, 12);
|
|
@@ -406,7 +423,7 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
|
|
|
406
423
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
407
424
|
const manager = new RscPluginManager();
|
|
408
425
|
const buildApp = async (builder) => {
|
|
409
|
-
const colors = await import("./picocolors-
|
|
426
|
+
const colors = await import("./picocolors-BxaHL81J.js").then(__toDynamicImportESM());
|
|
410
427
|
const logStep = (msg) => {
|
|
411
428
|
builder.config.logger.info(colors.blue(msg));
|
|
412
429
|
};
|
|
@@ -554,7 +571,12 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
554
571
|
if (rscPluginOptions.useBuildAppHook) await buildApp(builder);
|
|
555
572
|
} },
|
|
556
573
|
configureServer(server) {
|
|
557
|
-
globalThis.
|
|
574
|
+
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async function(environmentName, id) {
|
|
575
|
+
const environment$1 = server.environments[environmentName];
|
|
576
|
+
if (!environment$1) throw new Error(`[vite-rsc] unknown environment '${environmentName}'`);
|
|
577
|
+
if (!vite.isRunnableDevEnvironment(environment$1)) throw new Error(`[vite-rsc] environment '${environmentName}' is not runnable`);
|
|
578
|
+
return environment$1.runner.import(id);
|
|
579
|
+
};
|
|
558
580
|
const oldSend = server.environments.client.hot.send;
|
|
559
581
|
server.environments.client.hot.send = async function(...args) {
|
|
560
582
|
const e = args[0];
|
|
@@ -698,8 +720,16 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
698
720
|
const source = getEntrySource(environment.config, entryName);
|
|
699
721
|
const resolved = await environment.pluginContainer.resolveId(source);
|
|
700
722
|
assert(resolved, `[vite-rsc] failed to resolve entry '${source}'`);
|
|
701
|
-
replacement = `globalThis.
|
|
702
|
-
} else
|
|
723
|
+
replacement = `globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__(${JSON.stringify(environmentName)}, ${JSON.stringify(resolved.id)})`;
|
|
724
|
+
} else {
|
|
725
|
+
const environment = manager.config.environments[environmentName];
|
|
726
|
+
const targetName = entryName || getFallbackRollupEntry(environment.build.rollupOptions.input).name;
|
|
727
|
+
replacement = JSON.stringify(`__vite_rsc_load_module_start__:` + JSON.stringify({
|
|
728
|
+
fromEnv: this.environment.name,
|
|
729
|
+
toEnv: environmentName,
|
|
730
|
+
targetFileName: `${targetName}.js`
|
|
731
|
+
}) + `:__vite_rsc_load_module_end__`);
|
|
732
|
+
}
|
|
703
733
|
const [start, end] = match.indices[0];
|
|
704
734
|
s.overwrite(start, end, replacement);
|
|
705
735
|
}
|
|
@@ -712,9 +742,10 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
712
742
|
if (!code.includes("__vite_rsc_load_module")) return;
|
|
713
743
|
const { config } = manager;
|
|
714
744
|
const s = new MagicString(code);
|
|
715
|
-
for (const match of code.matchAll(/['"]
|
|
716
|
-
const
|
|
717
|
-
const
|
|
745
|
+
for (const match of code.matchAll(/[`'"]__vite_rsc_load_module_start__:([\s\S]*?):__vite_rsc_load_module_end__[`'"]/dg)) {
|
|
746
|
+
const markerString = evalValue(match[0]);
|
|
747
|
+
const { fromEnv, toEnv, targetFileName } = JSON.parse(markerString.slice(31, -29));
|
|
748
|
+
const importPath = normalizeRelativePath(path.relative(path.join(config.environments[fromEnv].build.outDir, chunk.fileName, ".."), path.join(config.environments[toEnv].build.outDir, targetFileName)));
|
|
718
749
|
const replacement = `(import(${JSON.stringify(importPath)}))`;
|
|
719
750
|
const [start, end] = match.indices[0];
|
|
720
751
|
s.overwrite(start, end, replacement);
|
|
@@ -732,7 +763,6 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
732
763
|
async function createHandler(url) {
|
|
733
764
|
const { environmentName, entryName } = Object.fromEntries(url.searchParams);
|
|
734
765
|
assert(environmentName);
|
|
735
|
-
assert(entryName);
|
|
736
766
|
const environment = server.environments[environmentName];
|
|
737
767
|
const source = getEntrySource(environment.config, entryName);
|
|
738
768
|
const resolvedEntry = await environment.pluginContainer.resolveId(source);
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,3 +1,150 @@
|
|
|
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 global {
|
|
116
|
+
function __VITE_ENVIRONMENT_RUNNER_IMPORT__(environmentName: string, id: string): Promise<any>;
|
|
117
|
+
}
|
|
118
|
+
declare function vitePluginRsc(rscPluginOptions?: RscPluginOptions): Plugin[];
|
|
119
|
+
declare class RuntimeAsset {
|
|
120
|
+
runtime: string;
|
|
121
|
+
constructor(value: string);
|
|
122
|
+
}
|
|
123
|
+
type AssetsManifest = {
|
|
124
|
+
bootstrapScriptContent: string | RuntimeAsset;
|
|
125
|
+
clientReferenceDeps: Record<string, AssetDeps>;
|
|
126
|
+
serverResources?: Record<string, Pick<AssetDeps, "css">>;
|
|
127
|
+
};
|
|
128
|
+
type AssetDeps = {
|
|
129
|
+
js: (string | RuntimeAsset)[];
|
|
130
|
+
css: (string | RuntimeAsset)[];
|
|
131
|
+
};
|
|
132
|
+
type ResolvedAssetsManifest = {
|
|
133
|
+
bootstrapScriptContent: string;
|
|
134
|
+
clientReferenceDeps: Record<string, ResolvedAssetDeps>;
|
|
135
|
+
serverResources?: Record<string, Pick<ResolvedAssetDeps, "css">>;
|
|
136
|
+
};
|
|
137
|
+
type ResolvedAssetDeps = {
|
|
138
|
+
js: string[];
|
|
139
|
+
css: string[];
|
|
140
|
+
};
|
|
141
|
+
declare function transformRscCssExport(options: {
|
|
142
|
+
ast: Awaited<ReturnType<typeof parseAstAsync>>;
|
|
143
|
+
code: string;
|
|
144
|
+
id?: string;
|
|
145
|
+
filter: TransformWrapExportFilter;
|
|
146
|
+
}): Promise<{
|
|
147
|
+
output: MagicString;
|
|
148
|
+
} | undefined>;
|
|
149
|
+
//#endregion
|
|
150
|
+
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-BcfVRLx-.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.11",
|
|
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/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ declare global {
|
|
|
2
2
|
interface ImportMeta {
|
|
3
3
|
readonly viteRsc: {
|
|
4
4
|
loadCss: (importer?: string) => import('react').ReactNode
|
|
5
|
-
loadModule: <T>(environmentName: string, entryName
|
|
5
|
+
loadModule: <T>(environmentName: string, entryName?: string) => Promise<T>
|
|
6
6
|
loadBootstrapScriptContent: (entryName: string) => Promise<string>
|
|
7
7
|
}
|
|
8
8
|
}
|
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
|