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
|
@@ -11,12 +11,17 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
var ReactDOM = require("react-dom"),
|
|
13
13
|
React = require("react"),
|
|
14
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
14
15
|
channel = new MessageChannel(),
|
|
15
16
|
taskQueue = [];
|
|
16
17
|
channel.port1.onmessage = function () {
|
|
17
18
|
var task = taskQueue.shift();
|
|
18
19
|
task && task();
|
|
19
20
|
};
|
|
21
|
+
var supportsArrayBufferDetached = hasOwnProperty.call(
|
|
22
|
+
ArrayBuffer.prototype,
|
|
23
|
+
"detached"
|
|
24
|
+
);
|
|
20
25
|
function scheduleWork(callback) {
|
|
21
26
|
taskQueue.push(callback);
|
|
22
27
|
channel.port2.postMessage(null);
|
|
@@ -38,28 +43,30 @@ var LocalPromise = Promise,
|
|
|
38
43
|
currentView = null,
|
|
39
44
|
writtenBytes = 0;
|
|
40
45
|
function writeChunkAndReturn(destination, chunk) {
|
|
41
|
-
if (0
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
currentView
|
|
61
|
-
writtenBytes
|
|
62
|
-
|
|
46
|
+
if (0 === chunk.byteLength) {
|
|
47
|
+
if (supportsArrayBufferDetached && chunk.buffer.detached)
|
|
48
|
+
throw Error(
|
|
49
|
+
"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()`."
|
|
50
|
+
);
|
|
51
|
+
} else if (2048 < chunk.byteLength)
|
|
52
|
+
0 < writtenBytes &&
|
|
53
|
+
(destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes)),
|
|
54
|
+
(currentView = new Uint8Array(2048)),
|
|
55
|
+
(writtenBytes = 0)),
|
|
56
|
+
destination.enqueue(chunk);
|
|
57
|
+
else {
|
|
58
|
+
var allowableBytes = currentView.length - writtenBytes;
|
|
59
|
+
allowableBytes < chunk.byteLength &&
|
|
60
|
+
(0 === allowableBytes
|
|
61
|
+
? destination.enqueue(currentView)
|
|
62
|
+
: (currentView.set(chunk.subarray(0, allowableBytes), writtenBytes),
|
|
63
|
+
destination.enqueue(currentView),
|
|
64
|
+
(chunk = chunk.subarray(allowableBytes))),
|
|
65
|
+
(currentView = new Uint8Array(2048)),
|
|
66
|
+
(writtenBytes = 0));
|
|
67
|
+
currentView.set(chunk, writtenBytes);
|
|
68
|
+
writtenBytes += chunk.byteLength;
|
|
69
|
+
}
|
|
63
70
|
return !0;
|
|
64
71
|
}
|
|
65
72
|
var textEncoder = new TextEncoder();
|
|
@@ -935,7 +942,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
935
942
|
emitErrorChunk(request, streamTask.id, digest);
|
|
936
943
|
enqueueFlush(request);
|
|
937
944
|
"function" === typeof iterator.throw &&
|
|
938
|
-
iterator.throw(reason).then(
|
|
945
|
+
iterator.throw(reason).then(noop, noop);
|
|
939
946
|
}
|
|
940
947
|
}
|
|
941
948
|
function abortIterable(reason) {
|
|
@@ -946,7 +953,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
946
953
|
emitErrorChunk(request, streamTask.id, digest);
|
|
947
954
|
enqueueFlush(request);
|
|
948
955
|
"function" === typeof iterator.throw &&
|
|
949
|
-
iterator.throw(reason).then(
|
|
956
|
+
iterator.throw(reason).then(noop, noop);
|
|
950
957
|
}
|
|
951
958
|
}
|
|
952
959
|
iterable = iterable === iterator;
|
|
@@ -1681,14 +1688,30 @@ function emitModelChunk(request, id, json) {
|
|
|
1681
1688
|
}
|
|
1682
1689
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
|
1683
1690
|
request.pendingChunks++;
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1691
|
+
a: {
|
|
1692
|
+
var view = new Uint8Array(
|
|
1693
|
+
typedArray.buffer,
|
|
1694
|
+
typedArray.byteOffset,
|
|
1695
|
+
typedArray.byteLength
|
|
1696
|
+
);
|
|
1697
|
+
if (2048 < typedArray.byteLength) {
|
|
1698
|
+
if (
|
|
1699
|
+
0 !== typedArray.byteOffset ||
|
|
1700
|
+
typedArray.byteLength !== typedArray.buffer.byteLength ||
|
|
1701
|
+
typedArray.buffer.resizable
|
|
1702
|
+
) {
|
|
1703
|
+
typedArray = view.slice();
|
|
1704
|
+
break a;
|
|
1705
|
+
}
|
|
1706
|
+
if (!supportsArrayBufferDetached) {
|
|
1707
|
+
typedArray = view.slice();
|
|
1708
|
+
break a;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
typedArray = view;
|
|
1712
|
+
}
|
|
1713
|
+
view = typedArray.byteLength;
|
|
1714
|
+
id = id.toString(16) + ":" + tag + view.toString(16) + ",";
|
|
1692
1715
|
id = stringToChunk(id);
|
|
1693
1716
|
request.completedRegularChunks.push(id, typedArray);
|
|
1694
1717
|
}
|
|
@@ -1927,7 +1950,6 @@ function abort(request, reason) {
|
|
|
1927
1950
|
logRecoverableError(request, error$27, null), fatalError(request, error$27);
|
|
1928
1951
|
}
|
|
1929
1952
|
}
|
|
1930
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1931
1953
|
function resolveServerReference(bundlerConfig, id) {
|
|
1932
1954
|
var name = "",
|
|
1933
1955
|
resolvedModuleData = bundlerConfig[id];
|
|
@@ -1998,6 +2020,38 @@ function requireModule(metadata) {
|
|
|
1998
2020
|
if (hasOwnProperty.call(moduleExports, metadata[2]))
|
|
1999
2021
|
return moduleExports[metadata[2]];
|
|
2000
2022
|
}
|
|
2023
|
+
function appendBackingEntry(backingStore, value, key) {
|
|
2024
|
+
var prefix = backingStore.prefix;
|
|
2025
|
+
if (key.startsWith(prefix)) {
|
|
2026
|
+
switch (key[prefix.length]) {
|
|
2027
|
+
case "_":
|
|
2028
|
+
prefix = backingStore.referencedEntries;
|
|
2029
|
+
null === prefix && (prefix = backingStore.referencedEntries = []);
|
|
2030
|
+
prefix.push([key, value]);
|
|
2031
|
+
return;
|
|
2032
|
+
case "S":
|
|
2033
|
+
"string" === typeof value &&
|
|
2034
|
+
((prefix = backingStore.streamChunks),
|
|
2035
|
+
null === prefix && (prefix = backingStore.streamChunks = new Map()),
|
|
2036
|
+
(backingStore = prefix.get(key)),
|
|
2037
|
+
void 0 === backingStore
|
|
2038
|
+
? prefix.set(key, [value])
|
|
2039
|
+
: backingStore.push(value));
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
"string" === typeof value
|
|
2043
|
+
? ((prefix = backingStore.stringChunks),
|
|
2044
|
+
null === prefix && (prefix = backingStore.stringChunks = new Map()),
|
|
2045
|
+
prefix.set(key, value))
|
|
2046
|
+
: ((prefix = backingStore.blobs),
|
|
2047
|
+
null === prefix && (prefix = backingStore.blobs = new Map()),
|
|
2048
|
+
prefix.set(key, value));
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
function getBackingBlob(backingStore, key) {
|
|
2052
|
+
backingStore = backingStore.blobs;
|
|
2053
|
+
return null === backingStore ? void 0 : backingStore.get(key);
|
|
2054
|
+
}
|
|
2001
2055
|
var RESPONSE_SYMBOL = Symbol();
|
|
2002
2056
|
function ReactPromise(status, value, reason) {
|
|
2003
2057
|
this.status = status;
|
|
@@ -2367,13 +2421,16 @@ function reportGlobalError(response, error) {
|
|
|
2367
2421
|
function getChunk(response, id) {
|
|
2368
2422
|
var chunks = response._chunks,
|
|
2369
2423
|
chunk = chunks.get(id);
|
|
2370
|
-
chunk
|
|
2371
|
-
|
|
2372
|
-
|
|
2424
|
+
if (!chunk) {
|
|
2425
|
+
chunk = response._prefix;
|
|
2426
|
+
var stringChunks = response._formData.stringChunks;
|
|
2427
|
+
chunk = null === stringChunks ? void 0 : stringChunks.get(chunk + id);
|
|
2428
|
+
chunk =
|
|
2373
2429
|
"string" === typeof chunk
|
|
2374
2430
|
? createResolvedModelChunk(response, chunk, id)
|
|
2375
|
-
: new ReactPromise("pending", null, null)
|
|
2376
|
-
chunks.set(id, chunk)
|
|
2431
|
+
: new ReactPromise("pending", null, null);
|
|
2432
|
+
chunks.set(id, chunk);
|
|
2433
|
+
}
|
|
2377
2434
|
return chunk;
|
|
2378
2435
|
}
|
|
2379
2436
|
function fulfillReference(response, reference, value, arrayRoot) {
|
|
@@ -2604,7 +2661,7 @@ function parseTypedArray(
|
|
|
2604
2661
|
Error("Already initialized typed array.")
|
|
2605
2662
|
)
|
|
2606
2663
|
);
|
|
2607
|
-
reference = response._formData
|
|
2664
|
+
reference = getBackingBlob(response._formData, key).arrayBuffer();
|
|
2608
2665
|
if (initializingHandler) {
|
|
2609
2666
|
var handler = initializingHandler;
|
|
2610
2667
|
handler.deps++;
|
|
@@ -2648,13 +2705,15 @@ function resolveStream(response, id, stream, controller) {
|
|
|
2648
2705
|
var chunks = response._chunks;
|
|
2649
2706
|
stream = new ReactPromise("fulfilled", stream, controller);
|
|
2650
2707
|
chunks.set(id, stream);
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2708
|
+
chunks = response._prefix;
|
|
2709
|
+
response = response._formData.streamChunks;
|
|
2710
|
+
id = null === response ? void 0 : response.get(chunks + "S" + id);
|
|
2711
|
+
if (void 0 !== id)
|
|
2712
|
+
for (response = 0; response < id.length; response++)
|
|
2713
|
+
(chunks = id[response]),
|
|
2714
|
+
"C" === chunks[0]
|
|
2656
2715
|
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
|
2657
|
-
: controller.enqueueModel(chunks)
|
|
2716
|
+
: controller.enqueueModel(chunks);
|
|
2658
2717
|
}
|
|
2659
2718
|
function parseReadableStream(response, reference, type) {
|
|
2660
2719
|
function enqueue(value) {
|
|
@@ -2820,7 +2879,14 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2820
2879
|
});
|
|
2821
2880
|
return iterator;
|
|
2822
2881
|
}
|
|
2823
|
-
function parseModelString(
|
|
2882
|
+
function parseModelString(
|
|
2883
|
+
response,
|
|
2884
|
+
obj,
|
|
2885
|
+
key$jscomp$0,
|
|
2886
|
+
value,
|
|
2887
|
+
reference,
|
|
2888
|
+
arrayRoot
|
|
2889
|
+
) {
|
|
2824
2890
|
if ("$" === value[0]) {
|
|
2825
2891
|
switch (value[1]) {
|
|
2826
2892
|
case "$":
|
|
@@ -2838,7 +2904,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2838
2904
|
response,
|
|
2839
2905
|
arrayRoot,
|
|
2840
2906
|
obj,
|
|
2841
|
-
key,
|
|
2907
|
+
key$jscomp$0,
|
|
2842
2908
|
null,
|
|
2843
2909
|
loadServerReference$1
|
|
2844
2910
|
)
|
|
@@ -2855,43 +2921,55 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2855
2921
|
case "Q":
|
|
2856
2922
|
return (
|
|
2857
2923
|
(arrayRoot = value.slice(2)),
|
|
2858
|
-
getOutlinedModel(
|
|
2924
|
+
getOutlinedModel(
|
|
2925
|
+
response,
|
|
2926
|
+
arrayRoot,
|
|
2927
|
+
obj,
|
|
2928
|
+
key$jscomp$0,
|
|
2929
|
+
null,
|
|
2930
|
+
createMap
|
|
2931
|
+
)
|
|
2859
2932
|
);
|
|
2860
2933
|
case "W":
|
|
2861
2934
|
return (
|
|
2862
2935
|
(arrayRoot = value.slice(2)),
|
|
2863
|
-
getOutlinedModel(
|
|
2936
|
+
getOutlinedModel(
|
|
2937
|
+
response,
|
|
2938
|
+
arrayRoot,
|
|
2939
|
+
obj,
|
|
2940
|
+
key$jscomp$0,
|
|
2941
|
+
null,
|
|
2942
|
+
createSet
|
|
2943
|
+
)
|
|
2864
2944
|
);
|
|
2865
2945
|
case "K":
|
|
2866
|
-
|
|
2867
|
-
obj = response._prefix + "_";
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
var referencedFormDataKey = value.slice(key.length), i = 0;
|
|
2881
|
-
i < reference.length;
|
|
2882
|
-
i++
|
|
2883
|
-
)
|
|
2884
|
-
arrayRoot.append(referencedFormDataKey, reference[i]);
|
|
2885
|
-
response.data.delete(value);
|
|
2886
|
-
response.keyPointer++;
|
|
2887
|
-
} else if (value.startsWith(obj)) break;
|
|
2888
|
-
else response.keyPointer++;
|
|
2946
|
+
obj = value.slice(2);
|
|
2947
|
+
obj = response._prefix + "_" + obj + "_";
|
|
2948
|
+
response = response._formData;
|
|
2949
|
+
key$jscomp$0 = new FormData();
|
|
2950
|
+
arrayRoot = response.referencedEntries;
|
|
2951
|
+
if (null !== arrayRoot) {
|
|
2952
|
+
for (value = response.keyPointer; value < arrayRoot.length; ) {
|
|
2953
|
+
reference = arrayRoot[value];
|
|
2954
|
+
var key = reference[0];
|
|
2955
|
+
if (!key.startsWith(obj)) break;
|
|
2956
|
+
key$jscomp$0.append(key.slice(obj.length), reference[1]);
|
|
2957
|
+
value++;
|
|
2958
|
+
}
|
|
2959
|
+
response.keyPointer = value;
|
|
2889
2960
|
}
|
|
2890
|
-
return
|
|
2961
|
+
return key$jscomp$0;
|
|
2891
2962
|
case "i":
|
|
2892
2963
|
return (
|
|
2893
2964
|
(arrayRoot = value.slice(2)),
|
|
2894
|
-
getOutlinedModel(
|
|
2965
|
+
getOutlinedModel(
|
|
2966
|
+
response,
|
|
2967
|
+
arrayRoot,
|
|
2968
|
+
obj,
|
|
2969
|
+
key$jscomp$0,
|
|
2970
|
+
null,
|
|
2971
|
+
extractIterator
|
|
2972
|
+
)
|
|
2895
2973
|
);
|
|
2896
2974
|
case "I":
|
|
2897
2975
|
return Infinity;
|
|
@@ -2922,7 +3000,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2922
3000
|
ArrayBuffer,
|
|
2923
3001
|
1,
|
|
2924
3002
|
obj,
|
|
2925
|
-
key,
|
|
3003
|
+
key$jscomp$0,
|
|
2926
3004
|
arrayRoot
|
|
2927
3005
|
);
|
|
2928
3006
|
case "O":
|
|
@@ -2932,7 +3010,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2932
3010
|
Int8Array,
|
|
2933
3011
|
1,
|
|
2934
3012
|
obj,
|
|
2935
|
-
key,
|
|
3013
|
+
key$jscomp$0,
|
|
2936
3014
|
arrayRoot
|
|
2937
3015
|
);
|
|
2938
3016
|
case "o":
|
|
@@ -2942,7 +3020,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2942
3020
|
Uint8Array,
|
|
2943
3021
|
1,
|
|
2944
3022
|
obj,
|
|
2945
|
-
key,
|
|
3023
|
+
key$jscomp$0,
|
|
2946
3024
|
arrayRoot
|
|
2947
3025
|
);
|
|
2948
3026
|
case "U":
|
|
@@ -2952,7 +3030,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2952
3030
|
Uint8ClampedArray,
|
|
2953
3031
|
1,
|
|
2954
3032
|
obj,
|
|
2955
|
-
key,
|
|
3033
|
+
key$jscomp$0,
|
|
2956
3034
|
arrayRoot
|
|
2957
3035
|
);
|
|
2958
3036
|
case "S":
|
|
@@ -2962,7 +3040,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2962
3040
|
Int16Array,
|
|
2963
3041
|
2,
|
|
2964
3042
|
obj,
|
|
2965
|
-
key,
|
|
3043
|
+
key$jscomp$0,
|
|
2966
3044
|
arrayRoot
|
|
2967
3045
|
);
|
|
2968
3046
|
case "s":
|
|
@@ -2972,7 +3050,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2972
3050
|
Uint16Array,
|
|
2973
3051
|
2,
|
|
2974
3052
|
obj,
|
|
2975
|
-
key,
|
|
3053
|
+
key$jscomp$0,
|
|
2976
3054
|
arrayRoot
|
|
2977
3055
|
);
|
|
2978
3056
|
case "L":
|
|
@@ -2982,7 +3060,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2982
3060
|
Int32Array,
|
|
2983
3061
|
4,
|
|
2984
3062
|
obj,
|
|
2985
|
-
key,
|
|
3063
|
+
key$jscomp$0,
|
|
2986
3064
|
arrayRoot
|
|
2987
3065
|
);
|
|
2988
3066
|
case "l":
|
|
@@ -2992,7 +3070,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2992
3070
|
Uint32Array,
|
|
2993
3071
|
4,
|
|
2994
3072
|
obj,
|
|
2995
|
-
key,
|
|
3073
|
+
key$jscomp$0,
|
|
2996
3074
|
arrayRoot
|
|
2997
3075
|
);
|
|
2998
3076
|
case "G":
|
|
@@ -3002,7 +3080,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3002
3080
|
Float32Array,
|
|
3003
3081
|
4,
|
|
3004
3082
|
obj,
|
|
3005
|
-
key,
|
|
3083
|
+
key$jscomp$0,
|
|
3006
3084
|
arrayRoot
|
|
3007
3085
|
);
|
|
3008
3086
|
case "g":
|
|
@@ -3012,7 +3090,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3012
3090
|
Float64Array,
|
|
3013
3091
|
8,
|
|
3014
3092
|
obj,
|
|
3015
|
-
key,
|
|
3093
|
+
key$jscomp$0,
|
|
3016
3094
|
arrayRoot
|
|
3017
3095
|
);
|
|
3018
3096
|
case "M":
|
|
@@ -3022,7 +3100,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3022
3100
|
BigInt64Array,
|
|
3023
3101
|
8,
|
|
3024
3102
|
obj,
|
|
3025
|
-
key,
|
|
3103
|
+
key$jscomp$0,
|
|
3026
3104
|
arrayRoot
|
|
3027
3105
|
);
|
|
3028
3106
|
case "m":
|
|
@@ -3032,7 +3110,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3032
3110
|
BigUint64Array,
|
|
3033
3111
|
8,
|
|
3034
3112
|
obj,
|
|
3035
|
-
key,
|
|
3113
|
+
key$jscomp$0,
|
|
3036
3114
|
arrayRoot
|
|
3037
3115
|
);
|
|
3038
3116
|
case "V":
|
|
@@ -3042,13 +3120,13 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3042
3120
|
DataView,
|
|
3043
3121
|
1,
|
|
3044
3122
|
obj,
|
|
3045
|
-
key,
|
|
3123
|
+
key$jscomp$0,
|
|
3046
3124
|
arrayRoot
|
|
3047
3125
|
);
|
|
3048
3126
|
case "B":
|
|
3049
3127
|
return (
|
|
3050
3128
|
(obj = parseInt(value.slice(2), 16)),
|
|
3051
|
-
response._formData
|
|
3129
|
+
getBackingBlob(response._formData, response._prefix + obj)
|
|
3052
3130
|
);
|
|
3053
3131
|
}
|
|
3054
3132
|
switch (value[1]) {
|
|
@@ -3062,7 +3140,14 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3062
3140
|
return parseAsyncIterable(response, value, !0);
|
|
3063
3141
|
}
|
|
3064
3142
|
value = value.slice(1);
|
|
3065
|
-
return getOutlinedModel(
|
|
3143
|
+
return getOutlinedModel(
|
|
3144
|
+
response,
|
|
3145
|
+
value,
|
|
3146
|
+
obj,
|
|
3147
|
+
key$jscomp$0,
|
|
3148
|
+
arrayRoot,
|
|
3149
|
+
createModel
|
|
3150
|
+
);
|
|
3066
3151
|
}
|
|
3067
3152
|
null !== arrayRoot && bumpArrayCount(arrayRoot, value.length, response);
|
|
3068
3153
|
return value;
|
|
@@ -3074,11 +3159,20 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
3074
3159
|
: new FormData(),
|
|
3075
3160
|
arraySizeLimit =
|
|
3076
3161
|
4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 1e6,
|
|
3077
|
-
chunks = new Map()
|
|
3162
|
+
chunks = new Map(),
|
|
3163
|
+
backingStore = {
|
|
3164
|
+
prefix: formFieldPrefix,
|
|
3165
|
+
referencedEntries: null,
|
|
3166
|
+
keyPointer: 0,
|
|
3167
|
+
stringChunks: null,
|
|
3168
|
+
streamChunks: null,
|
|
3169
|
+
blobs: null
|
|
3170
|
+
};
|
|
3171
|
+
backingFormData.forEach(appendBackingEntry.bind(null, backingStore));
|
|
3078
3172
|
return {
|
|
3079
3173
|
_bundlerConfig: bundlerConfig,
|
|
3080
3174
|
_prefix: formFieldPrefix,
|
|
3081
|
-
_formData:
|
|
3175
|
+
_formData: backingStore,
|
|
3082
3176
|
_chunks: chunks,
|
|
3083
3177
|
_temporaryReferences: temporaryReferences,
|
|
3084
3178
|
_rootArrayContexts: new WeakMap(),
|
|
@@ -3140,44 +3234,41 @@ exports.createTemporaryReferenceSet = function () {
|
|
|
3140
3234
|
};
|
|
3141
3235
|
exports.decodeAction = function (body, serverManifest) {
|
|
3142
3236
|
var formData = new FormData(),
|
|
3143
|
-
|
|
3144
|
-
seenActions = new Set();
|
|
3237
|
+
maybeActionKey = null;
|
|
3145
3238
|
body.forEach(function (value, key) {
|
|
3146
3239
|
key.startsWith("$ACTION_")
|
|
3147
3240
|
? key.startsWith("$ACTION_REF_")
|
|
3148
|
-
?
|
|
3149
|
-
|
|
3150
|
-
(value = "$ACTION_" + key.slice(12) + ":"),
|
|
3151
|
-
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
|
3152
|
-
(action = loadServerReference(serverManifest, value)))
|
|
3153
|
-
: key.startsWith("$ACTION_ID_") &&
|
|
3154
|
-
!seenActions.has(key) &&
|
|
3155
|
-
(seenActions.add(key),
|
|
3156
|
-
(value = key.slice(11)),
|
|
3157
|
-
(action = loadServerReference(serverManifest, {
|
|
3158
|
-
id: value,
|
|
3159
|
-
bound: null
|
|
3160
|
-
})))
|
|
3241
|
+
? (maybeActionKey = key)
|
|
3242
|
+
: key.startsWith("$ACTION_ID_") && (maybeActionKey = key)
|
|
3161
3243
|
: formData.append(key, value);
|
|
3162
3244
|
});
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3245
|
+
if (null === maybeActionKey) return null;
|
|
3246
|
+
var actionKey = maybeActionKey,
|
|
3247
|
+
action = null;
|
|
3248
|
+
if (actionKey.startsWith("$ACTION_REF_"))
|
|
3249
|
+
(actionKey = "$ACTION_" + actionKey.slice(12) + ":"),
|
|
3250
|
+
(body = decodeBoundActionMetaData(body, serverManifest, actionKey)),
|
|
3251
|
+
(action = loadServerReference(serverManifest, body));
|
|
3252
|
+
else if (actionKey.startsWith("$ACTION_ID_"))
|
|
3253
|
+
(body = actionKey.slice(11)),
|
|
3254
|
+
(action = loadServerReference(serverManifest, { id: body, bound: null }));
|
|
3255
|
+
else throw Error("Cannot handle action key. This is a bug in React.");
|
|
3256
|
+
return action.then(function (fn) {
|
|
3257
|
+
return fn.bind(null, formData);
|
|
3258
|
+
});
|
|
3168
3259
|
};
|
|
3169
3260
|
exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
3170
3261
|
var keyPath = body.get("$ACTION_KEY");
|
|
3171
3262
|
if ("string" !== typeof keyPath) return Promise.resolve(null);
|
|
3172
|
-
var
|
|
3263
|
+
var actionKey = null;
|
|
3173
3264
|
body.forEach(function (value, key) {
|
|
3174
|
-
key.startsWith("$ACTION_REF_") &&
|
|
3175
|
-
((value = "$ACTION_" + key.slice(12) + ":"),
|
|
3176
|
-
(metaData = decodeBoundActionMetaData(body, serverManifest, value)));
|
|
3265
|
+
key.startsWith("$ACTION_REF_") && (actionKey = key);
|
|
3177
3266
|
});
|
|
3178
|
-
if (null ===
|
|
3179
|
-
var
|
|
3180
|
-
|
|
3267
|
+
if (null === actionKey) return Promise.resolve(null);
|
|
3268
|
+
var formFieldPrefix = "$ACTION_" + actionKey.slice(12) + ":";
|
|
3269
|
+
body = decodeBoundActionMetaData(body, serverManifest, formFieldPrefix);
|
|
3270
|
+
var referenceId = body.id;
|
|
3271
|
+
return Promise.resolve(body.bound).then(function (bound) {
|
|
3181
3272
|
return null === bound
|
|
3182
3273
|
? null
|
|
3183
3274
|
: [actionResult, keyPath, referenceId, bound.length - 1];
|