@vitejs/plugin-rsc 0.5.16 → 0.5.18
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-DH9Oa3zy.js → cjs-D2v1gYgq.js} +33 -24
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/browser.js +2 -2
- package/dist/core/plugin.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 +2 -2
- package/dist/{dist-DZUJDIM2.js → dist-yW9-EeG1.js} +1 -1
- package/dist/index-CLmWsR1c.d.ts +584 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/{picocolors-kt7Y18A3.js → picocolors-BRyoHAlU.js} +1 -1
- package/dist/plugin-BGmSmdwL.js +27 -0
- package/dist/{plugin-DBWiu_Dx.js → plugin-Cp12dr0Z.js} +408 -329
- package/dist/{plugin-V6VFxi_0.d.ts → plugin-K7i9F4Fd.d.ts} +6 -12
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +4 -4
- package/dist/plugins/cjs.js +1 -1
- package/dist/react/browser.d.ts +2 -2
- package/dist/react/rsc.js +1 -1
- package/dist/{rsc-BCFg12vs.js → rsc-Bhp6O2qz.js} +3 -3
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +2 -2
- package/dist/ssr.d.ts +2 -3
- package/dist/ssr.js +1 -1
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +1 -1
- package/dist/{transforms-D4jDIHgD.js → transforms-B2EJTNXG.js} +2 -2
- package/dist/utils/encryption-runtime.js +3 -3
- package/dist/utils/rpc.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +129 -110
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +67 -55
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +127 -108
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +67 -55
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +127 -108
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +67 -55
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +625 -351
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +598 -314
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +628 -352
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +601 -315
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +634 -356
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +607 -319
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/package.json +10 -8
- package/dist/index-DJ0AhQ9B.d.ts +0 -90
- package/dist/plugin-B1AJWrMi.js +0 -24
- /package/dist/{browser-BmyjVnfA.d.ts → browser-s-WcB8A7.d.ts} +0 -0
- /package/dist/{chunk-BFhhoFQb.js → chunk-Dj_d7TT4.js} +0 -0
- /package/dist/{encryption-utils-BPYvebX4.js → encryption-utils-DdqSKS_O.js} +0 -0
- /package/dist/{index-DqoQPvhP.d.ts → index-now_lP2V.d.ts} +0 -0
- /package/dist/{rpc-DbBe389F.js → rpc-EIuXyQpO.js} +0 -0
- /package/dist/{shared-Chot7h9j.js → shared-CGK4coF3.js} +0 -0
- /package/dist/{shared-DEpnONZf.js → shared-rtJPs0Yj.js} +0 -0
|
@@ -457,17 +457,20 @@ function processReply(
|
|
|
457
457
|
if ("undefined" === typeof value) return "$undefined";
|
|
458
458
|
if ("function" === typeof value) {
|
|
459
459
|
parentReference = knownServerReferences.get(value);
|
|
460
|
-
if (void 0 !== parentReference)
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
null === formData && (formData = new FormData()),
|
|
467
|
-
(parentReference = nextPartId++),
|
|
468
|
-
formData.set(formFieldPrefix + parentReference, key),
|
|
469
|
-
"$h" + parentReference.toString(16)
|
|
460
|
+
if (void 0 !== parentReference) {
|
|
461
|
+
key = writtenObjects.get(value);
|
|
462
|
+
if (void 0 !== key) return key;
|
|
463
|
+
key = JSON.stringify(
|
|
464
|
+
{ id: parentReference.id, bound: parentReference.bound },
|
|
465
|
+
resolveToJSON
|
|
470
466
|
);
|
|
467
|
+
null === formData && (formData = new FormData());
|
|
468
|
+
parentReference = nextPartId++;
|
|
469
|
+
formData.set(formFieldPrefix + parentReference, key);
|
|
470
|
+
key = "$h" + parentReference.toString(16);
|
|
471
|
+
writtenObjects.set(value, key);
|
|
472
|
+
return key;
|
|
473
|
+
}
|
|
471
474
|
if (
|
|
472
475
|
void 0 !== temporaryReferences &&
|
|
473
476
|
-1 === key.indexOf(":") &&
|
|
@@ -1011,7 +1014,14 @@ function fulfillReference(reference, value) {
|
|
|
1011
1014
|
}
|
|
1012
1015
|
}
|
|
1013
1016
|
}
|
|
1014
|
-
|
|
1017
|
+
var name = path[i];
|
|
1018
|
+
if (
|
|
1019
|
+
"object" === typeof value &&
|
|
1020
|
+
null !== value &&
|
|
1021
|
+
hasOwnProperty.call(value, name)
|
|
1022
|
+
)
|
|
1023
|
+
value = value[name];
|
|
1024
|
+
else throw Error("Invalid reference.");
|
|
1015
1025
|
}
|
|
1016
1026
|
for (
|
|
1017
1027
|
;
|
|
@@ -1020,26 +1030,26 @@ function fulfillReference(reference, value) {
|
|
|
1020
1030
|
value.$$typeof === REACT_LAZY_TYPE;
|
|
1021
1031
|
|
|
1022
1032
|
) {
|
|
1023
|
-
var referencedChunk$
|
|
1024
|
-
if (referencedChunk$
|
|
1033
|
+
var referencedChunk$44 = value._payload;
|
|
1034
|
+
if (referencedChunk$44 === handler.chunk) value = handler.value;
|
|
1025
1035
|
else {
|
|
1026
|
-
switch (referencedChunk$
|
|
1036
|
+
switch (referencedChunk$44.status) {
|
|
1027
1037
|
case "resolved_model":
|
|
1028
|
-
initializeModelChunk(referencedChunk$
|
|
1038
|
+
initializeModelChunk(referencedChunk$44);
|
|
1029
1039
|
break;
|
|
1030
1040
|
case "resolved_module":
|
|
1031
|
-
initializeModuleChunk(referencedChunk$
|
|
1041
|
+
initializeModuleChunk(referencedChunk$44);
|
|
1032
1042
|
}
|
|
1033
|
-
switch (referencedChunk$
|
|
1043
|
+
switch (referencedChunk$44.status) {
|
|
1034
1044
|
case "fulfilled":
|
|
1035
|
-
value = referencedChunk$
|
|
1045
|
+
value = referencedChunk$44.value;
|
|
1036
1046
|
continue;
|
|
1037
1047
|
}
|
|
1038
1048
|
break;
|
|
1039
1049
|
}
|
|
1040
1050
|
}
|
|
1041
1051
|
var mappedValue = map(response, value, parentObject, key);
|
|
1042
|
-
parentObject[key] = mappedValue;
|
|
1052
|
+
"__proto__" !== key && (parentObject[key] = mappedValue);
|
|
1043
1053
|
"" === key && null === handler.value && (handler.value = mappedValue);
|
|
1044
1054
|
if (
|
|
1045
1055
|
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
@@ -1168,7 +1178,7 @@ function loadServerReference(response, metaData, parentObject, key) {
|
|
|
1168
1178
|
metaData.bound,
|
|
1169
1179
|
response._encodeFormAction
|
|
1170
1180
|
);
|
|
1171
|
-
parentObject[key] = resolvedValue;
|
|
1181
|
+
"__proto__" !== key && (parentObject[key] = resolvedValue);
|
|
1172
1182
|
"" === key && null === handler.value && (handler.value = resolvedValue);
|
|
1173
1183
|
if (
|
|
1174
1184
|
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
@@ -1581,8 +1591,8 @@ function startReadableStream(response, id, type) {
|
|
|
1581
1591
|
(previousBlockedChunk = chunk));
|
|
1582
1592
|
} else {
|
|
1583
1593
|
chunk = previousBlockedChunk;
|
|
1584
|
-
var chunk$
|
|
1585
|
-
chunk$
|
|
1594
|
+
var chunk$55 = new ReactPromise("pending", null, null);
|
|
1595
|
+
chunk$55.then(
|
|
1586
1596
|
function (v) {
|
|
1587
1597
|
return controller.enqueue(v);
|
|
1588
1598
|
},
|
|
@@ -1590,10 +1600,10 @@ function startReadableStream(response, id, type) {
|
|
|
1590
1600
|
return controller.error(e);
|
|
1591
1601
|
}
|
|
1592
1602
|
);
|
|
1593
|
-
previousBlockedChunk = chunk$
|
|
1603
|
+
previousBlockedChunk = chunk$55;
|
|
1594
1604
|
chunk.then(function () {
|
|
1595
|
-
previousBlockedChunk === chunk$
|
|
1596
|
-
resolveModelChunk(response, chunk$
|
|
1605
|
+
previousBlockedChunk === chunk$55 && (previousBlockedChunk = null);
|
|
1606
|
+
resolveModelChunk(response, chunk$55, json);
|
|
1597
1607
|
});
|
|
1598
1608
|
}
|
|
1599
1609
|
},
|
|
@@ -1749,8 +1759,8 @@ function mergeBuffer(buffer, lastChunk) {
|
|
|
1749
1759
|
for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)
|
|
1750
1760
|
byteLength += buffer[i].byteLength;
|
|
1751
1761
|
byteLength = new Uint8Array(byteLength);
|
|
1752
|
-
for (var i$
|
|
1753
|
-
var chunk = buffer[i$
|
|
1762
|
+
for (var i$56 = (i = 0); i$56 < l; i$56++) {
|
|
1763
|
+
var chunk = buffer[i$56];
|
|
1754
1764
|
byteLength.set(chunk, i);
|
|
1755
1765
|
i += chunk.byteLength;
|
|
1756
1766
|
}
|
|
@@ -2019,37 +2029,39 @@ function processBinaryChunk(weakResponse, streamState, chunk) {
|
|
|
2019
2029
|
}
|
|
2020
2030
|
function createFromJSONCallback(response) {
|
|
2021
2031
|
return function (key, value) {
|
|
2022
|
-
if ("
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
if (
|
|
2026
|
-
if (
|
|
2027
|
-
((key = {
|
|
2028
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
2029
|
-
type: value[1],
|
|
2030
|
-
key: value[2],
|
|
2031
|
-
ref: null,
|
|
2032
|
-
props: value[3]
|
|
2033
|
-
}),
|
|
2034
|
-
null !== initializingHandler)
|
|
2035
|
-
)
|
|
2032
|
+
if ("__proto__" !== key) {
|
|
2033
|
+
if ("string" === typeof value)
|
|
2034
|
+
return parseModelString(response, this, key, value);
|
|
2035
|
+
if ("object" === typeof value && null !== value) {
|
|
2036
|
+
if (value[0] === REACT_ELEMENT_TYPE) {
|
|
2036
2037
|
if (
|
|
2037
|
-
((
|
|
2038
|
-
|
|
2039
|
-
|
|
2038
|
+
((key = {
|
|
2039
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
2040
|
+
type: value[1],
|
|
2041
|
+
key: value[2],
|
|
2042
|
+
ref: null,
|
|
2043
|
+
props: value[3]
|
|
2044
|
+
}),
|
|
2045
|
+
null !== initializingHandler)
|
|
2040
2046
|
)
|
|
2041
|
-
|
|
2042
|
-
(
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2047
|
+
if (
|
|
2048
|
+
((value = initializingHandler),
|
|
2049
|
+
(initializingHandler = value.parent),
|
|
2050
|
+
value.errored)
|
|
2051
|
+
)
|
|
2052
|
+
(key = new ReactPromise("rejected", null, value.reason)),
|
|
2053
|
+
(key = createLazyChunkWrapper(key));
|
|
2054
|
+
else if (0 < value.deps) {
|
|
2055
|
+
var blockedChunk = new ReactPromise("blocked", null, null);
|
|
2056
|
+
value.value = key;
|
|
2057
|
+
value.chunk = blockedChunk;
|
|
2058
|
+
key = createLazyChunkWrapper(blockedChunk);
|
|
2059
|
+
}
|
|
2060
|
+
} else key = value;
|
|
2061
|
+
return key;
|
|
2062
|
+
}
|
|
2063
|
+
return value;
|
|
2051
2064
|
}
|
|
2052
|
-
return value;
|
|
2053
2065
|
};
|
|
2054
2066
|
}
|
|
2055
2067
|
function close(weakResponse) {
|