@vitejs/plugin-rsc 0.4.14 → 0.4.16
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-CeSkQWD5.d.ts → browser-mbRygLxB.d.ts} +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/rsc.d.ts +2 -2
- package/dist/core/ssr.d.ts +2 -2
- package/dist/core/ssr.js +1 -1
- package/dist/{rsc-BIUd01vh.js → encryption-runtime-D6SQwJ1j.js} +0 -19
- package/dist/encryption-runtime-SgJRa9yj.d.ts +5 -0
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/browser.js +1 -1
- package/dist/extra/rsc.d.ts +1 -1
- package/dist/extra/rsc.js +2 -1
- package/dist/extra/ssr.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-6e6xZIb7.js → plugin-C9id3xj5.js} +127 -84
- package/dist/{plugin-DXIhXGMa.d.ts → plugin-CYYsF3qY.d.ts} +19 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +2 -2
- package/dist/react/browser.d.ts +3 -3
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/ssr.d.ts +3 -3
- package/dist/react/ssr.js +2 -2
- package/dist/{rsc-BOV3yNSd.d.ts → rsc-CxDPDiLz.d.ts} +1 -1
- package/dist/rsc-DP-89iIT.js +20 -0
- package/dist/rsc-html-stream/browser.js +1 -1
- package/dist/rsc-html-stream/ssr.js +1 -1
- package/dist/rsc.d.ts +4 -8
- package/dist/rsc.js +2 -1
- package/dist/{ssr-DNwSdZ9T.js → ssr-B7_J2_Qh.js} +1 -1
- package/dist/{ssr-D5pxP29F.js → ssr-BLt64xPK.js} +1 -1
- package/dist/{ssr-DgSrGrln.d.ts → ssr-BoNKka-5.d.ts} +1 -1
- package/dist/ssr.d.ts +3 -3
- package/dist/ssr.js +3 -3
- package/dist/utils/encryption-runtime.d.ts +2 -0
- package/dist/utils/encryption-runtime.js +8 -0
- package/package.json +3 -2
- /package/dist/{browser-Dw18EFgE.d.ts → browser-CuwQIlVY.d.ts} +0 -0
- /package/dist/{client-CPc-spDn.js → client-C1J4FCf5.js} +0 -0
- /package/dist/{index-BHqtj9tT.d.ts → index-QWzVHuya.d.ts} +0 -0
- /package/dist/{rsc-DgrejoNf.d.ts → rsc-CFtzqEG8.d.ts} +0 -0
- /package/dist/{rsc-DryRyKqc.d.ts → rsc-Cv3XEZqB.d.ts} +0 -0
- /package/dist/{server-C50j-DRF.js → server-D0-DavPP.js} +0 -0
- /package/dist/{ssr-D708H86k.d.ts → ssr-D6GTzOzx.d.ts} +0 -0
- /package/dist/{ssr-BOIYlvSn.js → ssr-MYoobcMC.js} +0 -0
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallServerCallback } from "./index-
|
|
2
|
-
import { setRequireModule } from "./browser-
|
|
3
|
-
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./browser-
|
|
1
|
+
import { CallServerCallback } from "./index-QWzVHuya.js";
|
|
2
|
+
import { setRequireModule } from "./browser-CuwQIlVY.js";
|
|
3
|
+
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./browser-mbRygLxB.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/core/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { setRequireModule } from "../browser-
|
|
1
|
+
import { setRequireModule } from "../browser-CuwQIlVY.js";
|
|
2
2
|
export { setRequireModule };
|
package/dist/core/rsc.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule } from "../rsc-
|
|
1
|
+
import "../index-QWzVHuya.js";
|
|
2
|
+
import { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule } from "../rsc-CxDPDiLz.js";
|
|
3
3
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/ssr.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { createServerConsumerManifest, setRequireModule } from "../ssr-
|
|
1
|
+
import "../index-QWzVHuya.js";
|
|
2
|
+
import { createServerConsumerManifest, setRequireModule } from "../ssr-BoNKka-5.js";
|
|
3
3
|
export { createServerConsumerManifest, setRequireModule };
|
package/dist/core/ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../dist-DEF94lDJ.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { createServerConsumerManifest, setRequireModule } from "../ssr-
|
|
3
|
+
import { createServerConsumerManifest, setRequireModule } from "../ssr-MYoobcMC.js";
|
|
4
4
|
|
|
5
5
|
export { createServerConsumerManifest, setRequireModule };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { once } from "./dist-DEF94lDJ.js";
|
|
2
2
|
import { arrayToStream, concatArrayStream, decryptBuffer, encryptBuffer, fromBase64 } from "./encryption-utils-BDwwcMVT.js";
|
|
3
|
-
import { setRequireModule } from "./rsc-DKA6wwTB.js";
|
|
4
3
|
import { createFromReadableStream, renderToReadableStream } from "./rsc-DHfL29FT.js";
|
|
5
|
-
import serverReferences from "virtual:vite-rsc/server-references";
|
|
6
4
|
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
7
5
|
|
|
8
6
|
//#region src/utils/encryption-runtime.ts
|
|
@@ -22,22 +20,5 @@ const getEncryptionKey = /* @__PURE__ */ once(async () => {
|
|
|
22
20
|
return key;
|
|
23
21
|
});
|
|
24
22
|
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/rsc.tsx
|
|
27
|
-
initialize();
|
|
28
|
-
function initialize() {
|
|
29
|
-
setRequireModule({ load: async (id) => {
|
|
30
|
-
if (!import.meta.env.__vite_rsc_build__) return import(
|
|
31
|
-
/* @vite-ignore */
|
|
32
|
-
id
|
|
33
|
-
);
|
|
34
|
-
else {
|
|
35
|
-
const import_ = serverReferences[id];
|
|
36
|
-
if (!import_) throw new Error(`server reference not found '${id}'`);
|
|
37
|
-
return import_();
|
|
38
|
-
}
|
|
39
|
-
} });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
23
|
//#endregion
|
|
43
24
|
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 { decryptActionBoundArgs, encryptActionBoundArgs };
|
package/dist/extra/browser.d.ts
CHANGED
package/dist/extra/browser.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../shared-CEyKoKAb.js";
|
|
|
3
3
|
import "../browser-QWbIPyhO.js";
|
|
4
4
|
import { createFromFetch, createFromReadableStream, createTemporaryReferenceSet, encodeReply, setServerCallback } from "../browser-D8OPzpF5.js";
|
|
5
5
|
import "../browser-C1Q4O7AS.js";
|
|
6
|
-
import { rscStream } from "../client-
|
|
6
|
+
import { rscStream } from "../client-C1J4FCf5.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import ReactDomClient from "react-dom/client";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
package/dist/extra/rsc.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RscPayload, renderRequest } from "../rsc-
|
|
1
|
+
import { RscPayload, renderRequest } from "../rsc-Cv3XEZqB.js";
|
|
2
2
|
export { RscPayload, renderRequest };
|
package/dist/extra/rsc.js
CHANGED
|
@@ -3,7 +3,8 @@ import "../shared-CEyKoKAb.js";
|
|
|
3
3
|
import "../encryption-utils-BDwwcMVT.js";
|
|
4
4
|
import { loadServerAction } from "../rsc-DKA6wwTB.js";
|
|
5
5
|
import { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, renderToReadableStream } from "../rsc-DHfL29FT.js";
|
|
6
|
-
import "../
|
|
6
|
+
import "../encryption-runtime-D6SQwJ1j.js";
|
|
7
|
+
import "../rsc-DP-89iIT.js";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
|
|
9
10
|
//#region src/extra/rsc.tsx
|
package/dist/extra/ssr.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../dist-DEF94lDJ.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import "../ssr-
|
|
4
|
-
import { createFromReadableStream } from "../ssr-
|
|
5
|
-
import "../ssr-
|
|
6
|
-
import { injectRSCPayload } from "../server-
|
|
3
|
+
import "../ssr-MYoobcMC.js";
|
|
4
|
+
import { createFromReadableStream } from "../ssr-BLt64xPK.js";
|
|
5
|
+
import "../ssr-B7_J2_Qh.js";
|
|
6
|
+
import { injectRSCPayload } from "../server-D0-DavPP.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import ReactDomServer from "react-dom/server.edge";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./dist-DEF94lDJ.js";
|
|
2
2
|
import "./plugin-CZbI4rhS.js";
|
|
3
|
-
import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-
|
|
3
|
+
import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-C9id3xj5.js";
|
|
4
4
|
import "./encryption-utils-BDwwcMVT.js";
|
|
5
5
|
import "./rpc-tGuLT8PD.js";
|
|
6
6
|
import "./vite-utils-Vzd7cqfv.js";
|
|
@@ -13,7 +13,7 @@ import { createRequestListener } from "@mjackson/node-fetch-server";
|
|
|
13
13
|
import * as esModuleLexer from "es-module-lexer";
|
|
14
14
|
import MagicString from "magic-string";
|
|
15
15
|
import { defaultServerConditions, isCSSRequest, normalizePath, parseAstAsync } from "vite";
|
|
16
|
-
import { crawlFrameworkPkgs } from "vitefu";
|
|
16
|
+
import { crawlFrameworkPkgs, findClosestPkgJsonPath } from "vitefu";
|
|
17
17
|
import { walk } from "estree-walker";
|
|
18
18
|
import { analyze, extract_names } from "periscopic";
|
|
19
19
|
|
|
@@ -319,12 +319,81 @@ const require = createRequire(import.meta.url);
|
|
|
319
319
|
function resolvePackage(name) {
|
|
320
320
|
return pathToFileURL(require.resolve(name)).href;
|
|
321
321
|
}
|
|
322
|
+
/** @experimental */
|
|
323
|
+
function vitePluginRscMinimal(rscPluginOptions = {}) {
|
|
324
|
+
return [
|
|
325
|
+
{
|
|
326
|
+
name: "rsc:minimal",
|
|
327
|
+
enforce: "pre",
|
|
328
|
+
async config() {
|
|
329
|
+
await esModuleLexer.init;
|
|
330
|
+
},
|
|
331
|
+
configResolved(config_) {
|
|
332
|
+
config = config_;
|
|
333
|
+
},
|
|
334
|
+
configureServer(server_) {
|
|
335
|
+
server = server_;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: "rsc:vite-client-raw-import",
|
|
340
|
+
transform: {
|
|
341
|
+
order: "post",
|
|
342
|
+
handler(code) {
|
|
343
|
+
if (code.includes("__vite_rsc_raw_import__")) return code.replace("__vite_rsc_raw_import__", "import");
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
...vitePluginRscCore(),
|
|
348
|
+
...vitePluginUseClient(rscPluginOptions),
|
|
349
|
+
...vitePluginUseServer(rscPluginOptions),
|
|
350
|
+
...vitePluginDefineEncryptionKey(rscPluginOptions)
|
|
351
|
+
];
|
|
352
|
+
}
|
|
322
353
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
354
|
+
const buildApp = async (builder) => {
|
|
355
|
+
if (!builder.environments.ssr?.config.build.rollupOptions.input) {
|
|
356
|
+
isScanBuild = true;
|
|
357
|
+
builder.environments.rsc.config.build.write = false;
|
|
358
|
+
builder.environments.client.config.build.write = false;
|
|
359
|
+
await builder.build(builder.environments.rsc);
|
|
360
|
+
await builder.build(builder.environments.client);
|
|
361
|
+
isScanBuild = false;
|
|
362
|
+
builder.environments.rsc.config.build.write = true;
|
|
363
|
+
builder.environments.client.config.build.write = true;
|
|
364
|
+
await builder.build(builder.environments.rsc);
|
|
365
|
+
clientReferenceMetaMap = sortObject(clientReferenceMetaMap);
|
|
366
|
+
serverResourcesMetaMap = sortObject(serverResourcesMetaMap);
|
|
367
|
+
await builder.build(builder.environments.client);
|
|
368
|
+
writeAssetsManifest(["rsc"]);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
isScanBuild = true;
|
|
372
|
+
builder.environments.rsc.config.build.write = false;
|
|
373
|
+
builder.environments.ssr.config.build.write = false;
|
|
374
|
+
await builder.build(builder.environments.rsc);
|
|
375
|
+
await builder.build(builder.environments.ssr);
|
|
376
|
+
isScanBuild = false;
|
|
377
|
+
builder.environments.rsc.config.build.write = true;
|
|
378
|
+
builder.environments.ssr.config.build.write = true;
|
|
379
|
+
await builder.build(builder.environments.rsc);
|
|
380
|
+
clientReferenceMetaMap = sortObject(clientReferenceMetaMap);
|
|
381
|
+
serverResourcesMetaMap = sortObject(serverResourcesMetaMap);
|
|
382
|
+
await builder.build(builder.environments.client);
|
|
383
|
+
await builder.build(builder.environments.ssr);
|
|
384
|
+
writeAssetsManifest(["ssr", "rsc"]);
|
|
385
|
+
};
|
|
386
|
+
function writeAssetsManifest(environmentNames) {
|
|
387
|
+
const assetsManifestCode = `export default ${serializeValueWithRuntime(buildAssetsManifest)}`;
|
|
388
|
+
for (const name of environmentNames) {
|
|
389
|
+
const manifestPath = path.join(config.environments[name].build.outDir, BUILD_ASSETS_MANIFEST_NAME);
|
|
390
|
+
fs.writeFileSync(manifestPath, assetsManifestCode);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
323
393
|
return [
|
|
324
394
|
{
|
|
325
395
|
name: "rsc",
|
|
326
396
|
async config(config$1, env) {
|
|
327
|
-
await esModuleLexer.init;
|
|
328
397
|
const result = await crawlFrameworkPkgs({
|
|
329
398
|
root: process.cwd(),
|
|
330
399
|
isBuild: env.command === "build",
|
|
@@ -400,47 +469,12 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
400
469
|
builder: {
|
|
401
470
|
sharedPlugins: true,
|
|
402
471
|
sharedConfigBuild: true,
|
|
403
|
-
|
|
404
|
-
if (!builder.environments.ssr?.config.build.rollupOptions.input) {
|
|
405
|
-
isScanBuild = true;
|
|
406
|
-
builder.environments.rsc.config.build.write = false;
|
|
407
|
-
builder.environments.client.config.build.write = false;
|
|
408
|
-
await builder.build(builder.environments.rsc);
|
|
409
|
-
await builder.build(builder.environments.client);
|
|
410
|
-
isScanBuild = false;
|
|
411
|
-
builder.environments.rsc.config.build.write = true;
|
|
412
|
-
builder.environments.client.config.build.write = true;
|
|
413
|
-
await builder.build(builder.environments.rsc);
|
|
414
|
-
clientReferenceMetaMap = sortObject(clientReferenceMetaMap);
|
|
415
|
-
serverResourcesMetaMap = sortObject(serverResourcesMetaMap);
|
|
416
|
-
await builder.build(builder.environments.client);
|
|
417
|
-
const assetsManifestCode = `export default ${serializeValueWithRuntime(buildAssetsManifest)}`;
|
|
418
|
-
const manifestPath = path.join(builder.environments.rsc.config.build.outDir, BUILD_ASSETS_MANIFEST_NAME);
|
|
419
|
-
fs.writeFileSync(manifestPath, assetsManifestCode);
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
isScanBuild = true;
|
|
423
|
-
builder.environments.rsc.config.build.write = false;
|
|
424
|
-
builder.environments.ssr.config.build.write = false;
|
|
425
|
-
await builder.build(builder.environments.rsc);
|
|
426
|
-
await builder.build(builder.environments.ssr);
|
|
427
|
-
isScanBuild = false;
|
|
428
|
-
builder.environments.rsc.config.build.write = true;
|
|
429
|
-
builder.environments.ssr.config.build.write = true;
|
|
430
|
-
await builder.build(builder.environments.rsc);
|
|
431
|
-
clientReferenceMetaMap = sortObject(clientReferenceMetaMap);
|
|
432
|
-
serverResourcesMetaMap = sortObject(serverResourcesMetaMap);
|
|
433
|
-
await builder.build(builder.environments.client);
|
|
434
|
-
await builder.build(builder.environments.ssr);
|
|
435
|
-
}
|
|
472
|
+
buildApp: rscPluginOptions.useBuildAppHook ? void 0 : buildApp
|
|
436
473
|
}
|
|
437
474
|
};
|
|
438
475
|
},
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
},
|
|
442
|
-
configureServer(server_) {
|
|
443
|
-
server = server_;
|
|
476
|
+
buildApp: rscPluginOptions.useBuildAppHook ? buildApp : void 0,
|
|
477
|
+
configureServer() {
|
|
444
478
|
globalThis.__viteRscDevServer = server;
|
|
445
479
|
if (rscPluginOptions.disableServerHandler) return;
|
|
446
480
|
if (rscPluginOptions.serverHandler === false) return;
|
|
@@ -511,6 +545,10 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
511
545
|
}
|
|
512
546
|
if (!isInsideClientBoundary(ctx.modules)) {
|
|
513
547
|
if (this.environment.name === "rsc") {
|
|
548
|
+
if (ctx.modules.length === 1) {
|
|
549
|
+
const importers = [...ctx.modules[0].importers];
|
|
550
|
+
if (importers.length > 0 && importers.every((m) => m.id && isCSSRequest(m.id))) return [];
|
|
551
|
+
}
|
|
514
552
|
for (const mod of ctx.modules) if (mod.type === "js") try {
|
|
515
553
|
await this.environment.transformRequest(mod.url);
|
|
516
554
|
} catch (e) {
|
|
@@ -537,15 +575,6 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
537
575
|
}
|
|
538
576
|
}
|
|
539
577
|
},
|
|
540
|
-
{
|
|
541
|
-
name: "rsc:patch-browser-raw-import",
|
|
542
|
-
transform: {
|
|
543
|
-
order: "post",
|
|
544
|
-
handler(code) {
|
|
545
|
-
if (code.includes("__vite_rsc_raw_import__")) return code.replace("__vite_rsc_raw_import__", "import");
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
},
|
|
549
578
|
{
|
|
550
579
|
name: "rsc:load-ssr-module",
|
|
551
580
|
transform(code) {
|
|
@@ -710,15 +739,6 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
710
739
|
return { code };
|
|
711
740
|
}
|
|
712
741
|
return;
|
|
713
|
-
},
|
|
714
|
-
writeBundle() {
|
|
715
|
-
if (this.environment.name === "ssr") {
|
|
716
|
-
const assetsManifestCode = `export default ${serializeValueWithRuntime(buildAssetsManifest)}`;
|
|
717
|
-
for (const name of ["ssr", "rsc"]) {
|
|
718
|
-
const manifestPath = path.join(config.environments[name].build.outDir, BUILD_ASSETS_MANIFEST_NAME);
|
|
719
|
-
fs.writeFileSync(manifestPath, assetsManifestCode);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
742
|
}
|
|
723
743
|
},
|
|
724
744
|
createVirtualPlugin("vite-rsc/bootstrap-script-content", function() {
|
|
@@ -791,16 +811,34 @@ globalThis.AsyncLocalStorage = __viteRscAyncHooks.AsyncLocalStorage;
|
|
|
791
811
|
return "";
|
|
792
812
|
}
|
|
793
813
|
},
|
|
794
|
-
...
|
|
795
|
-
...vitePluginUseClient(rscPluginOptions),
|
|
796
|
-
...vitePluginUseServer(rscPluginOptions),
|
|
797
|
-
...vitePluginDefineEncryptionKey(rscPluginOptions),
|
|
814
|
+
...vitePluginRscMinimal(rscPluginOptions),
|
|
798
815
|
...vitePluginFindSourceMapURL(),
|
|
799
816
|
...vitePluginRscCss({ rscCssTransform: rscPluginOptions.rscCssTransform }),
|
|
800
817
|
...rscPluginOptions.validateImports !== false ? [validateImportPlugin()] : [],
|
|
801
|
-
scanBuildStripPlugin()
|
|
818
|
+
scanBuildStripPlugin(),
|
|
819
|
+
detectNonOptimizedCjsPlugin()
|
|
802
820
|
];
|
|
803
821
|
}
|
|
822
|
+
function detectNonOptimizedCjsPlugin() {
|
|
823
|
+
return {
|
|
824
|
+
name: "rsc:detect-non-optimized-cjs",
|
|
825
|
+
apply: "serve",
|
|
826
|
+
async transform(code, id) {
|
|
827
|
+
if (id.includes("/node_modules/") && !id.startsWith(this.environment.config.cacheDir) && /\b(require|exports)\b/.test(code)) {
|
|
828
|
+
id = parseIdQuery(id).filename;
|
|
829
|
+
let isEsm = id.endsWith(".mjs");
|
|
830
|
+
if (id.endsWith(".js")) {
|
|
831
|
+
const pkgJsonPath = await findClosestPkgJsonPath(path.dirname(id));
|
|
832
|
+
if (pkgJsonPath) {
|
|
833
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
834
|
+
isEsm = pkgJson.type === "module";
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
if (!isEsm) this.warn(`[vite-rsc] found non-optimized CJS dependency in '${this.environment.name}' environment. It is recommended to manually add the dependency to 'environments.${this.environment.name}.optimizeDeps.include'.`);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
}
|
|
804
842
|
function scanBuildStripPlugin() {
|
|
805
843
|
return {
|
|
806
844
|
name: "rsc:scan-strip",
|
|
@@ -829,19 +867,16 @@ function getEntrySource(config$1, name = "index") {
|
|
|
829
867
|
function hashString(v) {
|
|
830
868
|
return createHash("sha256").update(v).digest().toString("hex").slice(0, 12);
|
|
831
869
|
}
|
|
832
|
-
function normalizeReferenceId(id, name) {
|
|
833
|
-
if (!server) return hashString(path.relative(config.root, id));
|
|
834
|
-
const environment = server.environments[name];
|
|
835
|
-
return normalizeViteImportAnalysisUrl(environment, id);
|
|
836
|
-
}
|
|
837
870
|
function vitePluginUseClient(useClientPluginOptions) {
|
|
838
871
|
const packageSources = /* @__PURE__ */ new Map();
|
|
839
872
|
const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/;
|
|
873
|
+
const serverEnvironmentName = useClientPluginOptions.environment?.rsc ?? "rsc";
|
|
874
|
+
const browserEnvironmentName = useClientPluginOptions.environment?.browser ?? "client";
|
|
840
875
|
return [
|
|
841
876
|
{
|
|
842
877
|
name: "rsc:use-client",
|
|
843
878
|
async transform(code, id) {
|
|
844
|
-
if (this.environment.name !==
|
|
879
|
+
if (this.environment.name !== serverEnvironmentName) return;
|
|
845
880
|
if (!code.includes("use client")) return;
|
|
846
881
|
const ast = await parseAstAsync(code);
|
|
847
882
|
if (!hasDirective(ast.body, "use client")) return;
|
|
@@ -862,7 +897,7 @@ function vitePluginUseClient(useClientPluginOptions) {
|
|
|
862
897
|
referenceKey = hashString(packageSource);
|
|
863
898
|
}
|
|
864
899
|
else if (this.environment.mode === "dev") {
|
|
865
|
-
importId = normalizeViteImportAnalysisUrl(server.environments
|
|
900
|
+
importId = normalizeViteImportAnalysisUrl(server.environments[browserEnvironmentName], id);
|
|
866
901
|
referenceKey = importId;
|
|
867
902
|
} else {
|
|
868
903
|
importId = id;
|
|
@@ -924,7 +959,7 @@ function vitePluginUseClient(useClientPluginOptions) {
|
|
|
924
959
|
async load(id) {
|
|
925
960
|
if (id.startsWith("\0virtual:vite-rsc/client-in-server-package-proxy/")) {
|
|
926
961
|
assert.equal(this.environment.mode, "dev");
|
|
927
|
-
assert
|
|
962
|
+
assert(this.environment.name !== serverEnvironmentName);
|
|
928
963
|
id = decodeURIComponent(id.slice(49));
|
|
929
964
|
return `
|
|
930
965
|
export * from ${JSON.stringify(id)};
|
|
@@ -939,7 +974,7 @@ function vitePluginUseClient(useClientPluginOptions) {
|
|
|
939
974
|
resolveId: {
|
|
940
975
|
order: "pre",
|
|
941
976
|
async handler(source, importer, options) {
|
|
942
|
-
if (this.environment.name ===
|
|
977
|
+
if (this.environment.name === serverEnvironmentName && bareImportRE.test(source)) {
|
|
943
978
|
const resolved = await this.resolve(source, importer, options);
|
|
944
979
|
if (resolved && resolved.id.includes("/node_modules/")) {
|
|
945
980
|
packageSources.set(resolved.id, source);
|
|
@@ -958,7 +993,7 @@ function vitePluginUseClient(useClientPluginOptions) {
|
|
|
958
993
|
}
|
|
959
994
|
},
|
|
960
995
|
generateBundle(_options, bundle) {
|
|
961
|
-
if (this.environment.name !==
|
|
996
|
+
if (this.environment.name !== serverEnvironmentName) return;
|
|
962
997
|
for (const chunk of Object.values(bundle)) if (chunk.type === "chunk") for (const [id, mod] of Object.entries(chunk.modules)) {
|
|
963
998
|
const meta = clientReferenceMetaMap[id];
|
|
964
999
|
if (meta) meta.renderedExports = mod.renderedExports;
|
|
@@ -972,10 +1007,11 @@ function vitePluginDefineEncryptionKey(useServerPluginOptions) {
|
|
|
972
1007
|
let emitEncryptionKey = false;
|
|
973
1008
|
const KEY_PLACEHOLDER = "__vite_rsc_define_encryption_key";
|
|
974
1009
|
const KEY_FILE = "__vite_rsc_encryption_key.js";
|
|
1010
|
+
const serverEnvironmentName = useServerPluginOptions.environment?.rsc ?? "rsc";
|
|
975
1011
|
return [{
|
|
976
1012
|
name: "rsc:encryption-key",
|
|
977
1013
|
async configEnvironment(name, _config, env) {
|
|
978
|
-
if (name ===
|
|
1014
|
+
if (name === serverEnvironmentName && !env.isPreview) defineEncryptionKey = useServerPluginOptions.defineEncryptionKey ?? JSON.stringify(toBase64(await generateEncryptionKey()));
|
|
979
1015
|
},
|
|
980
1016
|
resolveId(source) {
|
|
981
1017
|
if (source === "virtual:vite-rsc/encryption-key") return {
|
|
@@ -1005,6 +1041,8 @@ function vitePluginDefineEncryptionKey(useServerPluginOptions) {
|
|
|
1005
1041
|
}];
|
|
1006
1042
|
}
|
|
1007
1043
|
function vitePluginUseServer(useServerPluginOptions) {
|
|
1044
|
+
const serverEnvironmentName = useServerPluginOptions.environment?.rsc ?? "rsc";
|
|
1045
|
+
const browserEnvironmentName = useServerPluginOptions.environment?.browser ?? "client";
|
|
1008
1046
|
return [{
|
|
1009
1047
|
name: "rsc:use-server",
|
|
1010
1048
|
async transform(code, id) {
|
|
@@ -1019,23 +1057,28 @@ function vitePluginUseServer(useServerPluginOptions) {
|
|
|
1019
1057
|
if (!ignored) this.warn(`[vite-rsc] detected an internal server function created by a package imported on ${this.environment.name} environment`);
|
|
1020
1058
|
id = id.split("?v=")[0];
|
|
1021
1059
|
}
|
|
1022
|
-
normalizedId_ =
|
|
1060
|
+
if (config.command === "build") normalizedId_ = hashString(path.relative(config.root, id));
|
|
1061
|
+
else normalizedId_ = normalizeViteImportAnalysisUrl(server.environments[serverEnvironmentName], id);
|
|
1023
1062
|
}
|
|
1024
1063
|
return normalizedId_;
|
|
1025
1064
|
};
|
|
1026
|
-
if (this.environment.name ===
|
|
1065
|
+
if (this.environment.name === serverEnvironmentName) {
|
|
1027
1066
|
const transformServerActionServer_ = withRollupError(this, transformServerActionServer);
|
|
1028
1067
|
const enableEncryption = useServerPluginOptions.enableActionEncryption ?? true;
|
|
1029
1068
|
const { output } = transformServerActionServer_(code, ast, {
|
|
1030
1069
|
runtime: (value, name) => `$$ReactServer.registerServerReference(${value}, ${JSON.stringify(getNormalizedId())}, ${JSON.stringify(name)})`,
|
|
1031
1070
|
rejectNonAsyncFunction: true,
|
|
1032
|
-
encode: enableEncryption ? (value) =>
|
|
1033
|
-
decode: enableEncryption ? (value) => `await
|
|
1071
|
+
encode: enableEncryption ? (value) => `__vite_rsc_encryption_runtime.encryptActionBoundArgs(${value})` : void 0,
|
|
1072
|
+
decode: enableEncryption ? (value) => `await __vite_rsc_encryption_runtime.decryptActionBoundArgs(${value})` : void 0
|
|
1034
1073
|
});
|
|
1035
1074
|
if (!output.hasChanged()) return;
|
|
1036
1075
|
serverReferences[getNormalizedId()] = id;
|
|
1037
|
-
const importSource = resolvePackage(`${PKG_NAME}/rsc`);
|
|
1076
|
+
const importSource = resolvePackage(`${PKG_NAME}/react/rsc`);
|
|
1038
1077
|
output.prepend(`import * as $$ReactServer from "${importSource}";\n`);
|
|
1078
|
+
if (enableEncryption) {
|
|
1079
|
+
const importSource$1 = resolvePackage(`${PKG_NAME}/utils/encryption-runtime`);
|
|
1080
|
+
output.prepend(`import * as __vite_rsc_encryption_runtime from ${JSON.stringify(importSource$1)};\n`);
|
|
1081
|
+
}
|
|
1039
1082
|
return {
|
|
1040
1083
|
code: output.toString(),
|
|
1041
1084
|
map: output.generateMap({ hires: "boundary" })
|
|
@@ -1052,7 +1095,7 @@ function vitePluginUseServer(useServerPluginOptions) {
|
|
|
1052
1095
|
const output = result?.output;
|
|
1053
1096
|
if (!output?.hasChanged()) return;
|
|
1054
1097
|
serverReferences[getNormalizedId()] = id;
|
|
1055
|
-
const name = this.environment.name ===
|
|
1098
|
+
const name = this.environment.name === browserEnvironmentName ? "browser" : "ssr";
|
|
1056
1099
|
const importSource = resolvePackage(`${PKG_NAME}/react/${name}`);
|
|
1057
1100
|
output.prepend(`import * as $$ReactClient from "${importSource}";\n`);
|
|
1058
1101
|
return {
|
|
@@ -1267,7 +1310,7 @@ function vitePluginRscCss(rscCssOptions) {
|
|
|
1267
1310
|
};
|
|
1268
1311
|
}
|
|
1269
1312
|
function getRscCssTransformFilter({ id, code }) {
|
|
1270
|
-
const { query } = parseIdQuery(id);
|
|
1313
|
+
const { filename, query } = parseIdQuery(id);
|
|
1271
1314
|
if ("vite-rsc-css-export" in query) {
|
|
1272
1315
|
const value = query["vite-rsc-css-export"];
|
|
1273
1316
|
if (value) {
|
|
@@ -1278,8 +1321,8 @@ function vitePluginRscCss(rscCssOptions) {
|
|
|
1278
1321
|
}
|
|
1279
1322
|
const options = rscCssOptions?.rscCssTransform;
|
|
1280
1323
|
if (options === false) return false;
|
|
1281
|
-
if (options?.filter && !options.filter(
|
|
1282
|
-
if (
|
|
1324
|
+
if (options?.filter && !options.filter(filename)) return false;
|
|
1325
|
+
if (!/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)\b/.test(code) || !/\.[tj]sx?$/.test(filename)) return false;
|
|
1283
1326
|
const result = esModuleLexer.parse(code);
|
|
1284
1327
|
if (!result[0].some((i) => i.t === 1 && i.n && isCSSRequest(i.n))) return false;
|
|
1285
1328
|
return (_name, meta) => !!(meta.isFunction && meta.declName && /^[A-Z]/.test(meta.declName) || meta.defaultExportIdentifierName && /^[A-Z]/.test(meta.defaultExportIdentifierName));
|
|
@@ -1553,4 +1596,4 @@ function sortObject(o) {
|
|
|
1553
1596
|
}
|
|
1554
1597
|
|
|
1555
1598
|
//#endregion
|
|
1556
|
-
export { __fix_cloudflare, findSourceMapURL, transformHoistInlineDirective, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss };
|
|
1599
|
+
export { __fix_cloudflare, findSourceMapURL, transformHoistInlineDirective, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal };
|
|
@@ -55,7 +55,25 @@ type RscPluginOptions = {
|
|
|
55
55
|
* @default true
|
|
56
56
|
*/
|
|
57
57
|
validateImports?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
|
|
60
|
+
* for better composability with other plugins.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
useBuildAppHook?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Custom environment configuration
|
|
66
|
+
* @experimental
|
|
67
|
+
* @default { browser: 'client', ssr: 'ssr', rsc: 'rsc' }
|
|
68
|
+
*/
|
|
69
|
+
environment?: {
|
|
70
|
+
browser?: string;
|
|
71
|
+
ssr?: string;
|
|
72
|
+
rsc?: string;
|
|
73
|
+
};
|
|
58
74
|
};
|
|
75
|
+
/** @experimental */
|
|
76
|
+
declare function vitePluginRscMinimal(rscPluginOptions?: RscPluginOptions): Plugin[];
|
|
59
77
|
declare function vitePluginRsc(rscPluginOptions?: RscPluginOptions): Plugin[];
|
|
60
78
|
declare class RuntimeAsset {
|
|
61
79
|
runtime: string;
|
|
@@ -97,4 +115,4 @@ declare function transformRscCssExport(options: {
|
|
|
97
115
|
*/
|
|
98
116
|
declare function __fix_cloudflare(): Plugin;
|
|
99
117
|
//#endregion
|
|
100
|
-
export { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss };
|
|
118
|
+
export { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss } from "./plugin-
|
|
2
|
-
export { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, vitePluginRsc as default, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRscCss };
|
|
1
|
+
import { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-CYYsF3qY.js";
|
|
2
|
+
export { AssetDeps, AssetsManifest, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginOptions, __fix_cloudflare, vitePluginRsc as default, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRscCss, vitePluginRscMinimal };
|
package/dist/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./dist-DEF94lDJ.js";
|
|
2
2
|
import "./plugin-CZbI4rhS.js";
|
|
3
|
-
import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss } from "./plugin-
|
|
3
|
+
import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-C9id3xj5.js";
|
|
4
4
|
import "./encryption-utils-BDwwcMVT.js";
|
|
5
5
|
import "./rpc-tGuLT8PD.js";
|
|
6
6
|
import "./vite-utils-Vzd7cqfv.js";
|
|
7
7
|
|
|
8
|
-
export { __fix_cloudflare, vitePluginRsc as default, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRscCss };
|
|
8
|
+
export { __fix_cloudflare, vitePluginRsc as default, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRscCss, vitePluginRscMinimal };
|
package/dist/react/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallServerCallback } from "../index-
|
|
2
|
-
import { setRequireModule } from "../browser-
|
|
3
|
-
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "../browser-
|
|
1
|
+
import { CallServerCallback } from "../index-QWzVHuya.js";
|
|
2
|
+
import { setRequireModule } from "../browser-CuwQIlVY.js";
|
|
3
|
+
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "../browser-mbRygLxB.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/react/rsc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { loadServerAction, setRequireModule } from "../rsc-
|
|
3
|
-
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "../rsc-
|
|
1
|
+
import "../index-QWzVHuya.js";
|
|
2
|
+
import { loadServerAction, setRequireModule } from "../rsc-CxDPDiLz.js";
|
|
3
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "../rsc-CFtzqEG8.js";
|
|
4
4
|
export { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/react/ssr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { setRequireModule } from "../ssr-
|
|
3
|
-
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "../ssr-
|
|
1
|
+
import "../index-QWzVHuya.js";
|
|
2
|
+
import { setRequireModule } from "../ssr-BoNKka-5.js";
|
|
3
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "../ssr-D6GTzOzx.js";
|
|
4
4
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/react/ssr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../dist-DEF94lDJ.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { setRequireModule } from "../ssr-
|
|
4
|
-
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "../ssr-
|
|
3
|
+
import { setRequireModule } from "../ssr-MYoobcMC.js";
|
|
4
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "../ssr-BLt64xPK.js";
|
|
5
5
|
|
|
6
6
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { setRequireModule } from "./rsc-DKA6wwTB.js";
|
|
2
|
+
import serverReferences from "virtual:vite-rsc/server-references";
|
|
3
|
+
|
|
4
|
+
//#region src/rsc.tsx
|
|
5
|
+
initialize();
|
|
6
|
+
function initialize() {
|
|
7
|
+
setRequireModule({ load: async (id) => {
|
|
8
|
+
if (!import.meta.env.__vite_rsc_build__) return import(
|
|
9
|
+
/* @vite-ignore */
|
|
10
|
+
id
|
|
11
|
+
);
|
|
12
|
+
else {
|
|
13
|
+
const import_ = serverReferences[id];
|
|
14
|
+
if (!import_) throw new Error(`server reference not found '${id}'`);
|
|
15
|
+
return import_();
|
|
16
|
+
}
|
|
17
|
+
} });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
package/dist/rsc.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./rsc-
|
|
3
|
-
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./rsc-
|
|
4
|
-
|
|
5
|
-
//#region src/utils/encryption-runtime.d.ts
|
|
6
|
-
declare function encryptActionBoundArgs(originalValue: unknown): Promise<string>;
|
|
7
|
-
declare function decryptActionBoundArgs(encrypted: ReturnType<typeof encryptActionBoundArgs>): Promise<unknown>;
|
|
8
|
-
//#endregion
|
|
1
|
+
import "./index-QWzVHuya.js";
|
|
2
|
+
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./rsc-CxDPDiLz.js";
|
|
3
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./rsc-CFtzqEG8.js";
|
|
4
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./encryption-runtime-SgJRa9yj.js";
|
|
9
5
|
export { createClientManifest, createClientTemporaryReferenceSet, createFromReadableStream, createServerManifest, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decryptActionBoundArgs, encodeReply, encryptActionBoundArgs, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/rsc.js
CHANGED
|
@@ -3,6 +3,7 @@ import "./shared-CEyKoKAb.js";
|
|
|
3
3
|
import "./encryption-utils-BDwwcMVT.js";
|
|
4
4
|
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./rsc-DKA6wwTB.js";
|
|
5
5
|
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./rsc-DHfL29FT.js";
|
|
6
|
-
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./
|
|
6
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./encryption-runtime-D6SQwJ1j.js";
|
|
7
|
+
import "./rsc-DP-89iIT.js";
|
|
7
8
|
|
|
8
9
|
export { createClientManifest, createClientTemporaryReferenceSet, createFromReadableStream, createServerManifest, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decryptActionBoundArgs, encodeReply, encryptActionBoundArgs, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setRequireModule } from "./ssr-
|
|
1
|
+
import { setRequireModule } from "./ssr-MYoobcMC.js";
|
|
2
2
|
import * as clientReferences from "virtual:vite-rsc/client-references";
|
|
3
3
|
import assetsManifest from "virtual:vite-rsc/assets-manifest";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { createServerConsumerManifest, setRequireModule } from "./ssr-
|
|
3
|
-
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-
|
|
1
|
+
import "./index-QWzVHuya.js";
|
|
2
|
+
import { createServerConsumerManifest, setRequireModule } from "./ssr-BoNKka-5.js";
|
|
3
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-D6GTzOzx.js";
|
|
4
4
|
export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/ssr.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./dist-DEF94lDJ.js";
|
|
2
2
|
import "./shared-CEyKoKAb.js";
|
|
3
|
-
import { createServerConsumerManifest, setRequireModule } from "./ssr-
|
|
4
|
-
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-
|
|
5
|
-
import "./ssr-
|
|
3
|
+
import { createServerConsumerManifest, setRequireModule } from "./ssr-MYoobcMC.js";
|
|
4
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-BLt64xPK.js";
|
|
5
|
+
import "./ssr-B7_J2_Qh.js";
|
|
6
6
|
|
|
7
7
|
export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../dist-DEF94lDJ.js";
|
|
2
|
+
import "../shared-CEyKoKAb.js";
|
|
3
|
+
import "../encryption-utils-BDwwcMVT.js";
|
|
4
|
+
import "../rsc-DKA6wwTB.js";
|
|
5
|
+
import "../rsc-DHfL29FT.js";
|
|
6
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "../encryption-runtime-D6SQwJ1j.js";
|
|
7
|
+
|
|
8
|
+
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-rsc",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "React Server Components (RSC) support for Vite.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"react-server-dom-webpack": "^19.1.0",
|
|
61
61
|
"rsc-html-stream": "^0.0.7",
|
|
62
62
|
"tinyexec": "^1.0.1",
|
|
63
|
-
"tsdown": "^0.13.0"
|
|
63
|
+
"tsdown": "^0.13.0",
|
|
64
|
+
"vite-plugin-inspect": "^11.3.2"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"react": "*",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|