react-server-dom-webpack 19.1.8 → 19.1.10
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-webpack-client.browser.development.js +61 -52
- package/cjs/react-server-dom-webpack-client.browser.production.js +79 -63
- package/cjs/react-server-dom-webpack-client.edge.development.js +64 -52
- package/cjs/react-server-dom-webpack-client.edge.production.js +84 -69
- package/cjs/react-server-dom-webpack-client.node.development.js +64 -52
- package/cjs/react-server-dom-webpack-client.node.production.js +84 -69
- package/cjs/react-server-dom-webpack-server.browser.development.js +214 -123
- package/cjs/react-server-dom-webpack-server.browser.production.js +209 -118
- package/cjs/react-server-dom-webpack-server.edge.development.js +253 -149
- package/cjs/react-server-dom-webpack-server.edge.production.js +244 -145
- package/cjs/react-server-dom-webpack-server.node.development.js +270 -161
- package/cjs/react-server-dom-webpack-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();
|
|
@@ -924,7 +931,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
924
931
|
erroredTask(request, streamTask, reason),
|
|
925
932
|
enqueueFlush(request),
|
|
926
933
|
"function" === typeof iterator.throw &&
|
|
927
|
-
iterator.throw(reason).then(
|
|
934
|
+
iterator.throw(reason).then(noop, noop));
|
|
928
935
|
}
|
|
929
936
|
function abortIterable(reason) {
|
|
930
937
|
aborted ||
|
|
@@ -933,7 +940,7 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
933
940
|
erroredTask(request, streamTask, reason),
|
|
934
941
|
enqueueFlush(request),
|
|
935
942
|
"function" === typeof iterator.throw &&
|
|
936
|
-
iterator.throw(reason).then(
|
|
943
|
+
iterator.throw(reason).then(noop, noop));
|
|
937
944
|
}
|
|
938
945
|
iterable = iterable === iterator;
|
|
939
946
|
var streamTask = createTask(
|
|
@@ -1654,14 +1661,30 @@ function emitModelChunk(request, id, json) {
|
|
|
1654
1661
|
}
|
|
1655
1662
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
|
1656
1663
|
request.pendingChunks++;
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1664
|
+
a: {
|
|
1665
|
+
var view = new Uint8Array(
|
|
1666
|
+
typedArray.buffer,
|
|
1667
|
+
typedArray.byteOffset,
|
|
1668
|
+
typedArray.byteLength
|
|
1669
|
+
);
|
|
1670
|
+
if (2048 < typedArray.byteLength) {
|
|
1671
|
+
if (
|
|
1672
|
+
0 !== typedArray.byteOffset ||
|
|
1673
|
+
typedArray.byteLength !== typedArray.buffer.byteLength ||
|
|
1674
|
+
typedArray.buffer.resizable
|
|
1675
|
+
) {
|
|
1676
|
+
typedArray = view.slice();
|
|
1677
|
+
break a;
|
|
1678
|
+
}
|
|
1679
|
+
if (!supportsArrayBufferDetached) {
|
|
1680
|
+
typedArray = view.slice();
|
|
1681
|
+
break a;
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
typedArray = view;
|
|
1685
|
+
}
|
|
1686
|
+
view = typedArray.byteLength;
|
|
1687
|
+
id = id.toString(16) + ":" + tag + view.toString(16) + ",";
|
|
1665
1688
|
id = stringToChunk(id);
|
|
1666
1689
|
request.completedRegularChunks.push(id, typedArray);
|
|
1667
1690
|
}
|
|
@@ -1913,7 +1936,6 @@ function abort(request, reason) {
|
|
|
1913
1936
|
logRecoverableError(request, error$26, null), fatalError(request, error$26);
|
|
1914
1937
|
}
|
|
1915
1938
|
}
|
|
1916
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1917
1939
|
function resolveServerReference(bundlerConfig, id) {
|
|
1918
1940
|
var name = "",
|
|
1919
1941
|
resolvedModuleData = bundlerConfig[id];
|
|
@@ -1996,6 +2018,38 @@ __webpack_require__.u = function (chunkId) {
|
|
|
1996
2018
|
? flightChunk
|
|
1997
2019
|
: webpackGetChunkFilename(chunkId);
|
|
1998
2020
|
};
|
|
2021
|
+
function appendBackingEntry(backingStore, value, key) {
|
|
2022
|
+
var prefix = backingStore.prefix;
|
|
2023
|
+
if (key.startsWith(prefix)) {
|
|
2024
|
+
switch (key[prefix.length]) {
|
|
2025
|
+
case "_":
|
|
2026
|
+
prefix = backingStore.referencedEntries;
|
|
2027
|
+
null === prefix && (prefix = backingStore.referencedEntries = []);
|
|
2028
|
+
prefix.push([key, value]);
|
|
2029
|
+
return;
|
|
2030
|
+
case "S":
|
|
2031
|
+
"string" === typeof value &&
|
|
2032
|
+
((prefix = backingStore.streamChunks),
|
|
2033
|
+
null === prefix && (prefix = backingStore.streamChunks = new Map()),
|
|
2034
|
+
(backingStore = prefix.get(key)),
|
|
2035
|
+
void 0 === backingStore
|
|
2036
|
+
? prefix.set(key, [value])
|
|
2037
|
+
: backingStore.push(value));
|
|
2038
|
+
return;
|
|
2039
|
+
}
|
|
2040
|
+
"string" === typeof value
|
|
2041
|
+
? ((prefix = backingStore.stringChunks),
|
|
2042
|
+
null === prefix && (prefix = backingStore.stringChunks = new Map()),
|
|
2043
|
+
prefix.set(key, value))
|
|
2044
|
+
: ((prefix = backingStore.blobs),
|
|
2045
|
+
null === prefix && (prefix = backingStore.blobs = new Map()),
|
|
2046
|
+
prefix.set(key, value));
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
function getBackingBlob(backingStore, key) {
|
|
2050
|
+
backingStore = backingStore.blobs;
|
|
2051
|
+
return null === backingStore ? void 0 : backingStore.get(key);
|
|
2052
|
+
}
|
|
1999
2053
|
var RESPONSE_SYMBOL = Symbol();
|
|
2000
2054
|
function ReactPromise(status, value, reason) {
|
|
2001
2055
|
this.status = status;
|
|
@@ -2367,15 +2421,18 @@ 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
2431
|
: response._closed
|
|
2376
2432
|
? new ReactPromise("rejected", null, response._closedReason)
|
|
2377
|
-
: new ReactPromise("pending", null, null)
|
|
2378
|
-
chunks.set(id, chunk)
|
|
2433
|
+
: new ReactPromise("pending", null, null);
|
|
2434
|
+
chunks.set(id, chunk);
|
|
2435
|
+
}
|
|
2379
2436
|
return chunk;
|
|
2380
2437
|
}
|
|
2381
2438
|
function fulfillReference(response, reference, value, arrayRoot) {
|
|
@@ -2606,7 +2663,7 @@ function parseTypedArray(
|
|
|
2606
2663
|
Error("Already initialized typed array.")
|
|
2607
2664
|
)
|
|
2608
2665
|
);
|
|
2609
|
-
reference = response._formData
|
|
2666
|
+
reference = getBackingBlob(response._formData, key).arrayBuffer();
|
|
2610
2667
|
if (initializingHandler) {
|
|
2611
2668
|
var handler = initializingHandler;
|
|
2612
2669
|
handler.deps++;
|
|
@@ -2650,13 +2707,15 @@ function resolveStream(response, id, stream, controller) {
|
|
|
2650
2707
|
var chunks = response._chunks;
|
|
2651
2708
|
stream = new ReactPromise("fulfilled", stream, controller);
|
|
2652
2709
|
chunks.set(id, stream);
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2710
|
+
chunks = response._prefix;
|
|
2711
|
+
response = response._formData.streamChunks;
|
|
2712
|
+
id = null === response ? void 0 : response.get(chunks + "S" + id);
|
|
2713
|
+
if (void 0 !== id)
|
|
2714
|
+
for (response = 0; response < id.length; response++)
|
|
2715
|
+
(chunks = id[response]),
|
|
2716
|
+
"C" === chunks[0]
|
|
2658
2717
|
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
|
2659
|
-
: controller.enqueueModel(chunks)
|
|
2718
|
+
: controller.enqueueModel(chunks);
|
|
2660
2719
|
}
|
|
2661
2720
|
function parseReadableStream(response, reference, type) {
|
|
2662
2721
|
function enqueue(value) {
|
|
@@ -2822,7 +2881,14 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2822
2881
|
});
|
|
2823
2882
|
return iterator;
|
|
2824
2883
|
}
|
|
2825
|
-
function parseModelString(
|
|
2884
|
+
function parseModelString(
|
|
2885
|
+
response,
|
|
2886
|
+
obj,
|
|
2887
|
+
key$jscomp$0,
|
|
2888
|
+
value,
|
|
2889
|
+
reference,
|
|
2890
|
+
arrayRoot
|
|
2891
|
+
) {
|
|
2826
2892
|
if ("$" === value[0]) {
|
|
2827
2893
|
switch (value[1]) {
|
|
2828
2894
|
case "$":
|
|
@@ -2840,7 +2906,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2840
2906
|
response,
|
|
2841
2907
|
arrayRoot,
|
|
2842
2908
|
obj,
|
|
2843
|
-
key,
|
|
2909
|
+
key$jscomp$0,
|
|
2844
2910
|
null,
|
|
2845
2911
|
loadServerReference$1
|
|
2846
2912
|
)
|
|
@@ -2857,43 +2923,55 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2857
2923
|
case "Q":
|
|
2858
2924
|
return (
|
|
2859
2925
|
(arrayRoot = value.slice(2)),
|
|
2860
|
-
getOutlinedModel(
|
|
2926
|
+
getOutlinedModel(
|
|
2927
|
+
response,
|
|
2928
|
+
arrayRoot,
|
|
2929
|
+
obj,
|
|
2930
|
+
key$jscomp$0,
|
|
2931
|
+
null,
|
|
2932
|
+
createMap
|
|
2933
|
+
)
|
|
2861
2934
|
);
|
|
2862
2935
|
case "W":
|
|
2863
2936
|
return (
|
|
2864
2937
|
(arrayRoot = value.slice(2)),
|
|
2865
|
-
getOutlinedModel(
|
|
2938
|
+
getOutlinedModel(
|
|
2939
|
+
response,
|
|
2940
|
+
arrayRoot,
|
|
2941
|
+
obj,
|
|
2942
|
+
key$jscomp$0,
|
|
2943
|
+
null,
|
|
2944
|
+
createSet
|
|
2945
|
+
)
|
|
2866
2946
|
);
|
|
2867
2947
|
case "K":
|
|
2868
|
-
|
|
2869
|
-
obj = response._prefix + "_";
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
var referencedFormDataKey = value.slice(key.length), i = 0;
|
|
2883
|
-
i < reference.length;
|
|
2884
|
-
i++
|
|
2885
|
-
)
|
|
2886
|
-
arrayRoot.append(referencedFormDataKey, reference[i]);
|
|
2887
|
-
response.data.delete(value);
|
|
2888
|
-
response.keyPointer++;
|
|
2889
|
-
} else if (value.startsWith(obj)) break;
|
|
2890
|
-
else response.keyPointer++;
|
|
2948
|
+
obj = value.slice(2);
|
|
2949
|
+
obj = response._prefix + "_" + obj + "_";
|
|
2950
|
+
response = response._formData;
|
|
2951
|
+
key$jscomp$0 = new FormData();
|
|
2952
|
+
arrayRoot = response.referencedEntries;
|
|
2953
|
+
if (null !== arrayRoot) {
|
|
2954
|
+
for (value = response.keyPointer; value < arrayRoot.length; ) {
|
|
2955
|
+
reference = arrayRoot[value];
|
|
2956
|
+
var key = reference[0];
|
|
2957
|
+
if (!key.startsWith(obj)) break;
|
|
2958
|
+
key$jscomp$0.append(key.slice(obj.length), reference[1]);
|
|
2959
|
+
value++;
|
|
2960
|
+
}
|
|
2961
|
+
response.keyPointer = value;
|
|
2891
2962
|
}
|
|
2892
|
-
return
|
|
2963
|
+
return key$jscomp$0;
|
|
2893
2964
|
case "i":
|
|
2894
2965
|
return (
|
|
2895
2966
|
(arrayRoot = value.slice(2)),
|
|
2896
|
-
getOutlinedModel(
|
|
2967
|
+
getOutlinedModel(
|
|
2968
|
+
response,
|
|
2969
|
+
arrayRoot,
|
|
2970
|
+
obj,
|
|
2971
|
+
key$jscomp$0,
|
|
2972
|
+
null,
|
|
2973
|
+
extractIterator
|
|
2974
|
+
)
|
|
2897
2975
|
);
|
|
2898
2976
|
case "I":
|
|
2899
2977
|
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
|
case "R":
|
|
3054
3132
|
return parseReadableStream(response, value, void 0);
|
|
@@ -3060,7 +3138,14 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3060
3138
|
return parseAsyncIterable(response, value, !0);
|
|
3061
3139
|
}
|
|
3062
3140
|
value = value.slice(1);
|
|
3063
|
-
return getOutlinedModel(
|
|
3141
|
+
return getOutlinedModel(
|
|
3142
|
+
response,
|
|
3143
|
+
value,
|
|
3144
|
+
obj,
|
|
3145
|
+
key$jscomp$0,
|
|
3146
|
+
arrayRoot,
|
|
3147
|
+
createModel
|
|
3148
|
+
);
|
|
3064
3149
|
}
|
|
3065
3150
|
null !== arrayRoot && bumpArrayCount(arrayRoot, value.length, response);
|
|
3066
3151
|
return value;
|
|
@@ -3072,11 +3157,20 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
3072
3157
|
: new FormData(),
|
|
3073
3158
|
arraySizeLimit =
|
|
3074
3159
|
4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 1e6,
|
|
3075
|
-
chunks = new Map()
|
|
3160
|
+
chunks = new Map(),
|
|
3161
|
+
backingStore = {
|
|
3162
|
+
prefix: formFieldPrefix,
|
|
3163
|
+
referencedEntries: null,
|
|
3164
|
+
keyPointer: 0,
|
|
3165
|
+
stringChunks: null,
|
|
3166
|
+
streamChunks: null,
|
|
3167
|
+
blobs: null
|
|
3168
|
+
};
|
|
3169
|
+
backingFormData.forEach(appendBackingEntry.bind(null, backingStore));
|
|
3076
3170
|
return {
|
|
3077
3171
|
_bundlerConfig: bundlerConfig,
|
|
3078
3172
|
_prefix: formFieldPrefix,
|
|
3079
|
-
_formData:
|
|
3173
|
+
_formData: backingStore,
|
|
3080
3174
|
_chunks: chunks,
|
|
3081
3175
|
_closed: !1,
|
|
3082
3176
|
_closedReason: null,
|
|
@@ -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];
|