@vitejs/plugin-rsc 0.5.0 → 0.5.2
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 +37 -6
- package/dist/{browser-D8OPzpF5.js → browser-BJvYpz0J.js} +1 -1
- package/dist/{browser-7NhxQxuk.js → browser-Dtp2JGlz.js} +3 -3
- package/dist/{browser-STIFJSFF.d.ts → browser-_r3sM3qR.d.ts} +2 -2
- package/dist/{browser-CXHICuDc.d.ts → browser-nNQlWmRe.d.ts} +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +4 -4
- package/dist/chunk-CwwaNDyZ.js +30 -0
- package/dist/{cjs-C5-IrxV9.js → cjs-D5eQjp5l.js} +3 -3
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/browser.js +3 -3
- package/dist/core/plugin.js +1 -1
- package/dist/core/rsc.d.ts +2 -2
- package/dist/core/rsc.js +3 -3
- package/dist/core/ssr.d.ts +2 -2
- package/dist/core/ssr.js +3 -3
- package/dist/{dist-DiJnRA1C.js → dist-BRSdGcl7.js} +1 -1
- package/dist/{encryption-runtime-FhNKiASK.js → encryption-runtime-BeCv59UO.js} +4 -4
- package/dist/{encryption-runtime-DwihLkYv.d.ts → encryption-runtime-C6wgt7G4.d.ts} +1 -1
- package/dist/{encryption-utils-CoE0gWjC.js → encryption-utils-6p8t4Xqm.js} +1 -1
- package/dist/{index-DYBWAuKP.d.ts → index-CM9Mmb_C.d.ts} +1 -1
- package/dist/{index-kBz3NvVt.d.ts → index-CvmuS4Ks.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/picocolors-DAb_Lcs8.js +74 -0
- package/dist/{plugin-DGhnAIi6.d.ts → plugin-24ZutaDY.d.ts} +2 -2
- package/dist/{plugin-BwI7mYXI.js → plugin-D1MQNdps.js} +1 -1
- package/dist/{plugin-CrduXSyi.js → plugin-DNtLVu6l.js} +60 -24
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +8 -8
- package/dist/plugins/cjs.js +3 -3
- package/dist/react/browser.d.ts +3 -3
- package/dist/react/browser.js +4 -4
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/rsc.js +4 -4
- package/dist/react/ssr.d.ts +3 -3
- package/dist/react/ssr.js +4 -4
- package/dist/{rpc-D7cb_Wd5.js → rpc-DgBxsMKW.js} +1 -1
- package/dist/{rsc-cp4EenMG.js → rsc-CvqvlKO2.js} +3 -3
- package/dist/{rsc-DdBcg-Lb.js → rsc-DCIXw4uj.js} +3 -3
- package/dist/{rsc-Cg31p8XR.d.ts → rsc-GHO-HEzG.d.ts} +2 -2
- package/dist/{rsc-Fgmk6j0z.d.ts → rsc-g5utSLBE.d.ts} +1 -1
- package/dist/rsc.d.ts +4 -4
- package/dist/rsc.js +6 -6
- package/dist/{shared-CceFFukJ.js → shared-BbMae1Gg.js} +1 -1
- package/dist/{shared-CXg_u-4h.js → shared-DEpnONZf.js} +1 -1
- package/dist/{ssr-CE8X2HyS.js → ssr-B-bLmlbm.js} +2 -2
- package/dist/{ssr-BnYZ8xo9.d.ts → ssr-Bnw-VQBr.d.ts} +1 -1
- package/dist/{ssr-00tY_Tdf.d.ts → ssr-CB7zlVBC.d.ts} +2 -2
- package/dist/{ssr-C468YlFl.js → ssr-CDPTWY93.js} +3 -3
- package/dist/ssr.d.ts +3 -3
- package/dist/ssr.js +5 -5
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +2 -2
- package/dist/{transforms-wFF-pWF7.js → transforms-BcLQCXiC.js} +4 -3
- package/dist/utils/encryption-runtime.d.ts +1 -1
- package/dist/utils/encryption-runtime.js +6 -6
- package/dist/utils/rpc.js +1 -1
- package/package.json +12 -10
package/README.md
CHANGED
|
@@ -445,9 +445,44 @@ export function Page() {
|
|
|
445
445
|
}
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
### Canary and Experimental
|
|
448
|
+
### Using React Canary and Experimental versions
|
|
449
449
|
|
|
450
|
-
|
|
450
|
+
To use React's [canary](https://react.dev/community/versioning-policy#canary-channel) or [experimental](https://react.dev/community/versioning-policy#all-release-channels) versions with `@vitejs/plugin-rsc`, you have two options:
|
|
451
|
+
|
|
452
|
+
**Option 1: Use preview releases from pkg.pr.new**
|
|
453
|
+
|
|
454
|
+
You can use preview releases that bundle specific React versions. See [PR #524](https://github.com/vitejs/vite-plugin-react/pull/524) for instructions on installing these preview packages.
|
|
455
|
+
|
|
456
|
+
**Option 2: Install `react-server-dom-webpack` directly**
|
|
457
|
+
|
|
458
|
+
By default, `@vitejs/plugin-rsc` includes a vendored version of `react-server-dom-webpack`. However, when `react-server-dom-webpack` is installed in your project's dependencies, the plugin will automatically use it instead. This allows you to:
|
|
459
|
+
|
|
460
|
+
- Stay up-to-date with the latest React Server Components runtime without waiting for plugin updates
|
|
461
|
+
- Use specific React versions (stable, canary, or experimental)
|
|
462
|
+
|
|
463
|
+
Simply install the version you need:
|
|
464
|
+
|
|
465
|
+
```json
|
|
466
|
+
{
|
|
467
|
+
"dependencies": {
|
|
468
|
+
"react": "canary",
|
|
469
|
+
"react-dom": "canary",
|
|
470
|
+
"react-server-dom-webpack": "canary"
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
Or for experimental:
|
|
476
|
+
|
|
477
|
+
```json
|
|
478
|
+
{
|
|
479
|
+
"dependencies": {
|
|
480
|
+
"react": "experimental",
|
|
481
|
+
"react-dom": "experimental",
|
|
482
|
+
"react-server-dom-webpack": "experimental"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
```
|
|
451
486
|
|
|
452
487
|
### Using `@vitejs/plugin-rsc` as a framework package's `dependencies`
|
|
453
488
|
|
|
@@ -561,10 +596,6 @@ Note that while there are official npm packages [`server-only`](https://www.npmj
|
|
|
561
596
|
|
|
562
597
|
This build-time validation is enabled by default and can be disabled by setting `validateImports: false` in the plugin options.
|
|
563
598
|
|
|
564
|
-
### `react-server-dom-webpack`
|
|
565
|
-
|
|
566
|
-
Currently `@vitejs/plugin-rsc` includes a vendored version of `react-server-dom-webpack`. However, when `react-server-dom-webpack` is installed in user project's dependencies, the plugin will automatically use it instead. This allows you to stay up-to-date with the latest React Server Components runtime without waiting for plugin updates.
|
|
567
|
-
|
|
568
599
|
## Credits
|
|
569
600
|
|
|
570
601
|
This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.
|
|
@@ -32,4 +32,4 @@ function findSourceMapURL(filename, environmentName) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
export {
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { memoize } from "./dist-
|
|
2
|
-
import {
|
|
1
|
+
import { n as memoize } from "./dist-BRSdGcl7.js";
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "./shared-DEpnONZf.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/browser.ts
|
|
5
5
|
let init = false;
|
|
@@ -14,4 +14,4 @@ function setRequireModule(options) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
export { setRequireModule };
|
|
17
|
+
export { setRequireModule as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallServerCallback } from "./index-
|
|
1
|
+
import { n as CallServerCallback } from "./index-CvmuS4Ks.js";
|
|
2
2
|
|
|
3
3
|
//#region src/react/browser.d.ts
|
|
4
4
|
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: object): Promise<T>;
|
|
@@ -10,4 +10,4 @@ declare function setServerCallback(fn: CallServerCallback): void;
|
|
|
10
10
|
declare const createTemporaryReferenceSet: () => unknown;
|
|
11
11
|
declare function findSourceMapURL(filename: string, environmentName: string): string | null;
|
|
12
12
|
//#endregion
|
|
13
|
-
export {
|
|
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 };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallServerCallback } from "./index-
|
|
2
|
-
import { setRequireModule } from "./browser-
|
|
3
|
-
import {
|
|
1
|
+
import { n as CallServerCallback } from "./index-CvmuS4Ks.js";
|
|
2
|
+
import { t as setRequireModule } from "./browser-nNQlWmRe.js";
|
|
3
|
+
import { a as createTemporaryReferenceSet, c as setServerCallback, i as createServerReference, n as createFromFetch, o as encodeReply, r as createFromReadableStream, s as findSourceMapURL, t as callServer } from "./browser-_r3sM3qR.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./dist-
|
|
2
|
-
import "./shared-
|
|
3
|
-
import { setRequireModule } from "./browser-
|
|
4
|
-
import {
|
|
1
|
+
import "./dist-BRSdGcl7.js";
|
|
2
|
+
import "./shared-DEpnONZf.js";
|
|
3
|
+
import { t as setRequireModule } from "./browser-Dtp2JGlz.js";
|
|
4
|
+
import { a as createTemporaryReferenceSet, c as setServerCallback, i as createServerReference, n as createFromFetch, o as encodeReply, r as createFromReadableStream, s as findSourceMapURL, t as callServer } from "./browser-BJvYpz0J.js";
|
|
5
5
|
import * as clientReferences from "virtual:vite-rsc/client-references";
|
|
6
6
|
|
|
7
7
|
//#region src/browser.ts
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJS = (cb, mod) => function() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { __toDynamicImportESM as n, __commonJS as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createDebug } from "./dist-
|
|
2
|
-
import { parseIdQuery } from "./shared-
|
|
1
|
+
import { t as createDebug } from "./dist-BRSdGcl7.js";
|
|
2
|
+
import { n as parseIdQuery } from "./shared-BbMae1Gg.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -107,4 +107,4 @@ function extractPackageKey(id) {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
//#endregion
|
|
110
|
-
export { cjsModuleRunnerPlugin };
|
|
110
|
+
export { cjsModuleRunnerPlugin as t };
|
package/dist/core/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { setRequireModule } from "../browser-
|
|
1
|
+
import { t as setRequireModule } from "../browser-nNQlWmRe.js";
|
|
2
2
|
export { setRequireModule };
|
package/dist/core/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import { setRequireModule } from "../browser-
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { t as setRequireModule } from "../browser-Dtp2JGlz.js";
|
|
4
4
|
|
|
5
5
|
export { setRequireModule };
|
package/dist/core/plugin.js
CHANGED
package/dist/core/rsc.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import {
|
|
1
|
+
import "../index-CvmuS4Ks.js";
|
|
2
|
+
import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-GHO-HEzG.js";
|
|
3
3
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/rsc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-CvqvlKO2.js";
|
|
4
4
|
|
|
5
5
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/ssr.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import {
|
|
1
|
+
import "../index-CvmuS4Ks.js";
|
|
2
|
+
import { n as setRequireModule, t as createServerConsumerManifest } from "../ssr-CB7zlVBC.js";
|
|
3
3
|
export { createServerConsumerManifest, setRequireModule };
|
package/dist/core/ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { n as setRequireModule, t as createServerConsumerManifest } from "../ssr-CDPTWY93.js";
|
|
4
4
|
|
|
5
5
|
export { createServerConsumerManifest, setRequireModule };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { once } from "./dist-
|
|
2
|
-
import {
|
|
3
|
-
import { createFromReadableStream, renderToReadableStream } from "./rsc-
|
|
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-DCIXw4uj.js";
|
|
4
4
|
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/encryption-runtime.ts
|
|
@@ -17,4 +17,4 @@ const getEncryptionKey = /* @__PURE__ */ once(async () => {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
|
-
export {
|
|
20
|
+
export { encryptActionBoundArgs as n, decryptActionBoundArgs as t };
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
declare function encryptActionBoundArgs(originalValue: unknown): Promise<string>;
|
|
3
3
|
declare function decryptActionBoundArgs(encrypted: ReturnType<typeof encryptActionBoundArgs>): Promise<unknown>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { encryptActionBoundArgs as n, decryptActionBoundArgs as t };
|
|
@@ -70,4 +70,4 @@ async function decryptBuffer(encryptedString, key) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
|
-
export {
|
|
73
|
+
export { fromBase64 as a, encryptBuffer as i, concatArrayStream as n, generateEncryptionKey as o, decryptBuffer as r, toBase64 as s, arrayToStream as t };
|
|
@@ -87,4 +87,4 @@ declare function transformServerActionServer(input: string, ast: Program, option
|
|
|
87
87
|
names: string[];
|
|
88
88
|
};
|
|
89
89
|
//#endregion
|
|
90
|
-
export {
|
|
90
|
+
export { transformDirectiveProxyExport as a, TransformWrapExportOptions as c, transformHoistInlineDirective as d, TransformProxyExportOptions as i, transformWrapExport as l, getExportNames as n, transformProxyExport as o, hasDirective as r, TransformWrapExportFilter as s, transformServerActionServer as t, findDirectives as u };
|
|
@@ -23,4 +23,4 @@ interface ServerConsumerManifest {
|
|
|
23
23
|
}
|
|
24
24
|
type CallServerCallback = (id: string, args: unknown[]) => unknown;
|
|
25
25
|
//#endregion
|
|
26
|
-
export {
|
|
26
|
+
export { ServerConsumerManifest as i, CallServerCallback as n, ModuleMap as r, BundlerConfig as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { PluginApi, RscPluginOptions,
|
|
1
|
+
import "./index-CM9Mmb_C.js";
|
|
2
|
+
import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-24ZutaDY.js";
|
|
3
3
|
export { type PluginApi, type RscPluginOptions, vitePluginRsc as default, getPluginApi };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./transforms-
|
|
4
|
-
import "./encryption-utils-
|
|
5
|
-
import "./rpc-
|
|
6
|
-
import {
|
|
7
|
-
import "./cjs-
|
|
8
|
-
import "./shared-
|
|
1
|
+
import "./plugin-D1MQNdps.js";
|
|
2
|
+
import "./dist-BRSdGcl7.js";
|
|
3
|
+
import "./transforms-BcLQCXiC.js";
|
|
4
|
+
import "./encryption-utils-6p8t4Xqm.js";
|
|
5
|
+
import "./rpc-DgBxsMKW.js";
|
|
6
|
+
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-DNtLVu6l.js";
|
|
7
|
+
import "./cjs-D5eQjp5l.js";
|
|
8
|
+
import "./shared-BbMae1Gg.js";
|
|
9
9
|
|
|
10
10
|
export { vitePluginRsc as default, getPluginApi };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { t as __commonJS } from "./chunk-CwwaNDyZ.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
4
|
+
var require_picocolors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": ((exports, module) => {
|
|
5
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
6
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
7
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
8
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
9
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
10
|
+
};
|
|
11
|
+
let replaceClose = (string, close, replace, index) => {
|
|
12
|
+
let result = "", cursor = 0;
|
|
13
|
+
do {
|
|
14
|
+
result += string.substring(cursor, index) + replace;
|
|
15
|
+
cursor = index + close.length;
|
|
16
|
+
index = string.indexOf(close, cursor);
|
|
17
|
+
} while (~index);
|
|
18
|
+
return result + string.substring(cursor);
|
|
19
|
+
};
|
|
20
|
+
let createColors = (enabled = isColorSupported) => {
|
|
21
|
+
let f = enabled ? formatter : () => String;
|
|
22
|
+
return {
|
|
23
|
+
isColorSupported: enabled,
|
|
24
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
25
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
26
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
27
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
28
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
29
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
30
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
31
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
32
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
33
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
34
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
35
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
36
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
37
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
38
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
39
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
40
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
41
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
42
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
43
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
44
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
45
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
46
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
47
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
48
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
49
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
50
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
51
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
52
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
53
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
54
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
55
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
56
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
57
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
58
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
59
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
60
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
61
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
62
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
63
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
64
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
module.exports = createColors();
|
|
68
|
+
module.exports.createColors = createColors;
|
|
69
|
+
}) });
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export default require_picocolors();
|
|
73
|
+
|
|
74
|
+
export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransformWrapExportFilter } from "./index-
|
|
1
|
+
import { s as TransformWrapExportFilter } from "./index-CM9Mmb_C.js";
|
|
2
2
|
import MagicString from "magic-string";
|
|
3
3
|
import { Plugin, ResolvedConfig, Rollup, ViteDevServer, parseAstAsync } from "vite";
|
|
4
4
|
|
|
@@ -144,4 +144,4 @@ declare function transformRscCssExport(options: {
|
|
|
144
144
|
output: MagicString;
|
|
145
145
|
} | undefined>;
|
|
146
146
|
//#endregion
|
|
147
|
-
export {
|
|
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 };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { vitePluginRscCore } from "./plugin-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { n as __toDynamicImportESM } from "./chunk-CwwaNDyZ.js";
|
|
2
|
+
import { t as vitePluginRscCore } from "./plugin-D1MQNdps.js";
|
|
3
|
+
import { t as createDebug } from "./dist-BRSdGcl7.js";
|
|
4
|
+
import { a as hasDirective, n as transformDirectiveProxyExport, o as transformWrapExport, s as findDirectives, t as transformServerActionServer } from "./transforms-BcLQCXiC.js";
|
|
5
|
+
import { o as generateEncryptionKey, s as toBase64 } from "./encryption-utils-6p8t4Xqm.js";
|
|
6
|
+
import { n as createRpcServer } from "./rpc-DgBxsMKW.js";
|
|
7
|
+
import { t as cjsModuleRunnerPlugin } from "./cjs-D5eQjp5l.js";
|
|
8
|
+
import { n as parseIdQuery, r as toCssVirtual, t as parseCssVirtual } from "./shared-BbMae1Gg.js";
|
|
8
9
|
import { createRequire } from "node:module";
|
|
9
10
|
import assert from "node:assert";
|
|
10
11
|
import fs from "node:fs";
|
|
@@ -19,6 +20,7 @@ import { crawlFrameworkPkgs } from "vitefu";
|
|
|
19
20
|
import { walk } from "estree-walker";
|
|
20
21
|
import { stripVTControlCharacters } from "node:util";
|
|
21
22
|
import { createHash } from "node:crypto";
|
|
23
|
+
import { stripLiteral } from "strip-literal";
|
|
22
24
|
|
|
23
25
|
//#region src/plugins/vite-utils.ts
|
|
24
26
|
const VALID_ID_PREFIX = `/@id/`;
|
|
@@ -387,17 +389,25 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
|
|
|
387
389
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
388
390
|
const manager = new RscPluginManager();
|
|
389
391
|
const buildApp = async (builder) => {
|
|
392
|
+
const colors = await import("./picocolors-DAb_Lcs8.js").then(__toDynamicImportESM(1));
|
|
393
|
+
const logStep = (msg) => {
|
|
394
|
+
builder.config.logger.info(colors.blue(msg));
|
|
395
|
+
};
|
|
390
396
|
if (!builder.environments.ssr?.config.build.rollupOptions.input) {
|
|
391
397
|
manager.isScanBuild = true;
|
|
392
398
|
builder.environments.rsc.config.build.write = false;
|
|
393
399
|
builder.environments.client.config.build.write = false;
|
|
400
|
+
logStep("[1/4] analyze client references...");
|
|
394
401
|
await builder.build(builder.environments.rsc);
|
|
402
|
+
logStep("[2/4] analyze server references...");
|
|
395
403
|
await builder.build(builder.environments.client);
|
|
396
404
|
manager.isScanBuild = false;
|
|
397
405
|
builder.environments.rsc.config.build.write = true;
|
|
398
406
|
builder.environments.client.config.build.write = true;
|
|
407
|
+
logStep("[3/4] build rsc environment...");
|
|
399
408
|
await builder.build(builder.environments.rsc);
|
|
400
409
|
manager.stabilize();
|
|
410
|
+
logStep("[4/4] build client environment...");
|
|
401
411
|
await builder.build(builder.environments.client);
|
|
402
412
|
writeAssetsManifest(["rsc"]);
|
|
403
413
|
return;
|
|
@@ -405,14 +415,19 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
405
415
|
manager.isScanBuild = true;
|
|
406
416
|
builder.environments.rsc.config.build.write = false;
|
|
407
417
|
builder.environments.ssr.config.build.write = false;
|
|
418
|
+
logStep("[1/5] analyze client references...");
|
|
408
419
|
await builder.build(builder.environments.rsc);
|
|
420
|
+
logStep("[2/5] analyze server references...");
|
|
409
421
|
await builder.build(builder.environments.ssr);
|
|
410
422
|
manager.isScanBuild = false;
|
|
411
423
|
builder.environments.rsc.config.build.write = true;
|
|
412
424
|
builder.environments.ssr.config.build.write = true;
|
|
425
|
+
logStep("[3/5] build rsc environment...");
|
|
413
426
|
await builder.build(builder.environments.rsc);
|
|
414
427
|
manager.stabilize();
|
|
428
|
+
logStep("[4/5] build client environment...");
|
|
415
429
|
await builder.build(builder.environments.client);
|
|
430
|
+
logStep("[5/5] build ssr environment...");
|
|
416
431
|
await builder.build(builder.environments.ssr);
|
|
417
432
|
writeAssetsManifest(["ssr", "rsc"]);
|
|
418
433
|
};
|
|
@@ -653,19 +668,15 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
653
668
|
if (!code.includes("import.meta.viteRsc.loadModule")) return;
|
|
654
669
|
const { server } = manager;
|
|
655
670
|
const s = new MagicString(code);
|
|
656
|
-
for (const match of code.matchAll(/import\.meta\.viteRsc\.loadModule\(([\s\S]*?)\)/dg)) {
|
|
657
|
-
const [
|
|
671
|
+
for (const match of stripLiteral(code).matchAll(/import\.meta\.viteRsc\.loadModule\(([\s\S]*?)\)/dg)) {
|
|
672
|
+
const [argStart, argEnd] = match.indices[1];
|
|
673
|
+
const [environmentName, entryName] = evalValue(`[${code.slice(argStart, argEnd).trim()}]`);
|
|
658
674
|
let replacement;
|
|
659
|
-
if (this.environment.mode === "dev" && rscPluginOptions.loadModuleDevProxy) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
entryName
|
|
665
|
-
});
|
|
666
|
-
replacement = `__vite_rsc_rpc.createRpcClient(${JSON.stringify({ endpoint })})`;
|
|
667
|
-
s.prepend(`import * as __vite_rsc_rpc from "@vitejs/plugin-rsc/utils/rpc";`);
|
|
668
|
-
} else if (this.environment.mode === "dev") {
|
|
675
|
+
if (this.environment.mode === "dev" && rscPluginOptions.loadModuleDevProxy) replacement = `import("virtual:vite-rsc/rpc-client").then((module) => module.createRpcClient(${JSON.stringify({
|
|
676
|
+
environmentName,
|
|
677
|
+
entryName
|
|
678
|
+
})}))`;
|
|
679
|
+
else if (this.environment.mode === "dev") {
|
|
669
680
|
const environment = server.environments[environmentName];
|
|
670
681
|
const source = getEntrySource(environment.config, entryName);
|
|
671
682
|
const resolved = await environment.pluginContainer.resolveId(source);
|
|
@@ -730,6 +741,29 @@ function vitePluginRsc(rscPluginOptions = {}) {
|
|
|
730
741
|
});
|
|
731
742
|
}
|
|
732
743
|
},
|
|
744
|
+
{
|
|
745
|
+
name: "rsc:virtual:vite-rsc/rpc-client",
|
|
746
|
+
resolveId(source) {
|
|
747
|
+
if (source === "virtual:vite-rsc/rpc-client") return `\0${source}`;
|
|
748
|
+
},
|
|
749
|
+
load(id) {
|
|
750
|
+
if (id === "\0virtual:vite-rsc/rpc-client") {
|
|
751
|
+
const { server } = manager;
|
|
752
|
+
const origin = server.resolvedUrls?.local[0];
|
|
753
|
+
assert(origin, "[vite-rsc] no server for loadModuleDevProxy");
|
|
754
|
+
return `\
|
|
755
|
+
import * as __vite_rsc_rpc from "@vitejs/plugin-rsc/utils/rpc";
|
|
756
|
+
export function createRpcClient(params) {
|
|
757
|
+
const endpoint =
|
|
758
|
+
"${origin}" +
|
|
759
|
+
"__vite_rsc_load_module_dev_proxy?" +
|
|
760
|
+
new URLSearchParams(params);
|
|
761
|
+
return __vite_rsc_rpc.createRpcClient({ endpoint });
|
|
762
|
+
}
|
|
763
|
+
`;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
},
|
|
733
767
|
{
|
|
734
768
|
name: "rsc:virtual:vite-rsc/assets-manifest",
|
|
735
769
|
resolveId(source) {
|
|
@@ -816,8 +850,9 @@ export default assetsManifest.bootstrapScriptContent;
|
|
|
816
850
|
if (!code.includes("loadBootstrapScriptContent") || !/import\s*\.\s*meta\s*\.\s*viteRsc\s*\.\s*loadBootstrapScriptContent/.test(code)) return;
|
|
817
851
|
assert(this.environment.name !== "client");
|
|
818
852
|
const output = new MagicString(code);
|
|
819
|
-
for (const match of code.matchAll(/import\s*\.\s*meta\s*\.\s*viteRsc\s*\.\s*loadBootstrapScriptContent\(([\s\S]*?)\)/dg)) {
|
|
820
|
-
const
|
|
853
|
+
for (const match of stripLiteral(code).matchAll(/import\s*\.\s*meta\s*\.\s*viteRsc\s*\.\s*loadBootstrapScriptContent\(([\s\S]*?)\)/dg)) {
|
|
854
|
+
const [argStart, argEnd] = match.indices[1];
|
|
855
|
+
const argCode = code.slice(argStart, argEnd).trim();
|
|
821
856
|
assert(evalValue(argCode), `[vite-rsc] expected 'loadBootstrapScriptContent("index")' but got ${argCode}`);
|
|
822
857
|
let replacement = `Promise.resolve(__vite_rsc_assets_manifest.bootstrapScriptContent)`;
|
|
823
858
|
const [start, end] = match.indices[0];
|
|
@@ -1479,9 +1514,10 @@ function vitePluginRscCss(rscCssOptions = {}, manager) {
|
|
|
1479
1514
|
assert(this.environment.name === "rsc");
|
|
1480
1515
|
const output = new MagicString(code);
|
|
1481
1516
|
let importAdded = false;
|
|
1482
|
-
for (const match of code.matchAll(/import\.meta\.viteRsc\.loadCss\(([\s\S]*?)\)/dg)) {
|
|
1517
|
+
for (const match of stripLiteral(code).matchAll(/import\.meta\.viteRsc\.loadCss\(([\s\S]*?)\)/dg)) {
|
|
1483
1518
|
const [start, end] = match.indices[0];
|
|
1484
|
-
const
|
|
1519
|
+
const [argStart, argEnd] = match.indices[1];
|
|
1520
|
+
const argCode = code.slice(argStart, argEnd).trim();
|
|
1485
1521
|
let importer = id;
|
|
1486
1522
|
if (argCode) {
|
|
1487
1523
|
const argValue = evalValue(argCode);
|
|
@@ -1618,4 +1654,4 @@ function __vite_rsc_wrap_css__(value, name) {
|
|
|
1618
1654
|
}
|
|
1619
1655
|
|
|
1620
1656
|
//#endregion
|
|
1621
|
-
export {
|
|
1657
|
+
export { vitePluginRscMinimal as i, transformRscCssExport as n, vitePluginRsc as r, getPluginApi as t };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
1
|
+
import "./index-CM9Mmb_C.js";
|
|
2
|
+
import { a as ResolvedAssetsManifest, c as getPluginApi, d as vitePluginRscMinimal, i as ResolvedAssetDeps, l as transformRscCssExport, n as AssetsManifest, o as RscPluginManager, r as PluginApi, s as RscPluginOptions, t as AssetDeps, u as vitePluginRsc } from "./plugin-24ZutaDY.js";
|
|
3
3
|
export { AssetDeps, AssetsManifest, PluginApi, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginManager, RscPluginOptions, vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./transforms-
|
|
4
|
-
import "./encryption-utils-
|
|
5
|
-
import "./rpc-
|
|
6
|
-
import {
|
|
7
|
-
import "./cjs-
|
|
8
|
-
import "./shared-
|
|
1
|
+
import "./plugin-D1MQNdps.js";
|
|
2
|
+
import "./dist-BRSdGcl7.js";
|
|
3
|
+
import "./transforms-BcLQCXiC.js";
|
|
4
|
+
import "./encryption-utils-6p8t4Xqm.js";
|
|
5
|
+
import "./rpc-DgBxsMKW.js";
|
|
6
|
+
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-DNtLVu6l.js";
|
|
7
|
+
import "./cjs-D5eQjp5l.js";
|
|
8
|
+
import "./shared-BbMae1Gg.js";
|
|
9
9
|
|
|
10
10
|
export { vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugins/cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import { cjsModuleRunnerPlugin } from "../cjs-
|
|
3
|
-
import "../shared-
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import { t as cjsModuleRunnerPlugin } from "../cjs-D5eQjp5l.js";
|
|
3
|
+
import "../shared-BbMae1Gg.js";
|
|
4
4
|
|
|
5
5
|
export { cjsModuleRunnerPlugin };
|
package/dist/react/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallServerCallback } from "../index-
|
|
2
|
-
import { setRequireModule } from "../browser-
|
|
3
|
-
import {
|
|
1
|
+
import { n as CallServerCallback } from "../index-CvmuS4Ks.js";
|
|
2
|
+
import { t as setRequireModule } from "../browser-nNQlWmRe.js";
|
|
3
|
+
import { a as createTemporaryReferenceSet, c as setServerCallback, i as createServerReference, n as createFromFetch, o as encodeReply, r as createFromReadableStream, s as findSourceMapURL, t as callServer } from "../browser-_r3sM3qR.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/react/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import { setRequireModule } from "../browser-
|
|
4
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { t as setRequireModule } from "../browser-Dtp2JGlz.js";
|
|
4
|
+
import { a as createTemporaryReferenceSet, c as setServerCallback, i as createServerReference, n as createFromFetch, o as encodeReply, r as createFromReadableStream, s as findSourceMapURL, t as callServer } from "../browser-BJvYpz0J.js";
|
|
5
5
|
|
|
6
6
|
export { 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 {
|
|
3
|
-
import {
|
|
1
|
+
import "../index-CvmuS4Ks.js";
|
|
2
|
+
import { a as setRequireModule, i as loadServerAction } from "../rsc-GHO-HEzG.js";
|
|
3
|
+
import { a as decodeFormState, c as registerClientReference, i as decodeAction, l as registerServerReference, n as createFromReadableStream, o as decodeReply, r as createTemporaryReferenceSet, s as encodeReply, t as createClientTemporaryReferenceSet, u as renderToReadableStream } from "../rsc-g5utSLBE.js";
|
|
4
4
|
export { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/react/rsc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { a as setRequireModule, i as loadServerAction } from "../rsc-CvqvlKO2.js";
|
|
4
|
+
import { a as decodeFormState, c as registerClientReference, i as decodeAction, l as registerServerReference, n as createFromReadableStream, o as decodeReply, r as createTemporaryReferenceSet, s as encodeReply, t as createClientTemporaryReferenceSet, u as renderToReadableStream } from "../rsc-DCIXw4uj.js";
|
|
5
5
|
|
|
6
6
|
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 {
|
|
1
|
+
import "../index-CvmuS4Ks.js";
|
|
2
|
+
import { n as setRequireModule } from "../ssr-CB7zlVBC.js";
|
|
3
|
+
import { i as findSourceMapURL, n as createFromReadableStream, r as createServerReference, t as callServer } from "../ssr-Bnw-VQBr.js";
|
|
4
4
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/react/ssr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../shared-
|
|
3
|
-
import { setRequireModule } from "../ssr-
|
|
4
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../shared-DEpnONZf.js";
|
|
3
|
+
import { n as setRequireModule } from "../ssr-CDPTWY93.js";
|
|
4
|
+
import { i as findSourceMapURL, n as createFromReadableStream, r as createServerReference, t as callServer } from "../ssr-B-bLmlbm.js";
|
|
5
5
|
|
|
6
6
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as tinyassert, n as memoize } from "./dist-BRSdGcl7.js";
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag, n as SERVER_REFERENCE_PREFIX, r as createReferenceCacheTag, t as SERVER_DECODE_CLIENT_PREFIX } from "./shared-DEpnONZf.js";
|
|
3
3
|
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
4
4
|
|
|
5
5
|
//#region src/core/rsc.ts
|
|
@@ -74,4 +74,4 @@ function createClientManifest() {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
//#endregion
|
|
77
|
-
export {
|
|
77
|
+
export { setRequireModule as a, loadServerAction as i, createServerDecodeClientManifest as n, createServerManifest as r, createClientManifest as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
1
|
+
import { n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "./rsc-CvqvlKO2.js";
|
|
3
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
4
|
|
|
5
5
|
//#region src/react/rsc.ts
|
|
6
6
|
function renderToReadableStream(data, options) {
|
|
@@ -33,4 +33,4 @@ const encodeReply = ReactClient.encodeReply;
|
|
|
33
33
|
const createClientTemporaryReferenceSet = ReactClient.createTemporaryReferenceSet;
|
|
34
34
|
|
|
35
35
|
//#endregion
|
|
36
|
-
export {
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ModuleMap, t as BundlerConfig } from "./index-CvmuS4Ks.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/rsc.d.ts
|
|
4
4
|
declare function setRequireModule(options: {
|
|
@@ -9,4 +9,4 @@ declare function createServerManifest(): BundlerConfig;
|
|
|
9
9
|
declare function createServerDecodeClientManifest(): ModuleMap;
|
|
10
10
|
declare function createClientManifest(): BundlerConfig;
|
|
11
11
|
//#endregion
|
|
12
|
-
export {
|
|
12
|
+
export { setRequireModule as a, loadServerAction as i, createServerDecodeClientManifest as n, createServerManifest as r, createClientManifest as t };
|
|
@@ -12,4 +12,4 @@ declare const createTemporaryReferenceSet: () => unknown;
|
|
|
12
12
|
declare const encodeReply: (v: unknown[], options?: unknown) => Promise<string | FormData>;
|
|
13
13
|
declare const createClientTemporaryReferenceSet: () => unknown;
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
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/rsc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import "./index-CvmuS4Ks.js";
|
|
2
|
+
import { a as setRequireModule, i as loadServerAction, r as createServerManifest, t as createClientManifest } from "./rsc-GHO-HEzG.js";
|
|
3
|
+
import { a as decodeFormState, c as registerClientReference, i as decodeAction, l as registerServerReference, n as createFromReadableStream, o as decodeReply, r as createTemporaryReferenceSet, s as encodeReply, t as createClientTemporaryReferenceSet, u as renderToReadableStream } from "./rsc-g5utSLBE.js";
|
|
4
|
+
import { n as encryptActionBoundArgs, t as decryptActionBoundArgs } from "./encryption-runtime-C6wgt7G4.js";
|
|
5
5
|
export { createClientManifest, createClientTemporaryReferenceSet, createFromReadableStream, createServerManifest, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, decryptActionBoundArgs, encodeReply, encryptActionBoundArgs, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/rsc.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./dist-
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import "./dist-BRSdGcl7.js";
|
|
2
|
+
import "./encryption-utils-6p8t4Xqm.js";
|
|
3
|
+
import "./shared-DEpnONZf.js";
|
|
4
|
+
import { a as setRequireModule, i as loadServerAction, r as createServerManifest, t as createClientManifest } from "./rsc-CvqvlKO2.js";
|
|
5
|
+
import { a as decodeFormState, c as registerClientReference, i as decodeAction, l as registerServerReference, n as createFromReadableStream, o as decodeReply, r as createTemporaryReferenceSet, s as encodeReply, t as createClientTemporaryReferenceSet, u as renderToReadableStream } from "./rsc-DCIXw4uj.js";
|
|
6
|
+
import { n as encryptActionBoundArgs, t as decryptActionBoundArgs } from "./encryption-runtime-BeCv59UO.js";
|
|
7
7
|
import serverReferences from "virtual:vite-rsc/server-references";
|
|
8
8
|
|
|
9
9
|
//#region src/rsc.tsx
|
|
@@ -18,4 +18,4 @@ function setInternalRequire() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
//#endregion
|
|
21
|
-
export {
|
|
21
|
+
export { setInternalRequire as a, removeReferenceCacheTag as i, SERVER_REFERENCE_PREFIX as n, createReferenceCacheTag as r, SERVER_DECODE_CLIENT_PREFIX as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createServerConsumerManifest } from "./ssr-
|
|
1
|
+
import { t as createServerConsumerManifest } from "./ssr-CDPTWY93.js";
|
|
2
2
|
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
3
3
|
|
|
4
4
|
//#region src/react/ssr.ts
|
|
@@ -15,4 +15,4 @@ const callServer = null;
|
|
|
15
15
|
const findSourceMapURL = null;
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
18
|
+
export { findSourceMapURL as i, createFromReadableStream as n, createServerReference as r, callServer as t };
|
|
@@ -4,4 +4,4 @@ declare function createServerReference(id: string): unknown;
|
|
|
4
4
|
declare const callServer: null;
|
|
5
5
|
declare const findSourceMapURL: null;
|
|
6
6
|
//#endregion
|
|
7
|
-
export {
|
|
7
|
+
export { findSourceMapURL as i, createFromReadableStream as n, createServerReference as r, callServer as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServerConsumerManifest } from "./index-
|
|
1
|
+
import { i as ServerConsumerManifest } from "./index-CvmuS4Ks.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/ssr.d.ts
|
|
4
4
|
declare function setRequireModule(options: {
|
|
@@ -6,4 +6,4 @@ declare function setRequireModule(options: {
|
|
|
6
6
|
}): void;
|
|
7
7
|
declare function createServerConsumerManifest(): ServerConsumerManifest;
|
|
8
8
|
//#endregion
|
|
9
|
-
export {
|
|
9
|
+
export { setRequireModule as n, createServerConsumerManifest as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { memoize } from "./dist-
|
|
2
|
-
import {
|
|
1
|
+
import { n as memoize } from "./dist-BRSdGcl7.js";
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "./shared-DEpnONZf.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/ssr.ts
|
|
5
5
|
let init = false;
|
|
@@ -20,4 +20,4 @@ function createServerConsumerManifest() {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
//#endregion
|
|
23
|
-
export {
|
|
23
|
+
export { setRequireModule as n, createServerConsumerManifest as t };
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "./index-CvmuS4Ks.js";
|
|
2
|
+
import { n as setRequireModule, t as createServerConsumerManifest } from "./ssr-CB7zlVBC.js";
|
|
3
|
+
import { i as findSourceMapURL, n as createFromReadableStream, r as createServerReference, t as callServer } from "./ssr-Bnw-VQBr.js";
|
|
4
4
|
export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
|
package/dist/ssr.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./dist-
|
|
2
|
-
import "./shared-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import "./dist-BRSdGcl7.js";
|
|
2
|
+
import { r as toCssVirtual } from "./shared-BbMae1Gg.js";
|
|
3
|
+
import "./shared-DEpnONZf.js";
|
|
4
|
+
import { n as setRequireModule, t as createServerConsumerManifest } from "./ssr-CDPTWY93.js";
|
|
5
|
+
import { i as findSourceMapURL, n as createFromReadableStream, r as createServerReference, t as callServer } from "./ssr-B-bLmlbm.js";
|
|
6
6
|
import * as clientReferences from "virtual:vite-rsc/client-references";
|
|
7
7
|
import assetsManifest from "virtual:vite-rsc/assets-manifest";
|
|
8
8
|
import * as ReactDOM from "react-dom";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
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-CM9Mmb_C.js";
|
|
2
2
|
export { TransformProxyExportOptions, TransformWrapExportFilter, TransformWrapExportOptions, findDirectives, getExportNames, hasDirective, transformDirectiveProxyExport, transformHoistInlineDirective, transformProxyExport, transformServerActionServer, transformWrapExport };
|
package/dist/transforms/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import { a as hasDirective, c as transformHoistInlineDirective, i as getExportNames, n as transformDirectiveProxyExport, o as transformWrapExport, r as transformProxyExport, s as findDirectives, t as transformServerActionServer } from "../transforms-BcLQCXiC.js";
|
|
3
3
|
|
|
4
4
|
export { findDirectives, getExportNames, hasDirective, transformDirectiveProxyExport, transformHoistInlineDirective, transformProxyExport, transformServerActionServer, transformWrapExport };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { tinyassert } from "./dist-
|
|
1
|
+
import { i as tinyassert } from "./dist-BRSdGcl7.js";
|
|
2
2
|
import MagicString from "magic-string";
|
|
3
3
|
import { walk } from "estree-walker";
|
|
4
4
|
import { analyze, extract_names } from "periscopic";
|
|
5
5
|
|
|
6
6
|
//#region src/transforms/hoist.ts
|
|
7
|
-
function transformHoistInlineDirective(input, ast, { runtime, rejectNonAsyncFunction
|
|
7
|
+
function transformHoistInlineDirective(input, ast, { runtime, rejectNonAsyncFunction, ...options }) {
|
|
8
|
+
if (!input.endsWith("\n")) input += "\n";
|
|
8
9
|
const output = new MagicString(input);
|
|
9
10
|
const directive = typeof options.directive === "string" ? exactRegex(options.directive) : options.directive;
|
|
10
11
|
walk(ast, { enter(node) {
|
|
@@ -340,4 +341,4 @@ function transformServerActionServer(input, ast, options) {
|
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
//#endregion
|
|
343
|
-
export {
|
|
344
|
+
export { hasDirective as a, transformHoistInlineDirective as c, getExportNames as i, transformDirectiveProxyExport as n, transformWrapExport as o, transformProxyExport as r, findDirectives as s, transformServerActionServer as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as encryptActionBoundArgs, t as decryptActionBoundArgs } from "../encryption-runtime-C6wgt7G4.js";
|
|
2
2
|
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../dist-
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../rsc-
|
|
5
|
-
import "../rsc-
|
|
6
|
-
import {
|
|
1
|
+
import "../dist-BRSdGcl7.js";
|
|
2
|
+
import "../encryption-utils-6p8t4Xqm.js";
|
|
3
|
+
import "../shared-DEpnONZf.js";
|
|
4
|
+
import "../rsc-CvqvlKO2.js";
|
|
5
|
+
import "../rsc-DCIXw4uj.js";
|
|
6
|
+
import { n as encryptActionBoundArgs, t as decryptActionBoundArgs } from "../encryption-runtime-BeCv59UO.js";
|
|
7
7
|
|
|
8
8
|
export { decryptActionBoundArgs, encryptActionBoundArgs };
|
package/dist/utils/rpc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-rsc",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "React Server Components (RSC) support for Vite.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -39,29 +39,31 @@
|
|
|
39
39
|
"prepack": "tsdown"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@remix-run/node-fetch-server": "^0.
|
|
42
|
+
"@remix-run/node-fetch-server": "^0.12.0",
|
|
43
43
|
"es-module-lexer": "^1.7.0",
|
|
44
44
|
"estree-walker": "^3.0.3",
|
|
45
|
-
"magic-string": "^0.30.
|
|
45
|
+
"magic-string": "^0.30.21",
|
|
46
46
|
"periscopic": "^4.0.2",
|
|
47
|
+
"strip-literal": "^3.1.0",
|
|
47
48
|
"turbo-stream": "^3.1.0",
|
|
48
49
|
"vitefu": "^1.1.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@hiogawa/utils": "^1.7.0",
|
|
52
|
-
"@playwright/test": "^1.
|
|
53
|
-
"@tsconfig/strictest": "^2.0.
|
|
53
|
+
"@playwright/test": "^1.56.1",
|
|
54
|
+
"@tsconfig/strictest": "^2.0.8",
|
|
54
55
|
"@types/estree": "^1.0.8",
|
|
55
|
-
"@types/node": "^
|
|
56
|
-
"@types/react": "^19.2.
|
|
57
|
-
"@types/react-dom": "^19.2.
|
|
56
|
+
"@types/node": "^24.10.1",
|
|
57
|
+
"@types/react": "^19.2.7",
|
|
58
|
+
"@types/react-dom": "^19.2.3",
|
|
58
59
|
"@vitejs/plugin-react": "workspace:*",
|
|
59
60
|
"@vitejs/test-dep-cjs-and-esm": "./test-dep/cjs-and-esm",
|
|
61
|
+
"picocolors": "^1.1.1",
|
|
60
62
|
"react": "^19.2.0",
|
|
61
63
|
"react-dom": "^19.2.0",
|
|
62
64
|
"react-server-dom-webpack": "^19.2.0",
|
|
63
|
-
"tinyexec": "^1.0.
|
|
64
|
-
"tsdown": "^0.
|
|
65
|
+
"tinyexec": "^1.0.2",
|
|
66
|
+
"tsdown": "^0.16.4"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
69
|
"react": "*",
|