react-server-dom-turbopack 19.0.7 → 19.0.9
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/cjs/react-server-dom-turbopack-client.browser.development.js +66 -47
- package/cjs/react-server-dom-turbopack-client.browser.production.js +84 -62
- package/cjs/react-server-dom-turbopack-client.edge.development.js +74 -47
- package/cjs/react-server-dom-turbopack-client.edge.production.js +94 -64
- package/cjs/react-server-dom-turbopack-client.node.development.js +74 -47
- package/cjs/react-server-dom-turbopack-client.node.production.js +94 -64
- package/cjs/react-server-dom-turbopack-server.browser.development.js +214 -123
- package/cjs/react-server-dom-turbopack-server.browser.production.js +209 -118
- package/cjs/react-server-dom-turbopack-server.edge.development.js +213 -122
- package/cjs/react-server-dom-turbopack-server.edge.production.js +210 -119
- package/cjs/react-server-dom-turbopack-server.node.development.js +270 -161
- package/cjs/react-server-dom-turbopack-server.node.production.js +259 -154
- package/package.json +5 -5
|
@@ -14,6 +14,11 @@ require("crypto");
|
|
|
14
14
|
var async_hooks = require("async_hooks"),
|
|
15
15
|
ReactDOM = require("react-dom"),
|
|
16
16
|
React = require("react"),
|
|
17
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
18
|
+
supportsArrayBufferDetached = hasOwnProperty.call(
|
|
19
|
+
ArrayBuffer.prototype,
|
|
20
|
+
"detached"
|
|
21
|
+
),
|
|
17
22
|
scheduleMicrotask = queueMicrotask,
|
|
18
23
|
currentView = null,
|
|
19
24
|
writtenBytes = 0,
|
|
@@ -55,33 +60,37 @@ function writeChunkAndReturn(destination, chunk) {
|
|
|
55
60
|
(currentView = new Uint8Array(2048)),
|
|
56
61
|
(writtenBytes = 0));
|
|
57
62
|
}
|
|
63
|
+
} else if (0 === chunk.byteLength) {
|
|
64
|
+
if (supportsArrayBufferDetached && chunk.buffer.detached)
|
|
65
|
+
throw Error(
|
|
66
|
+
"Cannot transport a detached buffer. This usually happens when trying to transport multiple buffer-spanning views on the same underyling buffer. Either reuse the exact same view by identity or copy the underlying buffer manually via `view.slice()`."
|
|
67
|
+
);
|
|
58
68
|
} else
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
(writtenBytes = 0))));
|
|
69
|
+
2048 < chunk.byteLength
|
|
70
|
+
? (0 < writtenBytes &&
|
|
71
|
+
(writeToDestination(
|
|
72
|
+
destination,
|
|
73
|
+
currentView.subarray(0, writtenBytes)
|
|
74
|
+
),
|
|
75
|
+
(currentView = new Uint8Array(2048)),
|
|
76
|
+
(writtenBytes = 0)),
|
|
77
|
+
writeToDestination(destination, chunk))
|
|
78
|
+
: ((target = currentView.length - writtenBytes),
|
|
79
|
+
target < chunk.byteLength &&
|
|
80
|
+
(0 === target
|
|
81
|
+
? writeToDestination(destination, currentView)
|
|
82
|
+
: (currentView.set(chunk.subarray(0, target), writtenBytes),
|
|
83
|
+
(writtenBytes += target),
|
|
84
|
+
writeToDestination(destination, currentView),
|
|
85
|
+
(chunk = chunk.subarray(target))),
|
|
86
|
+
(currentView = new Uint8Array(2048)),
|
|
87
|
+
(writtenBytes = 0)),
|
|
88
|
+
currentView.set(chunk, writtenBytes),
|
|
89
|
+
(writtenBytes += chunk.byteLength),
|
|
90
|
+
2048 === writtenBytes &&
|
|
91
|
+
(writeToDestination(destination, currentView),
|
|
92
|
+
(currentView = new Uint8Array(2048)),
|
|
93
|
+
(writtenBytes = 0)));
|
|
85
94
|
return destinationHasCapacity;
|
|
86
95
|
}
|
|
87
96
|
var textEncoder = new util.TextEncoder();
|
|
@@ -956,7 +965,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
956
965
|
emitErrorChunk(request, streamTask.id, digest);
|
|
957
966
|
enqueueFlush(request);
|
|
958
967
|
"function" === typeof iterator.throw &&
|
|
959
|
-
iterator.throw(reason).then(
|
|
968
|
+
iterator.throw(reason).then(noop, noop);
|
|
960
969
|
}
|
|
961
970
|
}
|
|
962
971
|
function abortIterable(reason) {
|
|
@@ -967,7 +976,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
967
976
|
emitErrorChunk(request, streamTask.id, digest);
|
|
968
977
|
enqueueFlush(request);
|
|
969
978
|
"function" === typeof iterator.throw &&
|
|
970
|
-
iterator.throw(reason).then(
|
|
979
|
+
iterator.throw(reason).then(noop, noop);
|
|
971
980
|
}
|
|
972
981
|
}
|
|
973
982
|
iterable = iterable === iterator;
|
|
@@ -1696,13 +1705,30 @@ function emitModelChunk(request, id, json) {
|
|
|
1696
1705
|
}
|
|
1697
1706
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
|
1698
1707
|
request.pendingChunks++;
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1708
|
+
a: {
|
|
1709
|
+
var view = new Uint8Array(
|
|
1710
|
+
typedArray.buffer,
|
|
1711
|
+
typedArray.byteOffset,
|
|
1712
|
+
typedArray.byteLength
|
|
1713
|
+
);
|
|
1714
|
+
if (2048 < typedArray.byteLength) {
|
|
1715
|
+
if (
|
|
1716
|
+
0 !== typedArray.byteOffset ||
|
|
1717
|
+
typedArray.byteLength !== typedArray.buffer.byteLength ||
|
|
1718
|
+
typedArray.buffer.resizable
|
|
1719
|
+
) {
|
|
1720
|
+
typedArray = view.slice();
|
|
1721
|
+
break a;
|
|
1722
|
+
}
|
|
1723
|
+
if (!supportsArrayBufferDetached) {
|
|
1724
|
+
typedArray = view.slice();
|
|
1725
|
+
break a;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
typedArray = view;
|
|
1729
|
+
}
|
|
1730
|
+
view = typedArray.byteLength;
|
|
1731
|
+
id = id.toString(16) + ":" + tag + view.toString(16) + ",";
|
|
1706
1732
|
request.completedRegularChunks.push(id, typedArray);
|
|
1707
1733
|
}
|
|
1708
1734
|
function emitTextChunk(request, id, text) {
|
|
@@ -1974,7 +2000,6 @@ function abort(request, reason) {
|
|
|
1974
2000
|
logRecoverableError(request, error$27, null), fatalError(request, error$27);
|
|
1975
2001
|
}
|
|
1976
2002
|
}
|
|
1977
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1978
2003
|
function resolveServerReference(bundlerConfig, id) {
|
|
1979
2004
|
var name = "",
|
|
1980
2005
|
resolvedModuleData = bundlerConfig[id];
|
|
@@ -2045,6 +2070,38 @@ function requireModule(metadata) {
|
|
|
2045
2070
|
if (hasOwnProperty.call(moduleExports, metadata[2]))
|
|
2046
2071
|
return moduleExports[metadata[2]];
|
|
2047
2072
|
}
|
|
2073
|
+
function appendBackingEntry(backingStore, value, key) {
|
|
2074
|
+
var prefix = backingStore.prefix;
|
|
2075
|
+
if (key.startsWith(prefix)) {
|
|
2076
|
+
switch (key[prefix.length]) {
|
|
2077
|
+
case "_":
|
|
2078
|
+
prefix = backingStore.referencedEntries;
|
|
2079
|
+
null === prefix && (prefix = backingStore.referencedEntries = []);
|
|
2080
|
+
prefix.push([key, value]);
|
|
2081
|
+
return;
|
|
2082
|
+
case "S":
|
|
2083
|
+
"string" === typeof value &&
|
|
2084
|
+
((prefix = backingStore.streamChunks),
|
|
2085
|
+
null === prefix && (prefix = backingStore.streamChunks = new Map()),
|
|
2086
|
+
(backingStore = prefix.get(key)),
|
|
2087
|
+
void 0 === backingStore
|
|
2088
|
+
? prefix.set(key, [value])
|
|
2089
|
+
: backingStore.push(value));
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2092
|
+
"string" === typeof value
|
|
2093
|
+
? ((prefix = backingStore.stringChunks),
|
|
2094
|
+
null === prefix && (prefix = backingStore.stringChunks = new Map()),
|
|
2095
|
+
prefix.set(key, value))
|
|
2096
|
+
: ((prefix = backingStore.blobs),
|
|
2097
|
+
null === prefix && (prefix = backingStore.blobs = new Map()),
|
|
2098
|
+
prefix.set(key, value));
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
function getBackingBlob(backingStore, key) {
|
|
2102
|
+
backingStore = backingStore.blobs;
|
|
2103
|
+
return null === backingStore ? void 0 : backingStore.get(key);
|
|
2104
|
+
}
|
|
2048
2105
|
var RESPONSE_SYMBOL = Symbol();
|
|
2049
2106
|
function ReactPromise(status, value, reason) {
|
|
2050
2107
|
this.status = status;
|
|
@@ -2414,13 +2471,16 @@ function reportGlobalError(response, error) {
|
|
|
2414
2471
|
function getChunk(response, id) {
|
|
2415
2472
|
var chunks = response._chunks,
|
|
2416
2473
|
chunk = chunks.get(id);
|
|
2417
|
-
chunk
|
|
2418
|
-
|
|
2419
|
-
|
|
2474
|
+
if (!chunk) {
|
|
2475
|
+
chunk = response._prefix;
|
|
2476
|
+
var stringChunks = response._formData.stringChunks;
|
|
2477
|
+
chunk = null === stringChunks ? void 0 : stringChunks.get(chunk + id);
|
|
2478
|
+
chunk =
|
|
2420
2479
|
"string" === typeof chunk
|
|
2421
2480
|
? createResolvedModelChunk(response, chunk, id)
|
|
2422
|
-
: new ReactPromise("pending", null, null)
|
|
2423
|
-
chunks.set(id, chunk)
|
|
2481
|
+
: new ReactPromise("pending", null, null);
|
|
2482
|
+
chunks.set(id, chunk);
|
|
2483
|
+
}
|
|
2424
2484
|
return chunk;
|
|
2425
2485
|
}
|
|
2426
2486
|
function fulfillReference(response, reference, value, arrayRoot) {
|
|
@@ -2651,7 +2711,7 @@ function parseTypedArray(
|
|
|
2651
2711
|
Error("Already initialized typed array.")
|
|
2652
2712
|
)
|
|
2653
2713
|
);
|
|
2654
|
-
reference = response._formData
|
|
2714
|
+
reference = getBackingBlob(response._formData, key).arrayBuffer();
|
|
2655
2715
|
if (initializingHandler) {
|
|
2656
2716
|
var handler = initializingHandler;
|
|
2657
2717
|
handler.deps++;
|
|
@@ -2695,13 +2755,15 @@ function resolveStream(response, id, stream, controller) {
|
|
|
2695
2755
|
var chunks = response._chunks;
|
|
2696
2756
|
stream = new ReactPromise("fulfilled", stream, controller);
|
|
2697
2757
|
chunks.set(id, stream);
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2758
|
+
chunks = response._prefix;
|
|
2759
|
+
response = response._formData.streamChunks;
|
|
2760
|
+
id = null === response ? void 0 : response.get(chunks + "S" + id);
|
|
2761
|
+
if (void 0 !== id)
|
|
2762
|
+
for (response = 0; response < id.length; response++)
|
|
2763
|
+
(chunks = id[response]),
|
|
2764
|
+
"C" === chunks[0]
|
|
2703
2765
|
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
|
2704
|
-
: controller.enqueueModel(chunks)
|
|
2766
|
+
: controller.enqueueModel(chunks);
|
|
2705
2767
|
}
|
|
2706
2768
|
function parseReadableStream(response, reference, type) {
|
|
2707
2769
|
function enqueue(value) {
|
|
@@ -2867,7 +2929,14 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2867
2929
|
});
|
|
2868
2930
|
return iterator;
|
|
2869
2931
|
}
|
|
2870
|
-
function parseModelString(
|
|
2932
|
+
function parseModelString(
|
|
2933
|
+
response,
|
|
2934
|
+
obj,
|
|
2935
|
+
key$jscomp$0,
|
|
2936
|
+
value,
|
|
2937
|
+
reference,
|
|
2938
|
+
arrayRoot
|
|
2939
|
+
) {
|
|
2871
2940
|
if ("$" === value[0]) {
|
|
2872
2941
|
switch (value[1]) {
|
|
2873
2942
|
case "$":
|
|
@@ -2885,7 +2954,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2885
2954
|
response,
|
|
2886
2955
|
arrayRoot,
|
|
2887
2956
|
obj,
|
|
2888
|
-
key,
|
|
2957
|
+
key$jscomp$0,
|
|
2889
2958
|
null,
|
|
2890
2959
|
loadServerReference$1
|
|
2891
2960
|
)
|
|
@@ -2902,43 +2971,55 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2902
2971
|
case "Q":
|
|
2903
2972
|
return (
|
|
2904
2973
|
(arrayRoot = value.slice(2)),
|
|
2905
|
-
getOutlinedModel(
|
|
2974
|
+
getOutlinedModel(
|
|
2975
|
+
response,
|
|
2976
|
+
arrayRoot,
|
|
2977
|
+
obj,
|
|
2978
|
+
key$jscomp$0,
|
|
2979
|
+
null,
|
|
2980
|
+
createMap
|
|
2981
|
+
)
|
|
2906
2982
|
);
|
|
2907
2983
|
case "W":
|
|
2908
2984
|
return (
|
|
2909
2985
|
(arrayRoot = value.slice(2)),
|
|
2910
|
-
getOutlinedModel(
|
|
2986
|
+
getOutlinedModel(
|
|
2987
|
+
response,
|
|
2988
|
+
arrayRoot,
|
|
2989
|
+
obj,
|
|
2990
|
+
key$jscomp$0,
|
|
2991
|
+
null,
|
|
2992
|
+
createSet
|
|
2993
|
+
)
|
|
2911
2994
|
);
|
|
2912
2995
|
case "K":
|
|
2913
|
-
|
|
2914
|
-
obj = response._prefix + "_";
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
var referencedFormDataKey = value.slice(key.length), i = 0;
|
|
2928
|
-
i < reference.length;
|
|
2929
|
-
i++
|
|
2930
|
-
)
|
|
2931
|
-
arrayRoot.append(referencedFormDataKey, reference[i]);
|
|
2932
|
-
response.data.delete(value);
|
|
2933
|
-
response.keyPointer++;
|
|
2934
|
-
} else if (value.startsWith(obj)) break;
|
|
2935
|
-
else response.keyPointer++;
|
|
2996
|
+
obj = value.slice(2);
|
|
2997
|
+
obj = response._prefix + "_" + obj + "_";
|
|
2998
|
+
response = response._formData;
|
|
2999
|
+
key$jscomp$0 = new FormData();
|
|
3000
|
+
arrayRoot = response.referencedEntries;
|
|
3001
|
+
if (null !== arrayRoot) {
|
|
3002
|
+
for (value = response.keyPointer; value < arrayRoot.length; ) {
|
|
3003
|
+
reference = arrayRoot[value];
|
|
3004
|
+
var key = reference[0];
|
|
3005
|
+
if (!key.startsWith(obj)) break;
|
|
3006
|
+
key$jscomp$0.append(key.slice(obj.length), reference[1]);
|
|
3007
|
+
value++;
|
|
3008
|
+
}
|
|
3009
|
+
response.keyPointer = value;
|
|
2936
3010
|
}
|
|
2937
|
-
return
|
|
3011
|
+
return key$jscomp$0;
|
|
2938
3012
|
case "i":
|
|
2939
3013
|
return (
|
|
2940
3014
|
(arrayRoot = value.slice(2)),
|
|
2941
|
-
getOutlinedModel(
|
|
3015
|
+
getOutlinedModel(
|
|
3016
|
+
response,
|
|
3017
|
+
arrayRoot,
|
|
3018
|
+
obj,
|
|
3019
|
+
key$jscomp$0,
|
|
3020
|
+
null,
|
|
3021
|
+
extractIterator
|
|
3022
|
+
)
|
|
2942
3023
|
);
|
|
2943
3024
|
case "I":
|
|
2944
3025
|
return Infinity;
|
|
@@ -2969,7 +3050,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2969
3050
|
ArrayBuffer,
|
|
2970
3051
|
1,
|
|
2971
3052
|
obj,
|
|
2972
|
-
key,
|
|
3053
|
+
key$jscomp$0,
|
|
2973
3054
|
arrayRoot
|
|
2974
3055
|
);
|
|
2975
3056
|
case "O":
|
|
@@ -2979,7 +3060,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2979
3060
|
Int8Array,
|
|
2980
3061
|
1,
|
|
2981
3062
|
obj,
|
|
2982
|
-
key,
|
|
3063
|
+
key$jscomp$0,
|
|
2983
3064
|
arrayRoot
|
|
2984
3065
|
);
|
|
2985
3066
|
case "o":
|
|
@@ -2989,7 +3070,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2989
3070
|
Uint8Array,
|
|
2990
3071
|
1,
|
|
2991
3072
|
obj,
|
|
2992
|
-
key,
|
|
3073
|
+
key$jscomp$0,
|
|
2993
3074
|
arrayRoot
|
|
2994
3075
|
);
|
|
2995
3076
|
case "U":
|
|
@@ -2999,7 +3080,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2999
3080
|
Uint8ClampedArray,
|
|
3000
3081
|
1,
|
|
3001
3082
|
obj,
|
|
3002
|
-
key,
|
|
3083
|
+
key$jscomp$0,
|
|
3003
3084
|
arrayRoot
|
|
3004
3085
|
);
|
|
3005
3086
|
case "S":
|
|
@@ -3009,7 +3090,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3009
3090
|
Int16Array,
|
|
3010
3091
|
2,
|
|
3011
3092
|
obj,
|
|
3012
|
-
key,
|
|
3093
|
+
key$jscomp$0,
|
|
3013
3094
|
arrayRoot
|
|
3014
3095
|
);
|
|
3015
3096
|
case "s":
|
|
@@ -3019,7 +3100,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3019
3100
|
Uint16Array,
|
|
3020
3101
|
2,
|
|
3021
3102
|
obj,
|
|
3022
|
-
key,
|
|
3103
|
+
key$jscomp$0,
|
|
3023
3104
|
arrayRoot
|
|
3024
3105
|
);
|
|
3025
3106
|
case "L":
|
|
@@ -3029,7 +3110,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3029
3110
|
Int32Array,
|
|
3030
3111
|
4,
|
|
3031
3112
|
obj,
|
|
3032
|
-
key,
|
|
3113
|
+
key$jscomp$0,
|
|
3033
3114
|
arrayRoot
|
|
3034
3115
|
);
|
|
3035
3116
|
case "l":
|
|
@@ -3039,7 +3120,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3039
3120
|
Uint32Array,
|
|
3040
3121
|
4,
|
|
3041
3122
|
obj,
|
|
3042
|
-
key,
|
|
3123
|
+
key$jscomp$0,
|
|
3043
3124
|
arrayRoot
|
|
3044
3125
|
);
|
|
3045
3126
|
case "G":
|
|
@@ -3049,7 +3130,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3049
3130
|
Float32Array,
|
|
3050
3131
|
4,
|
|
3051
3132
|
obj,
|
|
3052
|
-
key,
|
|
3133
|
+
key$jscomp$0,
|
|
3053
3134
|
arrayRoot
|
|
3054
3135
|
);
|
|
3055
3136
|
case "g":
|
|
@@ -3059,7 +3140,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3059
3140
|
Float64Array,
|
|
3060
3141
|
8,
|
|
3061
3142
|
obj,
|
|
3062
|
-
key,
|
|
3143
|
+
key$jscomp$0,
|
|
3063
3144
|
arrayRoot
|
|
3064
3145
|
);
|
|
3065
3146
|
case "M":
|
|
@@ -3069,7 +3150,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3069
3150
|
BigInt64Array,
|
|
3070
3151
|
8,
|
|
3071
3152
|
obj,
|
|
3072
|
-
key,
|
|
3153
|
+
key$jscomp$0,
|
|
3073
3154
|
arrayRoot
|
|
3074
3155
|
);
|
|
3075
3156
|
case "m":
|
|
@@ -3079,7 +3160,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3079
3160
|
BigUint64Array,
|
|
3080
3161
|
8,
|
|
3081
3162
|
obj,
|
|
3082
|
-
key,
|
|
3163
|
+
key$jscomp$0,
|
|
3083
3164
|
arrayRoot
|
|
3084
3165
|
);
|
|
3085
3166
|
case "V":
|
|
@@ -3089,13 +3170,13 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3089
3170
|
DataView,
|
|
3090
3171
|
1,
|
|
3091
3172
|
obj,
|
|
3092
|
-
key,
|
|
3173
|
+
key$jscomp$0,
|
|
3093
3174
|
arrayRoot
|
|
3094
3175
|
);
|
|
3095
3176
|
case "B":
|
|
3096
3177
|
return (
|
|
3097
3178
|
(obj = parseInt(value.slice(2), 16)),
|
|
3098
|
-
response._formData
|
|
3179
|
+
getBackingBlob(response._formData, response._prefix + obj)
|
|
3099
3180
|
);
|
|
3100
3181
|
}
|
|
3101
3182
|
switch (value[1]) {
|
|
@@ -3109,7 +3190,14 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3109
3190
|
return parseAsyncIterable(response, value, !0);
|
|
3110
3191
|
}
|
|
3111
3192
|
value = value.slice(1);
|
|
3112
|
-
return getOutlinedModel(
|
|
3193
|
+
return getOutlinedModel(
|
|
3194
|
+
response,
|
|
3195
|
+
value,
|
|
3196
|
+
obj,
|
|
3197
|
+
key$jscomp$0,
|
|
3198
|
+
arrayRoot,
|
|
3199
|
+
createModel
|
|
3200
|
+
);
|
|
3113
3201
|
}
|
|
3114
3202
|
null !== arrayRoot && bumpArrayCount(arrayRoot, value.length, response);
|
|
3115
3203
|
return value;
|
|
@@ -3121,11 +3209,20 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
3121
3209
|
: new FormData(),
|
|
3122
3210
|
arraySizeLimit =
|
|
3123
3211
|
4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 1e6,
|
|
3124
|
-
chunks = new Map()
|
|
3212
|
+
chunks = new Map(),
|
|
3213
|
+
backingStore = {
|
|
3214
|
+
prefix: formFieldPrefix,
|
|
3215
|
+
referencedEntries: null,
|
|
3216
|
+
keyPointer: 0,
|
|
3217
|
+
stringChunks: null,
|
|
3218
|
+
streamChunks: null,
|
|
3219
|
+
blobs: null
|
|
3220
|
+
};
|
|
3221
|
+
backingFormData.forEach(appendBackingEntry.bind(null, backingStore));
|
|
3125
3222
|
return {
|
|
3126
3223
|
_bundlerConfig: bundlerConfig,
|
|
3127
3224
|
_prefix: formFieldPrefix,
|
|
3128
|
-
_formData:
|
|
3225
|
+
_formData: backingStore,
|
|
3129
3226
|
_chunks: chunks,
|
|
3130
3227
|
_temporaryReferences: temporaryReferences,
|
|
3131
3228
|
_rootArrayContexts: new WeakMap(),
|
|
@@ -3133,19 +3230,26 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
3133
3230
|
};
|
|
3134
3231
|
}
|
|
3135
3232
|
function resolveField(response, key, value) {
|
|
3136
|
-
var
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3233
|
+
var prefix = response._prefix;
|
|
3234
|
+
if (key.startsWith(prefix)) {
|
|
3235
|
+
var chunks = response._chunks;
|
|
3236
|
+
if ("S" === key[prefix.length]) {
|
|
3237
|
+
if (
|
|
3238
|
+
key.length > prefix.length + 1 &&
|
|
3239
|
+
((prefix = +key.slice(prefix.length + 1)),
|
|
3240
|
+
(chunks = chunks.get(prefix)))
|
|
3241
|
+
) {
|
|
3242
|
+
resolveModelChunk(response, chunks, value, prefix);
|
|
3243
|
+
return;
|
|
3244
|
+
}
|
|
3245
|
+
} else if (
|
|
3246
|
+
((prefix = +key.slice(prefix.length)), (chunks = chunks.get(prefix)))
|
|
3247
|
+
) {
|
|
3248
|
+
resolveModelChunk(response, chunks, value, prefix);
|
|
3249
|
+
return;
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
appendBackingEntry(response._formData, value, key);
|
|
3149
3253
|
}
|
|
3150
3254
|
function close(response) {
|
|
3151
3255
|
reportGlobalError(response, Error("Connection closed."));
|
|
@@ -3213,44 +3317,41 @@ exports.createTemporaryReferenceSet = function () {
|
|
|
3213
3317
|
};
|
|
3214
3318
|
exports.decodeAction = function (body, serverManifest) {
|
|
3215
3319
|
var formData = new FormData(),
|
|
3216
|
-
|
|
3217
|
-
seenActions = new Set();
|
|
3320
|
+
maybeActionKey = null;
|
|
3218
3321
|
body.forEach(function (value, key) {
|
|
3219
3322
|
key.startsWith("$ACTION_")
|
|
3220
3323
|
? key.startsWith("$ACTION_REF_")
|
|
3221
|
-
?
|
|
3222
|
-
|
|
3223
|
-
(value = "$ACTION_" + key.slice(12) + ":"),
|
|
3224
|
-
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
|
3225
|
-
(action = loadServerReference(serverManifest, value)))
|
|
3226
|
-
: key.startsWith("$ACTION_ID_") &&
|
|
3227
|
-
!seenActions.has(key) &&
|
|
3228
|
-
(seenActions.add(key),
|
|
3229
|
-
(value = key.slice(11)),
|
|
3230
|
-
(action = loadServerReference(serverManifest, {
|
|
3231
|
-
id: value,
|
|
3232
|
-
bound: null
|
|
3233
|
-
})))
|
|
3324
|
+
? (maybeActionKey = key)
|
|
3325
|
+
: key.startsWith("$ACTION_ID_") && (maybeActionKey = key)
|
|
3234
3326
|
: formData.append(key, value);
|
|
3235
3327
|
});
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3328
|
+
if (null === maybeActionKey) return null;
|
|
3329
|
+
var actionKey = maybeActionKey,
|
|
3330
|
+
action = null;
|
|
3331
|
+
if (actionKey.startsWith("$ACTION_REF_"))
|
|
3332
|
+
(actionKey = "$ACTION_" + actionKey.slice(12) + ":"),
|
|
3333
|
+
(body = decodeBoundActionMetaData(body, serverManifest, actionKey)),
|
|
3334
|
+
(action = loadServerReference(serverManifest, body));
|
|
3335
|
+
else if (actionKey.startsWith("$ACTION_ID_"))
|
|
3336
|
+
(body = actionKey.slice(11)),
|
|
3337
|
+
(action = loadServerReference(serverManifest, { id: body, bound: null }));
|
|
3338
|
+
else throw Error("Cannot handle action key. This is a bug in React.");
|
|
3339
|
+
return action.then(function (fn) {
|
|
3340
|
+
return fn.bind(null, formData);
|
|
3341
|
+
});
|
|
3241
3342
|
};
|
|
3242
3343
|
exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
3243
3344
|
var keyPath = body.get("$ACTION_KEY");
|
|
3244
3345
|
if ("string" !== typeof keyPath) return Promise.resolve(null);
|
|
3245
|
-
var
|
|
3346
|
+
var actionKey = null;
|
|
3246
3347
|
body.forEach(function (value, key) {
|
|
3247
|
-
key.startsWith("$ACTION_REF_") &&
|
|
3248
|
-
((value = "$ACTION_" + key.slice(12) + ":"),
|
|
3249
|
-
(metaData = decodeBoundActionMetaData(body, serverManifest, value)));
|
|
3348
|
+
key.startsWith("$ACTION_REF_") && (actionKey = key);
|
|
3250
3349
|
});
|
|
3251
|
-
if (null ===
|
|
3252
|
-
var
|
|
3253
|
-
|
|
3350
|
+
if (null === actionKey) return Promise.resolve(null);
|
|
3351
|
+
var formFieldPrefix = "$ACTION_" + actionKey.slice(12) + ":";
|
|
3352
|
+
body = decodeBoundActionMetaData(body, serverManifest, formFieldPrefix);
|
|
3353
|
+
var referenceId = body.id;
|
|
3354
|
+
return Promise.resolve(body.bound).then(function (bound) {
|
|
3254
3355
|
return null === bound
|
|
3255
3356
|
? null
|
|
3256
3357
|
: [actionResult, keyPath, referenceId, bound.length - 1];
|
|
@@ -3280,28 +3381,32 @@ exports.decodeReplyFromBusboy = function (busboyStream, turbopackMap, options) {
|
|
|
3280
3381
|
if (!current.complete) return;
|
|
3281
3382
|
try {
|
|
3282
3383
|
var key = current.name,
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3384
|
+
JSCompiler_temp_const = response._formData;
|
|
3385
|
+
var handle = current.file;
|
|
3386
|
+
if ("function" === typeof File)
|
|
3387
|
+
var JSCompiler_inline_result = new File(
|
|
3388
|
+
handle.chunks,
|
|
3389
|
+
handle.filename,
|
|
3390
|
+
{ type: handle.mime }
|
|
3391
|
+
);
|
|
3392
|
+
else {
|
|
3393
|
+
var scratch = new FormData();
|
|
3394
|
+
scratch.append(
|
|
3395
|
+
"file",
|
|
3396
|
+
new Blob(handle.chunks, { type: handle.mime }),
|
|
3397
|
+
handle.filename
|
|
3398
|
+
);
|
|
3399
|
+
JSCompiler_inline_result = scratch.get("file");
|
|
3400
|
+
}
|
|
3401
|
+
appendBackingEntry(
|
|
3402
|
+
JSCompiler_temp_const,
|
|
3403
|
+
JSCompiler_inline_result,
|
|
3404
|
+
key
|
|
3405
|
+
);
|
|
3293
3406
|
var queuedFields = current.queuedFields;
|
|
3294
3407
|
if (null !== queuedFields)
|
|
3295
|
-
for (
|
|
3296
|
-
|
|
3297
|
-
key$jscomp$0 < queuedFields.length;
|
|
3298
|
-
key$jscomp$0 += 2
|
|
3299
|
-
)
|
|
3300
|
-
resolveField(
|
|
3301
|
-
response,
|
|
3302
|
-
queuedFields[key$jscomp$0],
|
|
3303
|
-
queuedFields[key$jscomp$0 + 1]
|
|
3304
|
-
);
|
|
3408
|
+
for (var i = 0; i < queuedFields.length; i += 2)
|
|
3409
|
+
resolveField(response, queuedFields[i], queuedFields[i + 1]);
|
|
3305
3410
|
} catch (error) {
|
|
3306
3411
|
busboyStream.destroy(error);
|
|
3307
3412
|
return;
|