@vitejs/plugin-rsc 0.5.25 → 0.5.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +2 -2
- package/dist/{cjs-BdahOUyh.js → cjs-BspwazE6.js} +1 -1
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/browser.js +1 -1
- package/dist/core/rsc.d.ts +1 -1
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +1 -1
- package/dist/core/ssr.js +1 -1
- package/dist/{index-2GoUFmVR.d.ts → index-DViteJjw.d.ts} +17 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{picocolors-BDx0CW3k.js → picocolors-CEw5D0BV.js} +1 -1
- package/dist/{plugin-BhzHKRFo.js → plugin-BK29Va7z.js} +64 -9
- package/dist/{plugin-DGxRH4Nv.d.ts → plugin-Bm-Fb4g7.d.ts} +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugins/cjs.js +1 -1
- package/dist/react/browser.d.ts +2 -2
- package/dist/react/rsc.d.ts +1 -1
- package/dist/react/ssr.d.ts +1 -1
- package/dist/rsc.d.ts +1 -1
- package/dist/{scope-DKCDtt0O.js → scope-Bwt9GVLP.js} +3 -37
- package/dist/ssr.d.ts +1 -1
- package/dist/transforms/index.d.ts +2 -2
- package/dist/transforms/index.js +95 -7
- package/dist/utils/encryption-runtime.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +3 -3
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +34 -21
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +32 -21
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +44 -23
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +42 -23
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +56 -29
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +54 -29
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/package.json +12 -12
- package/dist/chunk-DpdyVxdi.js +0 -25
- /package/dist/{browser-CUMAmYC3.d.ts → browser-C_qguV-a.d.ts} +0 -0
- /package/dist/{encryption-utils-BblioYEx.js → encryption-utils-CRBgMeBq.js} +0 -0
- /package/dist/{index-D2a5dlVU.d.ts → index-BrXJaflA.d.ts} +0 -0
- /package/dist/{shared-BViDMJTQ.js → shared-BVLpj0Y8.js} +0 -0
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CallServerCallback } from "./index-
|
|
2
|
-
import { t as setRequireModule } from "./browser-
|
|
1
|
+
import { n as CallServerCallback } from "./index-BrXJaflA.js";
|
|
2
|
+
import { t as setRequireModule } from "./browser-C_qguV-a.js";
|
|
3
3
|
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
|
|
4
4
|
export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createDebug } from "./dist-rz-Bnebz.js";
|
|
2
|
-
import { t as buildScopeTree } from "./scope-
|
|
2
|
+
import { t as buildScopeTree } from "./scope-Bwt9GVLP.js";
|
|
3
3
|
import { n as parseIdQuery } from "./shared-DeahDSXi.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
package/dist/core/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as setRequireModule } from "../browser-
|
|
1
|
+
import { t as setRequireModule } from "../browser-C_qguV-a.js";
|
|
2
2
|
export { setRequireModule };
|
package/dist/core/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as memoize } from "../dist-rz-Bnebz.js";
|
|
2
|
-
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-BVLpj0Y8.js";
|
|
3
3
|
//#region src/core/browser.ts
|
|
4
4
|
let init = false;
|
|
5
5
|
function setRequireModule(options) {
|
package/dist/core/rsc.d.ts
CHANGED
package/dist/core/rsc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as tinyassert, n as memoize } from "../dist-rz-Bnebz.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-
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag, n as SERVER_REFERENCE_PREFIX, r as createReferenceCacheTag, t as SERVER_DECODE_CLIENT_PREFIX } from "../shared-BVLpj0Y8.js";
|
|
3
3
|
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
4
4
|
//#region src/core/rsc.ts
|
|
5
5
|
let init = false;
|
package/dist/core/ssr.d.ts
CHANGED
package/dist/core/ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as memoize } from "../dist-rz-Bnebz.js";
|
|
2
|
-
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-
|
|
2
|
+
import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-BVLpj0Y8.js";
|
|
3
3
|
//#region src/core/ssr.ts
|
|
4
4
|
let init = false;
|
|
5
5
|
function setRequireModule(options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MagicString from "magic-string";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@types+estree@1.0.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
|
|
4
4
|
// This definition file follows a somewhat unusual format. ESTree allows
|
|
5
5
|
// runtime type checks based on the `type` parameter. In order to explain this
|
|
6
6
|
// to typescript we want to use discriminated union types:
|
|
@@ -250,7 +250,7 @@ interface PrivateIdentifier extends BaseNode {
|
|
|
250
250
|
}
|
|
251
251
|
interface Property extends BaseNode {
|
|
252
252
|
type: "Property";
|
|
253
|
-
key: Expression
|
|
253
|
+
key: Expression;
|
|
254
254
|
value: Expression | Pattern; // Could be an AssignmentProperty
|
|
255
255
|
kind: "init" | "get" | "set";
|
|
256
256
|
method: boolean;
|
|
@@ -589,11 +589,6 @@ declare function transformProxyExport(ast: Program, options: TransformProxyExpor
|
|
|
589
589
|
//#endregion
|
|
590
590
|
//#region src/transforms/utils.d.ts
|
|
591
591
|
declare function hasDirective(body: Program["body"], directive: string): boolean;
|
|
592
|
-
declare function getExportNames(ast: Program, options: {
|
|
593
|
-
ignoreExportAllDeclaration?: boolean;
|
|
594
|
-
}): {
|
|
595
|
-
exportNames: string[];
|
|
596
|
-
};
|
|
597
592
|
declare function extractNames(param: Pattern): string[];
|
|
598
593
|
declare function extractIdentifiers(param: Pattern, nodes?: Identifier[]): Identifier[];
|
|
599
594
|
declare function validateNonAsyncFunction(opts: {
|
|
@@ -614,4 +609,18 @@ declare function transformServerActionServer(input: string, ast: Program, option
|
|
|
614
609
|
names: string[];
|
|
615
610
|
};
|
|
616
611
|
//#endregion
|
|
617
|
-
export
|
|
612
|
+
//#region src/transforms/expand-export-all.d.ts
|
|
613
|
+
interface TransformExpandExportAllContext {
|
|
614
|
+
resolve: (source: string, importer: string) => Promise<string | undefined>;
|
|
615
|
+
load: (id: string) => Promise<Program>;
|
|
616
|
+
}
|
|
617
|
+
interface TransformExpandExportAllOptions extends TransformExpandExportAllContext {
|
|
618
|
+
code: string;
|
|
619
|
+
ast: Program;
|
|
620
|
+
importer: string;
|
|
621
|
+
}
|
|
622
|
+
declare function transformExpandExportAll(options: TransformExpandExportAllOptions): Promise<{
|
|
623
|
+
code: string;
|
|
624
|
+
} | undefined>;
|
|
625
|
+
//#endregion
|
|
626
|
+
export { extractIdentifiers as a, validateNonAsyncFunction as c, transformProxyExport as d, TransformWrapExportFilter as f, transformHoistInlineDirective as g, findDirectives as h, transformServerActionServer as i, TransformProxyExportOptions as l, transformWrapExport as m, TransformExpandExportAllOptions as n, extractNames as o, TransformWrapExportOptions as p, transformExpandExportAll as r, hasDirective as s, TransformExpandExportAllContext as t, transformDirectiveProxyExport as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-
|
|
1
|
+
import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-Bm-Fb4g7.js";
|
|
2
2
|
export { type PluginApi, type RscPluginOptions, vitePluginRsc as default, getPluginApi };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
1
|
+
import { r as vitePluginRsc, t as getPluginApi } from "./plugin-BK29Va7z.js";
|
|
2
2
|
export { vitePluginRsc as default, getPluginApi };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as __commonJSMin } from "./plugin-BK29Va7z.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
3
3
|
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
4
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { n as __toESM } from "./chunk-DpdyVxdi.js";
|
|
2
1
|
import { t as createDebug } from "./dist-rz-Bnebz.js";
|
|
3
2
|
import vitePluginRscCore from "./core/plugin.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as cjsModuleRunnerPlugin } from "./cjs-
|
|
3
|
+
import { i as hasDirective } from "./scope-Bwt9GVLP.js";
|
|
4
|
+
import { t as cjsModuleRunnerPlugin } from "./cjs-BspwazE6.js";
|
|
6
5
|
import { i as toCssVirtual, n as parseIdQuery, r as parseReferenceValidationVirtual, t as parseCssVirtual } from "./shared-DeahDSXi.js";
|
|
7
|
-
import { findDirectives, transformDirectiveProxyExport, transformServerActionServer, transformWrapExport } from "./transforms/index.js";
|
|
8
|
-
import { o as generateEncryptionKey, s as toBase64 } from "./encryption-utils-
|
|
6
|
+
import { findDirectives, transformDirectiveProxyExport, transformExpandExportAll, transformServerActionServer, transformWrapExport } from "./transforms/index.js";
|
|
7
|
+
import { o as generateEncryptionKey, s as toBase64 } from "./encryption-utils-CRBgMeBq.js";
|
|
9
8
|
import { createRpcServer } from "./utils/rpc.js";
|
|
10
9
|
import { createRequire } from "node:module";
|
|
11
10
|
import assert from "node:assert";
|
|
@@ -23,6 +22,29 @@ import { crawlFrameworkPkgs } from "vitefu";
|
|
|
23
22
|
import { walk } from "estree-walker";
|
|
24
23
|
import { stripVTControlCharacters } from "node:util";
|
|
25
24
|
import { createHash } from "node:crypto";
|
|
25
|
+
//#region \0rolldown/runtime.js
|
|
26
|
+
var __create = Object.create;
|
|
27
|
+
var __defProp = Object.defineProperty;
|
|
28
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
29
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
30
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
31
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
32
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
33
|
+
var __copyProps = (to, from, except, desc) => {
|
|
34
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
35
|
+
key = keys[i];
|
|
36
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
37
|
+
get: ((k) => from[k]).bind(null, key),
|
|
38
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return to;
|
|
42
|
+
};
|
|
43
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
44
|
+
value: mod,
|
|
45
|
+
enumerable: true
|
|
46
|
+
}) : target, mod));
|
|
47
|
+
//#endregion
|
|
26
48
|
//#region src/plugins/vite-utils.ts
|
|
27
49
|
const VALID_ID_PREFIX = `/@id/`;
|
|
28
50
|
const NULL_BYTE_PLACEHOLDER = `__x00__`;
|
|
@@ -605,7 +627,7 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
|
|
|
605
627
|
function vitePluginRsc(rscPluginOptions = {}) {
|
|
606
628
|
const manager = new RscPluginManager();
|
|
607
629
|
const buildApp = async (builder) => {
|
|
608
|
-
const colors = await import("./picocolors-
|
|
630
|
+
const colors = await import("./picocolors-CEw5D0BV.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
609
631
|
const logStep = (msg) => {
|
|
610
632
|
builder.config.logger.info(colors.blue(msg));
|
|
611
633
|
};
|
|
@@ -1202,6 +1224,17 @@ function globalAsyncLocalStoragePlugin() {
|
|
|
1202
1224
|
}
|
|
1203
1225
|
}];
|
|
1204
1226
|
}
|
|
1227
|
+
function createTransformExpandExportAllContext(ctx) {
|
|
1228
|
+
return {
|
|
1229
|
+
resolve: async (source, importer) => {
|
|
1230
|
+
return (await ctx.resolve(source, importer))?.id;
|
|
1231
|
+
},
|
|
1232
|
+
load: async (id) => {
|
|
1233
|
+
const raw = await fs.promises.readFile(id, "utf-8");
|
|
1234
|
+
return parseAstAsync((await (vite.transformWithOxc ?? vite.transformWithEsbuild)(raw, id, { sourcemap: false })).code);
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1205
1238
|
function vitePluginUseClient(useClientPluginOptions, manager) {
|
|
1206
1239
|
const packageSources = /* @__PURE__ */ new Map();
|
|
1207
1240
|
const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/;
|
|
@@ -1222,7 +1255,7 @@ function vitePluginUseClient(useClientPluginOptions, manager) {
|
|
|
1222
1255
|
delete manager.clientReferenceMetaMap[id];
|
|
1223
1256
|
return;
|
|
1224
1257
|
}
|
|
1225
|
-
|
|
1258
|
+
let ast = await parseAstAsync(code);
|
|
1226
1259
|
if (!hasDirective(ast.body, "use client")) {
|
|
1227
1260
|
delete manager.clientReferenceMetaMap[id];
|
|
1228
1261
|
return;
|
|
@@ -1231,6 +1264,16 @@ function vitePluginUseClient(useClientPluginOptions, manager) {
|
|
|
1231
1264
|
const directives = findDirectives(ast, "use server");
|
|
1232
1265
|
if (directives.length > 0) this.error(`'use server' directive is not allowed inside 'use client'`, directives[0]?.start);
|
|
1233
1266
|
}
|
|
1267
|
+
const expanded = await transformExpandExportAll({
|
|
1268
|
+
code,
|
|
1269
|
+
ast,
|
|
1270
|
+
importer: id,
|
|
1271
|
+
...createTransformExpandExportAllContext(this)
|
|
1272
|
+
});
|
|
1273
|
+
if (expanded) {
|
|
1274
|
+
code = expanded.code;
|
|
1275
|
+
ast = await parseAstAsync(code);
|
|
1276
|
+
}
|
|
1234
1277
|
let importId;
|
|
1235
1278
|
let referenceKey;
|
|
1236
1279
|
const packageSource = packageSources.get(id);
|
|
@@ -1521,7 +1564,19 @@ function vitePluginUseServer(useServerPluginOptions, manager) {
|
|
|
1521
1564
|
delete manager.serverReferenceMetaMap[id];
|
|
1522
1565
|
return;
|
|
1523
1566
|
}
|
|
1524
|
-
|
|
1567
|
+
let ast = await parseAstAsync(code);
|
|
1568
|
+
if (hasDirective(ast.body, "use server")) {
|
|
1569
|
+
const expanded = await transformExpandExportAll({
|
|
1570
|
+
code,
|
|
1571
|
+
ast,
|
|
1572
|
+
importer: id,
|
|
1573
|
+
...createTransformExpandExportAllContext(this)
|
|
1574
|
+
});
|
|
1575
|
+
if (expanded) {
|
|
1576
|
+
code = expanded.code;
|
|
1577
|
+
ast = await parseAstAsync(code);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1525
1580
|
let normalizedId_;
|
|
1526
1581
|
const getNormalizedId = () => {
|
|
1527
1582
|
if (!normalizedId_) {
|
|
@@ -1967,4 +2022,4 @@ function __vite_rsc_wrap_css__(value, name) {
|
|
|
1967
2022
|
}
|
|
1968
2023
|
}
|
|
1969
2024
|
//#endregion
|
|
1970
|
-
export { vitePluginRscMinimal as i, transformRscCssExport as n, vitePluginRsc as r, getPluginApi as t };
|
|
2025
|
+
export { __commonJSMin as a, vitePluginRscMinimal as i, transformRscCssExport as n, vitePluginRsc as r, getPluginApi as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as TransformWrapExportFilter } from "./index-DViteJjw.js";
|
|
2
2
|
import MagicString from "magic-string";
|
|
3
3
|
import { Plugin, ResolvedConfig, Rollup, ViteDevServer, parseAstAsync } from "vite";
|
|
4
4
|
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-Bm-Fb4g7.js";
|
|
2
2
|
export { AssetDeps, AssetsManifest, PluginApi, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginManager, RscPluginOptions, vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-
|
|
1
|
+
import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-BK29Va7z.js";
|
|
2
2
|
export { vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
|
package/dist/plugins/cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cjsModuleRunnerPlugin } from "../cjs-
|
|
1
|
+
import { t as cjsModuleRunnerPlugin } from "../cjs-BspwazE6.js";
|
|
2
2
|
export { cjsModuleRunnerPlugin };
|
package/dist/react/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as CreateFromReadableStreamBrowserOptions, n as CallServerCallback, r as ClientTemporaryReferenceSet, s as EncodeReplyFunction } from "../index-
|
|
2
|
-
import { t as setRequireModule } from "../browser-
|
|
1
|
+
import { i as CreateFromReadableStreamBrowserOptions, n as CallServerCallback, r as ClientTemporaryReferenceSet, s as EncodeReplyFunction } from "../index-BrXJaflA.js";
|
|
2
|
+
import { t as setRequireModule } from "../browser-C_qguV-a.js";
|
|
3
3
|
|
|
4
4
|
//#region src/react/browser.d.ts
|
|
5
5
|
declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamBrowserOptions): Promise<T>;
|
package/dist/react/rsc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CreateFromReadableStreamEdgeOptions, d as ServerTemporaryReferenceSet, l as RenderToReadableStreamOptions, o as DecodeReplyFunction, r as ClientTemporaryReferenceSet, s as EncodeReplyFunction } from "../index-
|
|
1
|
+
import { a as CreateFromReadableStreamEdgeOptions, d as ServerTemporaryReferenceSet, l as RenderToReadableStreamOptions, o as DecodeReplyFunction, r as ClientTemporaryReferenceSet, s as EncodeReplyFunction } from "../index-BrXJaflA.js";
|
|
2
2
|
import { loadServerAction, setRequireModule } from "../core/rsc.js";
|
|
3
3
|
import { ReactFormState } from "react-dom/client";
|
|
4
4
|
|
package/dist/react/ssr.d.ts
CHANGED
package/dist/rsc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./core/rsc.js";
|
|
2
|
-
import { i as ResolvedAssetDeps } from "./plugin-
|
|
2
|
+
import { i as ResolvedAssetDeps } from "./plugin-Bm-Fb4g7.js";
|
|
3
3
|
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference } from "./react/rsc.js";
|
|
4
4
|
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./utils/encryption-runtime.js";
|
|
5
5
|
|
|
@@ -4,42 +4,6 @@ import { walk } from "estree-walker";
|
|
|
4
4
|
function hasDirective(body, directive) {
|
|
5
5
|
return !!body.find((stmt) => stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && stmt.expression.value === directive);
|
|
6
6
|
}
|
|
7
|
-
function getExportNames(ast, options) {
|
|
8
|
-
const exportNames = [];
|
|
9
|
-
for (const node of ast.body) {
|
|
10
|
-
if (node.type === "ExportNamedDeclaration") if (node.declaration) if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration")
|
|
11
|
-
/**
|
|
12
|
-
* export function foo() {}
|
|
13
|
-
*/
|
|
14
|
-
exportNames.push(node.declaration.id.name);
|
|
15
|
-
else if (node.declaration.type === "VariableDeclaration")
|
|
16
|
-
/**
|
|
17
|
-
* export const foo = 1, bar = 2
|
|
18
|
-
*/
|
|
19
|
-
for (const decl of node.declaration.declarations) exportNames.push(...extractNames(decl.id));
|
|
20
|
-
else node.declaration;
|
|
21
|
-
else
|
|
22
|
-
/**
|
|
23
|
-
* export { foo, bar as car } from './foo'
|
|
24
|
-
* export { foo, bar as car }
|
|
25
|
-
*/
|
|
26
|
-
for (const spec of node.specifiers) {
|
|
27
|
-
tinyassert(spec.exported.type === "Identifier");
|
|
28
|
-
exportNames.push(spec.exported.name);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* export * from './foo'
|
|
32
|
-
*/
|
|
33
|
-
if (!options.ignoreExportAllDeclaration && node.type === "ExportAllDeclaration") throw new Error("unsupported ExportAllDeclaration");
|
|
34
|
-
/**
|
|
35
|
-
* export default function foo() {}
|
|
36
|
-
* export default class Foo {}
|
|
37
|
-
* export default () => {}
|
|
38
|
-
*/
|
|
39
|
-
if (node.type === "ExportDefaultDeclaration") exportNames.push("default");
|
|
40
|
-
}
|
|
41
|
-
return { exportNames };
|
|
42
|
-
}
|
|
43
7
|
function extractNames(param) {
|
|
44
8
|
return extractIdentifiers(param).map((n) => n.name);
|
|
45
9
|
}
|
|
@@ -76,6 +40,8 @@ function validateNonAsyncFunction(opts, node) {
|
|
|
76
40
|
//#endregion
|
|
77
41
|
//#region src/transforms/scope.ts
|
|
78
42
|
var Scope = class {
|
|
43
|
+
parent;
|
|
44
|
+
isFunction;
|
|
79
45
|
declarations = /* @__PURE__ */ new Set();
|
|
80
46
|
constructor(parent, isFunction) {
|
|
81
47
|
this.parent = parent;
|
|
@@ -208,4 +174,4 @@ function getOutermostBindableReference(id, parentStack) {
|
|
|
208
174
|
return current;
|
|
209
175
|
}
|
|
210
176
|
//#endregion
|
|
211
|
-
export {
|
|
177
|
+
export { validateNonAsyncFunction as a, hasDirective as i, extractIdentifiers as n, extractNames as r, buildScopeTree as t };
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServerConsumerManifest, setRequireModule } from "./core/ssr.js";
|
|
2
|
-
import { i as ResolvedAssetDeps } from "./plugin-
|
|
2
|
+
import { i as ResolvedAssetDeps } from "./plugin-Bm-Fb4g7.js";
|
|
3
3
|
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./react/ssr.js";
|
|
4
4
|
|
|
5
5
|
//#region src/ssr.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { TransformProxyExportOptions, TransformWrapExportFilter, TransformWrapExportOptions, extractIdentifiers, extractNames, findDirectives,
|
|
1
|
+
import { a as extractIdentifiers, c as validateNonAsyncFunction, d as transformProxyExport, f as TransformWrapExportFilter, g as transformHoistInlineDirective, h as findDirectives, i as transformServerActionServer, l as TransformProxyExportOptions, m as transformWrapExport, n as TransformExpandExportAllOptions, o as extractNames, p as TransformWrapExportOptions, r as transformExpandExportAll, s as hasDirective, t as TransformExpandExportAllContext, u as transformDirectiveProxyExport } from "../index-DViteJjw.js";
|
|
2
|
+
export { TransformExpandExportAllContext, TransformExpandExportAllOptions, TransformProxyExportOptions, TransformWrapExportFilter, TransformWrapExportOptions, extractIdentifiers, extractNames, findDirectives, hasDirective, transformDirectiveProxyExport, transformExpandExportAll, transformHoistInlineDirective, transformProxyExport, transformServerActionServer, transformWrapExport, validateNonAsyncFunction };
|
package/dist/transforms/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as tinyassert } from "../dist-rz-Bnebz.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as validateNonAsyncFunction, i as hasDirective, n as extractIdentifiers, r as extractNames, t as buildScopeTree } from "../scope-Bwt9GVLP.js";
|
|
3
3
|
import MagicString from "magic-string";
|
|
4
4
|
import { walk } from "estree-walker";
|
|
5
5
|
//#region src/transforms/hoist.ts
|
|
@@ -217,7 +217,7 @@ function transformWrapExport(input, ast, options) {
|
|
|
217
217
|
output.remove(node.start, node.end);
|
|
218
218
|
for (const spec of node.specifiers) {
|
|
219
219
|
tinyassert(spec.local.type === "Identifier");
|
|
220
|
-
|
|
220
|
+
if (spec.exported.type !== "Identifier") throw Object.assign(/* @__PURE__ */ new Error("unsupported string literal export name"), { pos: spec.exported.start });
|
|
221
221
|
const name = spec.local.name;
|
|
222
222
|
toAppend.push(`import { ${name} as $$import_${name} } from ${node.source.raw}`);
|
|
223
223
|
wrapExport(`$$import_${name}`, spec.exported.name);
|
|
@@ -229,14 +229,17 @@ function transformWrapExport(input, ast, options) {
|
|
|
229
229
|
output.remove(node.start, node.end);
|
|
230
230
|
for (const spec of node.specifiers) {
|
|
231
231
|
tinyassert(spec.local.type === "Identifier");
|
|
232
|
-
|
|
232
|
+
if (spec.exported.type !== "Identifier") throw Object.assign(/* @__PURE__ */ new Error("unsupported string literal export name"), { pos: spec.exported.start });
|
|
233
233
|
wrapExport(spec.local.name, spec.exported.name);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
|
+
* export * as ns from './foo'
|
|
237
238
|
* export * from './foo'
|
|
238
239
|
*/
|
|
239
|
-
if (
|
|
240
|
+
if (node.type === "ExportAllDeclaration") {
|
|
241
|
+
if (!options.ignoreExportAllDeclaration) throw Object.assign(/* @__PURE__ */ new Error("unsupported ExportAllDeclaration"), { pos: node.start });
|
|
242
|
+
}
|
|
240
243
|
/**
|
|
241
244
|
* export default function foo() {}
|
|
242
245
|
* export default class Foo {}
|
|
@@ -325,7 +328,7 @@ function transformProxyExport(ast, options) {
|
|
|
325
328
|
*/
|
|
326
329
|
const names = [];
|
|
327
330
|
for (const spec of node.specifiers) {
|
|
328
|
-
|
|
331
|
+
if (spec.exported.type !== "Identifier") throw Object.assign(/* @__PURE__ */ new Error("unsupported string literal export name"), { pos: spec.exported.start });
|
|
329
332
|
names.push(spec.exported.name);
|
|
330
333
|
}
|
|
331
334
|
createExport(node, names);
|
|
@@ -333,9 +336,16 @@ function transformProxyExport(ast, options) {
|
|
|
333
336
|
continue;
|
|
334
337
|
}
|
|
335
338
|
/**
|
|
339
|
+
* export * as ns from './foo'
|
|
336
340
|
* export * from './foo'
|
|
337
341
|
*/
|
|
338
|
-
if (
|
|
342
|
+
if (node.type === "ExportAllDeclaration") {
|
|
343
|
+
if (node.exported?.type === "Identifier") {
|
|
344
|
+
createExport(node, [node.exported.name]);
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
if (!options.ignoreExportAllDeclaration) throw new Error("unsupported ExportAllDeclaration");
|
|
348
|
+
}
|
|
339
349
|
/**
|
|
340
350
|
* export default function foo() {}
|
|
341
351
|
* export default class Foo {}
|
|
@@ -364,4 +374,82 @@ function transformServerActionServer(input, ast, options) {
|
|
|
364
374
|
});
|
|
365
375
|
}
|
|
366
376
|
//#endregion
|
|
367
|
-
export
|
|
377
|
+
//#region src/transforms/expand-export-all.ts
|
|
378
|
+
async function transformExpandExportAll(options) {
|
|
379
|
+
const { plans } = resolveStarExports(await scanModuleExports(options.ast, options.importer, options));
|
|
380
|
+
if (plans.length === 0) return;
|
|
381
|
+
const output = new MagicString(options.code);
|
|
382
|
+
for (const item of plans) {
|
|
383
|
+
const newExport = `export {${item.names.join(", ")}} from ${JSON.stringify(item.node.source.value)};`;
|
|
384
|
+
output.update(item.node.start, item.node.end, newExport);
|
|
385
|
+
}
|
|
386
|
+
return { code: output.toString() };
|
|
387
|
+
}
|
|
388
|
+
async function scanModuleExports(ast, importer, context, seen = /* @__PURE__ */ new Set()) {
|
|
389
|
+
const starSources = [];
|
|
390
|
+
const bareStars = ast.body.filter((n) => n.type === "ExportAllDeclaration" && !n.exported);
|
|
391
|
+
for (const node of bareStars) {
|
|
392
|
+
const source = node.source.value;
|
|
393
|
+
const resolved = await context.resolve(source, importer);
|
|
394
|
+
if (!resolved) throw Object.assign(/* @__PURE__ */ new Error(`failed to resolve export-all source ${JSON.stringify(source)}`), { pos: node.start });
|
|
395
|
+
starSources.push({
|
|
396
|
+
node,
|
|
397
|
+
scan: await collectExportScan(resolved, context, new Set(seen))
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
explicitNames: collectExplicitExportNames(ast),
|
|
402
|
+
starSources
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
async function collectExportScan(resolvedId, context, seen) {
|
|
406
|
+
if (seen.has(resolvedId)) return {
|
|
407
|
+
names: [],
|
|
408
|
+
ambiguousNames: /* @__PURE__ */ new Set()
|
|
409
|
+
};
|
|
410
|
+
seen.add(resolvedId);
|
|
411
|
+
const scan = await scanModuleExports(await context.load(resolvedId), resolvedId, context, seen);
|
|
412
|
+
const resolved = resolveStarExports(scan);
|
|
413
|
+
return {
|
|
414
|
+
names: [...scan.explicitNames, ...resolved.plans.flatMap((item) => item.names)],
|
|
415
|
+
ambiguousNames: resolved.ambiguousNames
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function collectExplicitExportNames(ast) {
|
|
419
|
+
const names = /* @__PURE__ */ new Set();
|
|
420
|
+
for (const node of ast.body) if (node.type === "ExportNamedDeclaration") if (node.declaration) {
|
|
421
|
+
if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
|
|
422
|
+
if (node.declaration.id) names.add(node.declaration.id.name);
|
|
423
|
+
} else if (node.declaration.type === "VariableDeclaration") for (const decl of node.declaration.declarations) for (const name of extractNames(decl.id)) names.add(name);
|
|
424
|
+
} else for (const spec of node.specifiers) if (spec.exported.type === "Identifier") names.add(spec.exported.name);
|
|
425
|
+
else throw Object.assign(/* @__PURE__ */ new Error("unsupported string literal export name"), { pos: spec.exported.start });
|
|
426
|
+
else if (node.type === "ExportDefaultDeclaration") names.add("default");
|
|
427
|
+
else if (node.type === "ExportAllDeclaration") {
|
|
428
|
+
if (node.exported?.type === "Identifier") names.add(node.exported.name);
|
|
429
|
+
}
|
|
430
|
+
return names;
|
|
431
|
+
}
|
|
432
|
+
function resolveStarExports(scan) {
|
|
433
|
+
const seenStarNames = /* @__PURE__ */ new Set();
|
|
434
|
+
const ambiguousNames = /* @__PURE__ */ new Set();
|
|
435
|
+
for (const source of scan.starSources) for (const name of source.scan.names) {
|
|
436
|
+
if (name === "default" || scan.explicitNames.has(name)) continue;
|
|
437
|
+
if (seenStarNames.has(name)) ambiguousNames.add(name);
|
|
438
|
+
else seenStarNames.add(name);
|
|
439
|
+
}
|
|
440
|
+
for (const source of scan.starSources) for (const name of source.scan.ambiguousNames) if (!scan.explicitNames.has(name)) ambiguousNames.add(name);
|
|
441
|
+
const plans = [];
|
|
442
|
+
for (const source of scan.starSources) {
|
|
443
|
+
const names = source.scan.names.filter((name) => name !== "default" && !scan.explicitNames.has(name) && !ambiguousNames.has(name));
|
|
444
|
+
plans.push({
|
|
445
|
+
node: source.node,
|
|
446
|
+
names
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return {
|
|
450
|
+
ambiguousNames,
|
|
451
|
+
plans
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
export { extractIdentifiers, extractNames, findDirectives, hasDirective, transformDirectiveProxyExport, transformExpandExportAll, transformHoistInlineDirective, transformProxyExport, transformServerActionServer, transformWrapExport, validateNonAsyncFunction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as once } from "../dist-rz-Bnebz.js";
|
|
2
|
-
import { a as fromBase64, i as encryptBuffer, n as concatArrayStream, r as decryptBuffer, t as arrayToStream } from "../encryption-utils-
|
|
2
|
+
import { a as fromBase64, i as encryptBuffer, n as concatArrayStream, r as decryptBuffer, t as arrayToStream } from "../encryption-utils-CRBgMeBq.js";
|
|
3
3
|
import { createFromReadableStream, renderToReadableStream } from "../react/rsc.js";
|
|
4
4
|
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
5
5
|
//#region src/utils/encryption-runtime.ts
|
package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js
CHANGED
|
@@ -541,7 +541,7 @@
|
|
|
541
541
|
null === formData && (formData = new FormData());
|
|
542
542
|
var _data3 = formData;
|
|
543
543
|
key = nextPartId++;
|
|
544
|
-
var prefix = formFieldPrefix + key + "_";
|
|
544
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
545
545
|
value.forEach(function (originalValue, originalKey) {
|
|
546
546
|
_data3.append(prefix + originalKey, originalValue);
|
|
547
547
|
});
|
|
@@ -4901,10 +4901,10 @@
|
|
|
4901
4901
|
return hook.checkDCE ? !0 : !1;
|
|
4902
4902
|
})({
|
|
4903
4903
|
bundleType: 1,
|
|
4904
|
-
version: "19.2.
|
|
4904
|
+
version: "19.2.6",
|
|
4905
4905
|
rendererPackageName: "react-server-dom-webpack",
|
|
4906
4906
|
currentDispatcherRef: ReactSharedInternals,
|
|
4907
|
-
reconcilerVersion: "19.2.
|
|
4907
|
+
reconcilerVersion: "19.2.6",
|
|
4908
4908
|
getCurrentComponentInfo: function () {
|
|
4909
4909
|
return currentOwnerInDEV;
|
|
4910
4910
|
}
|
package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js
CHANGED
|
@@ -346,7 +346,7 @@ function processReply(
|
|
|
346
346
|
null === formData && (formData = new FormData());
|
|
347
347
|
var data$31 = formData;
|
|
348
348
|
key = nextPartId++;
|
|
349
|
-
var prefix = formFieldPrefix + key + "_";
|
|
349
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
350
350
|
value.forEach(function (originalValue, originalKey) {
|
|
351
351
|
data$31.append(prefix + originalKey, originalValue);
|
|
352
352
|
});
|
package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js
CHANGED
|
@@ -562,7 +562,7 @@
|
|
|
562
562
|
null === formData && (formData = new FormData());
|
|
563
563
|
var _data3 = formData;
|
|
564
564
|
key = nextPartId++;
|
|
565
|
-
var prefix = formFieldPrefix + key + "_";
|
|
565
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
566
566
|
value.forEach(function (originalValue, originalKey) {
|
|
567
567
|
_data3.append(prefix + originalKey, originalValue);
|
|
568
568
|
});
|
|
@@ -358,7 +358,7 @@ function processReply(
|
|
|
358
358
|
null === formData && (formData = new FormData());
|
|
359
359
|
var data$31 = formData;
|
|
360
360
|
key = nextPartId++;
|
|
361
|
-
var prefix = formFieldPrefix + key + "_";
|
|
361
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
362
362
|
value.forEach(function (originalValue, originalKey) {
|
|
363
363
|
data$31.append(prefix + originalKey, originalValue);
|
|
364
364
|
});
|
package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js
CHANGED
|
@@ -562,7 +562,7 @@
|
|
|
562
562
|
null === formData && (formData = new FormData());
|
|
563
563
|
var _data3 = formData;
|
|
564
564
|
key = nextPartId++;
|
|
565
|
-
var prefix = formFieldPrefix + key + "_";
|
|
565
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
566
566
|
value.forEach(function (originalValue, originalKey) {
|
|
567
567
|
_data3.append(prefix + originalKey, originalValue);
|
|
568
568
|
});
|
|
@@ -359,7 +359,7 @@ function processReply(
|
|
|
359
359
|
null === formData && (formData = new FormData());
|
|
360
360
|
var data$31 = formData;
|
|
361
361
|
key = nextPartId++;
|
|
362
|
-
var prefix = formFieldPrefix + key + "_";
|
|
362
|
+
var prefix = formFieldPrefix + "_" + key + "_";
|
|
363
363
|
value.forEach(function (originalValue, originalKey) {
|
|
364
364
|
data$31.append(prefix + originalKey, originalValue);
|
|
365
365
|
});
|