@vitejs/plugin-rsc 0.4.17 → 0.4.19
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-QWbIPyhO.js → browser-BhJd-Orx.js} +1 -1
- package/dist/{browser-C1Q4O7AS.js → browser-DIa4fISB.js} +1 -1
- package/dist/browser.js +3 -3
- package/dist/core/browser.js +2 -2
- package/dist/core/rsc.js +2 -2
- package/dist/core/ssr.js +2 -2
- package/dist/{dist-DEF94lDJ.js → dist-DiJnRA1C.js} +25 -1
- package/dist/{encryption-runtime-D6SQwJ1j.js → encryption-runtime-CJUalqt3.js} +2 -2
- package/dist/extra/browser.js +3 -3
- package/dist/extra/rsc.js +5 -5
- package/dist/extra/ssr.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{plugin-BxEQycAE.js → plugin-Cu7_zbmH.js} +121 -67
- package/dist/plugin.js +2 -2
- package/dist/react/browser.js +2 -2
- package/dist/react/rsc.js +3 -3
- package/dist/react/ssr.js +3 -3
- package/dist/{rsc-DKA6wwTB.js → rsc-BfBPoIV8.js} +1 -1
- package/dist/{rsc-DP-89iIT.js → rsc-CGUEQCnf.js} +1 -1
- package/dist/{rsc-DHfL29FT.js → rsc-VjVw_i-M.js} +1 -1
- package/dist/rsc.js +5 -5
- package/dist/{ssr-MYoobcMC.js → ssr--rFiBtws.js} +1 -1
- package/dist/{ssr-BLt64xPK.js → ssr-BEKKb_cw.js} +1 -1
- package/dist/{ssr-ClDiSAPx.js → ssr-BuzPa0Go.js} +1 -1
- package/dist/ssr.js +4 -4
- package/dist/utils/encryption-runtime.js +4 -4
- package/package.json +3 -4
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-DiJnRA1C.js";
|
|
2
2
|
import "./shared-CEyKoKAb.js";
|
|
3
|
-
import { setRequireModule } from "./browser-
|
|
3
|
+
import { setRequireModule } from "./browser-BhJd-Orx.js";
|
|
4
4
|
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./browser-D8OPzpF5.js";
|
|
5
|
-
import "./browser-
|
|
5
|
+
import "./browser-DIa4fISB.js";
|
|
6
6
|
|
|
7
7
|
export { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/core/browser.js
CHANGED
package/dist/core/rsc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule } from "../rsc-
|
|
3
|
+
import { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule } from "../rsc-BfBPoIV8.js";
|
|
4
4
|
|
|
5
5
|
export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
|
package/dist/core/ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { createServerConsumerManifest, setRequireModule } from "../ssr
|
|
3
|
+
import { createServerConsumerManifest, setRequireModule } from "../ssr--rFiBtws.js";
|
|
4
4
|
|
|
5
5
|
export { createServerConsumerManifest, setRequireModule };
|
|
@@ -36,6 +36,30 @@ function memoize(f, options) {
|
|
|
36
36
|
return newValue;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
+
function escapeRegExp(input) {
|
|
40
|
+
return input.replace(/[/\-\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
41
|
+
}
|
|
42
|
+
function createDebug(namespace) {
|
|
43
|
+
const pattern = createDebugPattern(namespace);
|
|
44
|
+
return (...args) => {
|
|
45
|
+
const flag = globalThis.process?.env?.["DEBUG"] ?? globalThis.__DEBUG;
|
|
46
|
+
if (typeof flag === "string" && pattern.test(flag)) {
|
|
47
|
+
let prefix = `\u22B3 ${namespace}`;
|
|
48
|
+
const stderr = globalThis?.process?.stderr;
|
|
49
|
+
if (stderr) {
|
|
50
|
+
if (stderr?.isTTY) prefix = `\x1B[1m${prefix}\x1B[22m`;
|
|
51
|
+
console.error(prefix, ...args);
|
|
52
|
+
} else console.debug(prefix, ...args);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function createDebugPattern(namespace) {
|
|
57
|
+
const parts = namespace.split(":");
|
|
58
|
+
const alts = [namespace];
|
|
59
|
+
for (let i = 1; i < parts.length; i++) alts.push(parts.slice(0, i).join(":") + ":*");
|
|
60
|
+
const pattern = alts.map((pattern2) => escapeRegExp(pattern2)).join("|");
|
|
61
|
+
return /* @__PURE__ */ new RegExp(`(^|,)(${pattern})($|,)`);
|
|
62
|
+
}
|
|
39
63
|
|
|
40
64
|
//#endregion
|
|
41
|
-
export { memoize, once, tinyassert };
|
|
65
|
+
export { createDebug, memoize, once, tinyassert };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { once } from "./dist-
|
|
1
|
+
import { once } from "./dist-DiJnRA1C.js";
|
|
2
2
|
import { arrayToStream, concatArrayStream, decryptBuffer, encryptBuffer, fromBase64 } from "./encryption-utils-BDwwcMVT.js";
|
|
3
|
-
import { createFromReadableStream, renderToReadableStream } from "./rsc-
|
|
3
|
+
import { createFromReadableStream, renderToReadableStream } from "./rsc-VjVw_i-M.js";
|
|
4
4
|
import encryptionKeySource from "virtual:vite-rsc/encryption-key";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/encryption-runtime.ts
|
package/dist/extra/browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import "../browser-
|
|
3
|
+
import "../browser-BhJd-Orx.js";
|
|
4
4
|
import { createFromFetch, createFromReadableStream, createTemporaryReferenceSet, encodeReply, setServerCallback } from "../browser-D8OPzpF5.js";
|
|
5
|
-
import "../browser-
|
|
5
|
+
import "../browser-DIa4fISB.js";
|
|
6
6
|
import { rscStream } from "../client-C1J4FCf5.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import ReactDomClient from "react-dom/client";
|
package/dist/extra/rsc.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
3
|
import "../encryption-utils-BDwwcMVT.js";
|
|
4
|
-
import { loadServerAction } from "../rsc-
|
|
5
|
-
import { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, renderToReadableStream } from "../rsc-
|
|
6
|
-
import "../encryption-runtime-
|
|
7
|
-
import "../rsc-
|
|
4
|
+
import { loadServerAction } from "../rsc-BfBPoIV8.js";
|
|
5
|
+
import { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, renderToReadableStream } from "../rsc-VjVw_i-M.js";
|
|
6
|
+
import "../encryption-runtime-CJUalqt3.js";
|
|
7
|
+
import "../rsc-CGUEQCnf.js";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/extra/rsc.tsx
|
package/dist/extra/ssr.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import "../ssr
|
|
4
|
-
import { createFromReadableStream } from "../ssr-
|
|
5
|
-
import "../ssr-
|
|
3
|
+
import "../ssr--rFiBtws.js";
|
|
4
|
+
import { createFromReadableStream } from "../ssr-BEKKb_cw.js";
|
|
5
|
+
import "../ssr-BuzPa0Go.js";
|
|
6
6
|
import { injectRSCPayload } from "../server-D0-DavPP.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-DiJnRA1C.js";
|
|
2
2
|
import "./plugin-CZbI4rhS.js";
|
|
3
|
-
import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-
|
|
3
|
+
import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-Cu7_zbmH.js";
|
|
4
4
|
import "./encryption-utils-BDwwcMVT.js";
|
|
5
5
|
import "./rpc-tGuLT8PD.js";
|
|
6
6
|
import "./vite-utils-Vzd7cqfv.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { tinyassert } from "./dist-
|
|
1
|
+
import { createDebug, tinyassert } from "./dist-DiJnRA1C.js";
|
|
2
2
|
import { vitePluginRscCore } from "./plugin-CZbI4rhS.js";
|
|
3
3
|
import { generateEncryptionKey, toBase64 } from "./encryption-utils-BDwwcMVT.js";
|
|
4
4
|
import { createRpcServer } from "./rpc-tGuLT8PD.js";
|
|
5
|
-
import { normalizeViteImportAnalysisUrl, prepareError } from "./vite-utils-Vzd7cqfv.js";
|
|
5
|
+
import { cleanUrl, normalizeViteImportAnalysisUrl, prepareError } from "./vite-utils-Vzd7cqfv.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import assert from "node:assert";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -301,6 +301,120 @@ function transformServerActionServer(input, ast, options) {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/plugins/utils.ts
|
|
306
|
+
function evalValue(rawValue) {
|
|
307
|
+
const fn = new Function(`
|
|
308
|
+
var console, exports, global, module, process, require
|
|
309
|
+
return (\n${rawValue}\n)
|
|
310
|
+
`);
|
|
311
|
+
return fn();
|
|
312
|
+
}
|
|
313
|
+
function parseIdQuery(id) {
|
|
314
|
+
if (!id.includes("?")) return {
|
|
315
|
+
filename: id,
|
|
316
|
+
query: {}
|
|
317
|
+
};
|
|
318
|
+
const [filename, rawQuery] = id.split(`?`, 2);
|
|
319
|
+
const query = Object.fromEntries(new URLSearchParams(rawQuery));
|
|
320
|
+
return {
|
|
321
|
+
filename,
|
|
322
|
+
query
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/transforms/cjs.ts
|
|
328
|
+
function transformCjsToEsm(code, ast) {
|
|
329
|
+
const output = new MagicString(code);
|
|
330
|
+
const analyzed = analyze(ast);
|
|
331
|
+
let parentNodes = [];
|
|
332
|
+
let hoistIndex = 0;
|
|
333
|
+
walk(ast, {
|
|
334
|
+
enter(node) {
|
|
335
|
+
parentNodes.push(node);
|
|
336
|
+
if (node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "require" && node.arguments.length === 1) {
|
|
337
|
+
let isTopLevel = true;
|
|
338
|
+
for (const parent of parentNodes) {
|
|
339
|
+
if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration" || parent.type === "ArrowFunctionExpression") isTopLevel = false;
|
|
340
|
+
const scope = analyzed.map.get(parent);
|
|
341
|
+
if (scope && scope.declarations.has("require")) return;
|
|
342
|
+
}
|
|
343
|
+
if (isTopLevel) {
|
|
344
|
+
output.update(node.start, node.callee.end, "(await import");
|
|
345
|
+
output.appendRight(node.end, ")");
|
|
346
|
+
} else {
|
|
347
|
+
const hoisted = `__cjs_to_esm_hoist_${hoistIndex}`;
|
|
348
|
+
const importee = code.slice(node.arguments[0].start, node.arguments[0].end);
|
|
349
|
+
output.prepend(`const ${hoisted} = await import(${importee});\n`);
|
|
350
|
+
output.update(node.start, node.end, hoisted);
|
|
351
|
+
hoistIndex++;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
leave() {
|
|
356
|
+
parentNodes.pop();
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
output.prepend(`const exports = {}; const module = { exports };\n`);
|
|
360
|
+
return { output };
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/plugins/cjs.ts
|
|
365
|
+
const debug = createDebug("vite-rsc:cjs");
|
|
366
|
+
function cjsModuleRunnerPlugin() {
|
|
367
|
+
const warnedPackages = /* @__PURE__ */ new Set();
|
|
368
|
+
return [{
|
|
369
|
+
name: "cjs-module-runner-transform",
|
|
370
|
+
apply: "serve",
|
|
371
|
+
applyToEnvironment: (env) => env.config.dev.moduleRunnerTransform,
|
|
372
|
+
async transform(code, id) {
|
|
373
|
+
if (id.includes("/node_modules/") && !id.startsWith(this.environment.config.cacheDir) && /\b(require|exports)\b/.test(code)) {
|
|
374
|
+
id = parseIdQuery(id).filename;
|
|
375
|
+
if (!/\.[cm]?js$/.test(id)) return;
|
|
376
|
+
if (id.endsWith(".mjs")) return;
|
|
377
|
+
if (id.endsWith(".js")) {
|
|
378
|
+
const pkgJsonPath = await findClosestPkgJsonPath(path.dirname(id));
|
|
379
|
+
if (pkgJsonPath) {
|
|
380
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
381
|
+
if (pkgJson.type === "module") return;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
const [, , , hasModuleSyntax] = esModuleLexer.parse(code);
|
|
385
|
+
if (hasModuleSyntax) return;
|
|
386
|
+
const packageKey = extractPackageKey(id);
|
|
387
|
+
if (!warnedPackages.has(packageKey)) {
|
|
388
|
+
debug(`non-optimized CJS dependency in '${this.environment.name}' environment: ${id}`);
|
|
389
|
+
warnedPackages.add(packageKey);
|
|
390
|
+
}
|
|
391
|
+
const ast = await parseAstAsync(code);
|
|
392
|
+
const result = transformCjsToEsm(code, ast);
|
|
393
|
+
const output = result.output;
|
|
394
|
+
output.append(`
|
|
395
|
+
;__vite_ssr_exportAll__(module.exports);
|
|
396
|
+
export default module.exports;
|
|
397
|
+
`);
|
|
398
|
+
return {
|
|
399
|
+
code: output.toString(),
|
|
400
|
+
map: output.generateMap({ hires: "boundary" })
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}];
|
|
405
|
+
}
|
|
406
|
+
function extractPackageKey(id) {
|
|
407
|
+
const yarnMatch = id.match(/\/.yarn\/cache\/([^/]+)/);
|
|
408
|
+
if (yarnMatch) return yarnMatch[1];
|
|
409
|
+
if (id.includes("/node_modules")) {
|
|
410
|
+
id = id.split("/node_modules/").at(-1);
|
|
411
|
+
let [x, y] = id.split("/");
|
|
412
|
+
if (x.startsWith("@")) return `${x}/${y}`;
|
|
413
|
+
return x;
|
|
414
|
+
}
|
|
415
|
+
return id;
|
|
416
|
+
}
|
|
417
|
+
|
|
304
418
|
//#endregion
|
|
305
419
|
//#region src/plugin.ts
|
|
306
420
|
let serverReferences = {};
|
|
@@ -820,31 +934,10 @@ globalThis.AsyncLocalStorage = __viteRscAyncHooks.AsyncLocalStorage;
|
|
|
820
934
|
...vitePluginFindSourceMapURL(),
|
|
821
935
|
...vitePluginRscCss({ rscCssTransform: rscPluginOptions.rscCssTransform }),
|
|
822
936
|
...rscPluginOptions.validateImports !== false ? [validateImportPlugin()] : [],
|
|
823
|
-
...vendorUseSyncExternalStorePlugin(),
|
|
824
937
|
scanBuildStripPlugin(),
|
|
825
|
-
|
|
938
|
+
...cjsModuleRunnerPlugin()
|
|
826
939
|
];
|
|
827
940
|
}
|
|
828
|
-
function detectNonOptimizedCjsPlugin() {
|
|
829
|
-
return {
|
|
830
|
-
name: "rsc:detect-non-optimized-cjs",
|
|
831
|
-
apply: "serve",
|
|
832
|
-
async transform(code, id) {
|
|
833
|
-
if (id.includes("/node_modules/") && !id.startsWith(this.environment.config.cacheDir) && /\b(require|exports)\b/.test(code)) {
|
|
834
|
-
id = parseIdQuery(id).filename;
|
|
835
|
-
let isEsm = id.endsWith(".mjs");
|
|
836
|
-
if (id.endsWith(".js")) {
|
|
837
|
-
const pkgJsonPath = await findClosestPkgJsonPath(path.dirname(id));
|
|
838
|
-
if (pkgJsonPath) {
|
|
839
|
-
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
840
|
-
isEsm = pkgJson.type === "module";
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
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'.`);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
941
|
function scanBuildStripPlugin() {
|
|
849
942
|
return {
|
|
850
943
|
name: "rsc:scan-strip",
|
|
@@ -889,11 +982,10 @@ function vitePluginUseClient(useClientPluginOptions) {
|
|
|
889
982
|
let importId;
|
|
890
983
|
let referenceKey;
|
|
891
984
|
const packageSource = packageSources.get(id);
|
|
892
|
-
if (!packageSource && id.includes("
|
|
893
|
-
assert(this.environment.mode === "dev");
|
|
985
|
+
if (!packageSource && this.environment.mode === "dev" && id.includes("/node_modules/")) {
|
|
894
986
|
const ignored = useClientPluginOptions.ignoredPackageWarnings?.some((pattern) => pattern instanceof RegExp ? pattern.test(id) : id.includes(`/node_modules/${pattern}/`));
|
|
895
987
|
if (!ignored) this.warn(`[vite-rsc] detected an internal client boundary created by a package imported on rsc environment`);
|
|
896
|
-
importId = `/@id/__x00__virtual:vite-rsc/client-in-server-package-proxy/${encodeURIComponent(id
|
|
988
|
+
importId = `/@id/__x00__virtual:vite-rsc/client-in-server-package-proxy/${encodeURIComponent(cleanUrl(id))}`;
|
|
897
989
|
referenceKey = importId;
|
|
898
990
|
} else if (packageSource) if (this.environment.mode === "dev") {
|
|
899
991
|
importId = `/@id/__x00__virtual:vite-rsc/client-package-proxy/${packageSource}`;
|
|
@@ -1057,11 +1149,10 @@ function vitePluginUseServer(useServerPluginOptions) {
|
|
|
1057
1149
|
let normalizedId_;
|
|
1058
1150
|
const getNormalizedId = () => {
|
|
1059
1151
|
if (!normalizedId_) {
|
|
1060
|
-
if (id.includes("
|
|
1061
|
-
assert(this.environment.mode === "dev");
|
|
1152
|
+
if (this.environment.mode === "dev" && id.includes("/node_modules/")) {
|
|
1062
1153
|
const ignored = useServerPluginOptions.ignoredPackageWarnings?.some((pattern) => pattern instanceof RegExp ? pattern.test(id) : id.includes(`/node_modules/${pattern}/`));
|
|
1063
1154
|
if (!ignored) this.warn(`[vite-rsc] detected an internal server function created by a package imported on ${this.environment.name} environment`);
|
|
1064
|
-
id = id
|
|
1155
|
+
id = cleanUrl(id);
|
|
1065
1156
|
}
|
|
1066
1157
|
if (config.command === "build") normalizedId_ = hashString(path.relative(config.root, id));
|
|
1067
1158
|
else normalizedId_ = normalizeViteImportAnalysisUrl(server.environments[serverEnvironmentName], id);
|
|
@@ -1499,25 +1590,6 @@ function generateResourcesCode(depsCode) {
|
|
|
1499
1590
|
export const Resources = (${ResourcesFn.toString()})(__vite_rsc_react__, ${depsCode});
|
|
1500
1591
|
`;
|
|
1501
1592
|
}
|
|
1502
|
-
function evalValue(rawValue) {
|
|
1503
|
-
const fn = new Function(`
|
|
1504
|
-
var console, exports, global, module, process, require
|
|
1505
|
-
return (\n${rawValue}\n)
|
|
1506
|
-
`);
|
|
1507
|
-
return fn();
|
|
1508
|
-
}
|
|
1509
|
-
function parseIdQuery(id) {
|
|
1510
|
-
if (!id.includes("?")) return {
|
|
1511
|
-
filename: id,
|
|
1512
|
-
query: {}
|
|
1513
|
-
};
|
|
1514
|
-
const [filename, rawQuery] = id.split(`?`, 2);
|
|
1515
|
-
const query = Object.fromEntries(new URLSearchParams(rawQuery));
|
|
1516
|
-
return {
|
|
1517
|
-
filename,
|
|
1518
|
-
query
|
|
1519
|
-
};
|
|
1520
|
-
}
|
|
1521
1593
|
async function transformRscCssExport(options) {
|
|
1522
1594
|
if (hasDirective(options.ast.body, "use client")) return;
|
|
1523
1595
|
const result = transformWrapExport(options.code, options.ast, {
|
|
@@ -1596,24 +1668,6 @@ function validateImportPlugin() {
|
|
|
1596
1668
|
}
|
|
1597
1669
|
};
|
|
1598
1670
|
}
|
|
1599
|
-
function vendorUseSyncExternalStorePlugin() {
|
|
1600
|
-
const exports = [
|
|
1601
|
-
"use-sync-external-store",
|
|
1602
|
-
"use-sync-external-store/with-selector",
|
|
1603
|
-
"use-sync-external-store/with-selector.js",
|
|
1604
|
-
"use-sync-external-store/shim",
|
|
1605
|
-
"use-sync-external-store/shim/index.js",
|
|
1606
|
-
"use-sync-external-store/shim/with-selector",
|
|
1607
|
-
"use-sync-external-store/shim/with-selector.js"
|
|
1608
|
-
];
|
|
1609
|
-
return [{
|
|
1610
|
-
name: "rsc:vendor-use-sync-external-store",
|
|
1611
|
-
apply: "serve",
|
|
1612
|
-
config() {
|
|
1613
|
-
return { environments: { ssr: { optimizeDeps: { include: exports.map((e) => `${PKG_NAME} > ${e}`) } } } };
|
|
1614
|
-
}
|
|
1615
|
-
}];
|
|
1616
|
-
}
|
|
1617
1671
|
function sortObject(o) {
|
|
1618
1672
|
return Object.fromEntries(Object.entries(o).sort(([a], [b]) => a.localeCompare(b)));
|
|
1619
1673
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-DiJnRA1C.js";
|
|
2
2
|
import "./plugin-CZbI4rhS.js";
|
|
3
|
-
import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-
|
|
3
|
+
import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-Cu7_zbmH.js";
|
|
4
4
|
import "./encryption-utils-BDwwcMVT.js";
|
|
5
5
|
import "./rpc-tGuLT8PD.js";
|
|
6
6
|
import "./vite-utils-Vzd7cqfv.js";
|
package/dist/react/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { setRequireModule } from "../browser-
|
|
3
|
+
import { setRequireModule } from "../browser-BhJd-Orx.js";
|
|
4
4
|
import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "../browser-D8OPzpF5.js";
|
|
5
5
|
|
|
6
6
|
export { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
|
package/dist/react/rsc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
|
-
import { loadServerAction, setRequireModule } from "../rsc-
|
|
4
|
-
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "../rsc-
|
|
3
|
+
import { loadServerAction, setRequireModule } from "../rsc-BfBPoIV8.js";
|
|
4
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "../rsc-VjVw_i-M.js";
|
|
5
5
|
|
|
6
6
|
export { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, loadServerAction, registerClientReference, registerServerReference, renderToReadableStream, setRequireModule };
|
package/dist/react/ssr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.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--rFiBtws.js";
|
|
4
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "../ssr-BEKKb_cw.js";
|
|
5
5
|
|
|
6
6
|
export { callServer, createFromReadableStream, createServerReference, findSourceMapURL, setRequireModule };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memoize, tinyassert } from "./dist-
|
|
1
|
+
import { memoize, tinyassert } from "./dist-DiJnRA1C.js";
|
|
2
2
|
import { SERVER_DECODE_CLIENT_PREFIX, SERVER_REFERENCE_PREFIX, createReferenceCacheTag, removeReferenceCacheTag, setInternalRequire } from "./shared-CEyKoKAb.js";
|
|
3
3
|
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createClientManifest, createServerDecodeClientManifest, createServerManifest } from "./rsc-
|
|
1
|
+
import { createClientManifest, createServerDecodeClientManifest, createServerManifest } from "./rsc-BfBPoIV8.js";
|
|
2
2
|
import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
3
3
|
import * as ReactClient from "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge";
|
|
4
4
|
|
package/dist/rsc.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-DiJnRA1C.js";
|
|
2
2
|
import "./shared-CEyKoKAb.js";
|
|
3
3
|
import "./encryption-utils-BDwwcMVT.js";
|
|
4
|
-
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./rsc-
|
|
5
|
-
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./rsc-
|
|
6
|
-
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./encryption-runtime-
|
|
7
|
-
import "./rsc-
|
|
4
|
+
import { createClientManifest, createServerManifest, loadServerAction, setRequireModule } from "./rsc-BfBPoIV8.js";
|
|
5
|
+
import { createClientTemporaryReferenceSet, createFromReadableStream, createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, encodeReply, registerClientReference, registerServerReference, renderToReadableStream } from "./rsc-VjVw_i-M.js";
|
|
6
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "./encryption-runtime-CJUalqt3.js";
|
|
7
|
+
import "./rsc-CGUEQCnf.js";
|
|
8
8
|
|
|
9
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--rFiBtws.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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-DiJnRA1C.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--rFiBtws.js";
|
|
4
|
+
import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-BEKKb_cw.js";
|
|
5
|
+
import "./ssr-BuzPa0Go.js";
|
|
6
6
|
|
|
7
7
|
export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../dist-
|
|
1
|
+
import "../dist-DiJnRA1C.js";
|
|
2
2
|
import "../shared-CEyKoKAb.js";
|
|
3
3
|
import "../encryption-utils-BDwwcMVT.js";
|
|
4
|
-
import "../rsc-
|
|
5
|
-
import "../rsc-
|
|
6
|
-
import { decryptActionBoundArgs, encryptActionBoundArgs } from "../encryption-runtime-
|
|
4
|
+
import "../rsc-BfBPoIV8.js";
|
|
5
|
+
import "../rsc-VjVw_i-M.js";
|
|
6
|
+
import { decryptActionBoundArgs, encryptActionBoundArgs } from "../encryption-runtime-CJUalqt3.js";
|
|
7
7
|
|
|
8
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.19",
|
|
4
4
|
"description": "React Server Components (RSC) support for Vite.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"magic-string": "^0.30.17",
|
|
45
45
|
"periscopic": "^4.0.2",
|
|
46
46
|
"turbo-stream": "^3.1.0",
|
|
47
|
-
"use-sync-external-store": "^1.5.0",
|
|
48
47
|
"vitefu": "^1.1.1"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
"@playwright/test": "^1.54.2",
|
|
53
52
|
"@tsconfig/strictest": "^2.0.5",
|
|
54
53
|
"@types/estree": "^1.0.8",
|
|
55
|
-
"@types/node": "^22.17.
|
|
54
|
+
"@types/node": "^22.17.1",
|
|
56
55
|
"@types/react": "^19.1.9",
|
|
57
56
|
"@types/react-dom": "^19.1.7",
|
|
58
57
|
"@vitejs/plugin-react": "workspace:*",
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
"react-server-dom-webpack": "^19.1.1",
|
|
62
61
|
"rsc-html-stream": "^0.0.7",
|
|
63
62
|
"tinyexec": "^1.0.1",
|
|
64
|
-
"tsdown": "^0.
|
|
63
|
+
"tsdown": "^0.14.0",
|
|
65
64
|
"vite-plugin-inspect": "^11.3.2"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|