react-server-dom-webpack 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-webpack-client.browser.development.js +66 -47
- package/cjs/react-server-dom-webpack-client.browser.production.js +84 -62
- package/cjs/react-server-dom-webpack-client.edge.development.js +74 -47
- package/cjs/react-server-dom-webpack-client.edge.production.js +94 -64
- package/cjs/react-server-dom-webpack-client.node.development.js +74 -47
- package/cjs/react-server-dom-webpack-client.node.production.js +94 -64
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +74 -47
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +94 -64
- 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 +213 -122
- package/cjs/react-server-dom-webpack-server.edge.production.js +210 -119
- 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/cjs/react-server-dom-webpack-server.node.unbundled.development.js +270 -161
- package/cjs/react-server-dom-webpack-server.node.unbundled.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];
|
|
@@ -2010,6 +2032,38 @@ __webpack_require__.u = function (chunkId) {
|
|
|
2010
2032
|
? flightChunk
|
|
2011
2033
|
: webpackGetChunkFilename(chunkId);
|
|
2012
2034
|
};
|
|
2035
|
+
function appendBackingEntry(backingStore, value, key) {
|
|
2036
|
+
var prefix = backingStore.prefix;
|
|
2037
|
+
if (key.startsWith(prefix)) {
|
|
2038
|
+
switch (key[prefix.length]) {
|
|
2039
|
+
case "_":
|
|
2040
|
+
prefix = backingStore.referencedEntries;
|
|
2041
|
+
null === prefix && (prefix = backingStore.referencedEntries = []);
|
|
2042
|
+
prefix.push([key, value]);
|
|
2043
|
+
return;
|
|
2044
|
+
case "S":
|
|
2045
|
+
"string" === typeof value &&
|
|
2046
|
+
((prefix = backingStore.streamChunks),
|
|
2047
|
+
null === prefix && (prefix = backingStore.streamChunks = new Map()),
|
|
2048
|
+
(backingStore = prefix.get(key)),
|
|
2049
|
+
void 0 === backingStore
|
|
2050
|
+
? prefix.set(key, [value])
|
|
2051
|
+
: backingStore.push(value));
|
|
2052
|
+
return;
|
|
2053
|
+
}
|
|
2054
|
+
"string" === typeof value
|
|
2055
|
+
? ((prefix = backingStore.stringChunks),
|
|
2056
|
+
null === prefix && (prefix = backingStore.stringChunks = new Map()),
|
|
2057
|
+
prefix.set(key, value))
|
|
2058
|
+
: ((prefix = backingStore.blobs),
|
|
2059
|
+
null === prefix && (prefix = backingStore.blobs = new Map()),
|
|
2060
|
+
prefix.set(key, value));
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
function getBackingBlob(backingStore, key) {
|
|
2064
|
+
backingStore = backingStore.blobs;
|
|
2065
|
+
return null === backingStore ? void 0 : backingStore.get(key);
|
|
2066
|
+
}
|
|
2013
2067
|
var RESPONSE_SYMBOL = Symbol();
|
|
2014
2068
|
function ReactPromise(status, value, reason) {
|
|
2015
2069
|
this.status = status;
|
|
@@ -2379,13 +2433,16 @@ function reportGlobalError(response, error) {
|
|
|
2379
2433
|
function getChunk(response, id) {
|
|
2380
2434
|
var chunks = response._chunks,
|
|
2381
2435
|
chunk = chunks.get(id);
|
|
2382
|
-
chunk
|
|
2383
|
-
|
|
2384
|
-
|
|
2436
|
+
if (!chunk) {
|
|
2437
|
+
chunk = response._prefix;
|
|
2438
|
+
var stringChunks = response._formData.stringChunks;
|
|
2439
|
+
chunk = null === stringChunks ? void 0 : stringChunks.get(chunk + id);
|
|
2440
|
+
chunk =
|
|
2385
2441
|
"string" === typeof chunk
|
|
2386
2442
|
? createResolvedModelChunk(response, chunk, id)
|
|
2387
|
-
: new ReactPromise("pending", null, null)
|
|
2388
|
-
chunks.set(id, chunk)
|
|
2443
|
+
: new ReactPromise("pending", null, null);
|
|
2444
|
+
chunks.set(id, chunk);
|
|
2445
|
+
}
|
|
2389
2446
|
return chunk;
|
|
2390
2447
|
}
|
|
2391
2448
|
function fulfillReference(response, reference, value, arrayRoot) {
|
|
@@ -2616,7 +2673,7 @@ function parseTypedArray(
|
|
|
2616
2673
|
Error("Already initialized typed array.")
|
|
2617
2674
|
)
|
|
2618
2675
|
);
|
|
2619
|
-
reference = response._formData
|
|
2676
|
+
reference = getBackingBlob(response._formData, key).arrayBuffer();
|
|
2620
2677
|
if (initializingHandler) {
|
|
2621
2678
|
var handler = initializingHandler;
|
|
2622
2679
|
handler.deps++;
|
|
@@ -2660,13 +2717,15 @@ function resolveStream(response, id, stream, controller) {
|
|
|
2660
2717
|
var chunks = response._chunks;
|
|
2661
2718
|
stream = new ReactPromise("fulfilled", stream, controller);
|
|
2662
2719
|
chunks.set(id, stream);
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2720
|
+
chunks = response._prefix;
|
|
2721
|
+
response = response._formData.streamChunks;
|
|
2722
|
+
id = null === response ? void 0 : response.get(chunks + "S" + id);
|
|
2723
|
+
if (void 0 !== id)
|
|
2724
|
+
for (response = 0; response < id.length; response++)
|
|
2725
|
+
(chunks = id[response]),
|
|
2726
|
+
"C" === chunks[0]
|
|
2668
2727
|
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
|
2669
|
-
: controller.enqueueModel(chunks)
|
|
2728
|
+
: controller.enqueueModel(chunks);
|
|
2670
2729
|
}
|
|
2671
2730
|
function parseReadableStream(response, reference, type) {
|
|
2672
2731
|
function enqueue(value) {
|
|
@@ -2832,7 +2891,14 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2832
2891
|
});
|
|
2833
2892
|
return iterator;
|
|
2834
2893
|
}
|
|
2835
|
-
function parseModelString(
|
|
2894
|
+
function parseModelString(
|
|
2895
|
+
response,
|
|
2896
|
+
obj,
|
|
2897
|
+
key$jscomp$0,
|
|
2898
|
+
value,
|
|
2899
|
+
reference,
|
|
2900
|
+
arrayRoot
|
|
2901
|
+
) {
|
|
2836
2902
|
if ("$" === value[0]) {
|
|
2837
2903
|
switch (value[1]) {
|
|
2838
2904
|
case "$":
|
|
@@ -2850,7 +2916,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2850
2916
|
response,
|
|
2851
2917
|
arrayRoot,
|
|
2852
2918
|
obj,
|
|
2853
|
-
key,
|
|
2919
|
+
key$jscomp$0,
|
|
2854
2920
|
null,
|
|
2855
2921
|
loadServerReference$1
|
|
2856
2922
|
)
|
|
@@ -2867,43 +2933,55 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2867
2933
|
case "Q":
|
|
2868
2934
|
return (
|
|
2869
2935
|
(arrayRoot = value.slice(2)),
|
|
2870
|
-
getOutlinedModel(
|
|
2936
|
+
getOutlinedModel(
|
|
2937
|
+
response,
|
|
2938
|
+
arrayRoot,
|
|
2939
|
+
obj,
|
|
2940
|
+
key$jscomp$0,
|
|
2941
|
+
null,
|
|
2942
|
+
createMap
|
|
2943
|
+
)
|
|
2871
2944
|
);
|
|
2872
2945
|
case "W":
|
|
2873
2946
|
return (
|
|
2874
2947
|
(arrayRoot = value.slice(2)),
|
|
2875
|
-
getOutlinedModel(
|
|
2948
|
+
getOutlinedModel(
|
|
2949
|
+
response,
|
|
2950
|
+
arrayRoot,
|
|
2951
|
+
obj,
|
|
2952
|
+
key$jscomp$0,
|
|
2953
|
+
null,
|
|
2954
|
+
createSet
|
|
2955
|
+
)
|
|
2876
2956
|
);
|
|
2877
2957
|
case "K":
|
|
2878
|
-
|
|
2879
|
-
obj = response._prefix + "_";
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
var referencedFormDataKey = value.slice(key.length), i = 0;
|
|
2893
|
-
i < reference.length;
|
|
2894
|
-
i++
|
|
2895
|
-
)
|
|
2896
|
-
arrayRoot.append(referencedFormDataKey, reference[i]);
|
|
2897
|
-
response.data.delete(value);
|
|
2898
|
-
response.keyPointer++;
|
|
2899
|
-
} else if (value.startsWith(obj)) break;
|
|
2900
|
-
else response.keyPointer++;
|
|
2958
|
+
obj = value.slice(2);
|
|
2959
|
+
obj = response._prefix + "_" + obj + "_";
|
|
2960
|
+
response = response._formData;
|
|
2961
|
+
key$jscomp$0 = new FormData();
|
|
2962
|
+
arrayRoot = response.referencedEntries;
|
|
2963
|
+
if (null !== arrayRoot) {
|
|
2964
|
+
for (value = response.keyPointer; value < arrayRoot.length; ) {
|
|
2965
|
+
reference = arrayRoot[value];
|
|
2966
|
+
var key = reference[0];
|
|
2967
|
+
if (!key.startsWith(obj)) break;
|
|
2968
|
+
key$jscomp$0.append(key.slice(obj.length), reference[1]);
|
|
2969
|
+
value++;
|
|
2970
|
+
}
|
|
2971
|
+
response.keyPointer = value;
|
|
2901
2972
|
}
|
|
2902
|
-
return
|
|
2973
|
+
return key$jscomp$0;
|
|
2903
2974
|
case "i":
|
|
2904
2975
|
return (
|
|
2905
2976
|
(arrayRoot = value.slice(2)),
|
|
2906
|
-
getOutlinedModel(
|
|
2977
|
+
getOutlinedModel(
|
|
2978
|
+
response,
|
|
2979
|
+
arrayRoot,
|
|
2980
|
+
obj,
|
|
2981
|
+
key$jscomp$0,
|
|
2982
|
+
null,
|
|
2983
|
+
extractIterator
|
|
2984
|
+
)
|
|
2907
2985
|
);
|
|
2908
2986
|
case "I":
|
|
2909
2987
|
return Infinity;
|
|
@@ -2934,7 +3012,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2934
3012
|
ArrayBuffer,
|
|
2935
3013
|
1,
|
|
2936
3014
|
obj,
|
|
2937
|
-
key,
|
|
3015
|
+
key$jscomp$0,
|
|
2938
3016
|
arrayRoot
|
|
2939
3017
|
);
|
|
2940
3018
|
case "O":
|
|
@@ -2944,7 +3022,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2944
3022
|
Int8Array,
|
|
2945
3023
|
1,
|
|
2946
3024
|
obj,
|
|
2947
|
-
key,
|
|
3025
|
+
key$jscomp$0,
|
|
2948
3026
|
arrayRoot
|
|
2949
3027
|
);
|
|
2950
3028
|
case "o":
|
|
@@ -2954,7 +3032,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2954
3032
|
Uint8Array,
|
|
2955
3033
|
1,
|
|
2956
3034
|
obj,
|
|
2957
|
-
key,
|
|
3035
|
+
key$jscomp$0,
|
|
2958
3036
|
arrayRoot
|
|
2959
3037
|
);
|
|
2960
3038
|
case "U":
|
|
@@ -2964,7 +3042,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2964
3042
|
Uint8ClampedArray,
|
|
2965
3043
|
1,
|
|
2966
3044
|
obj,
|
|
2967
|
-
key,
|
|
3045
|
+
key$jscomp$0,
|
|
2968
3046
|
arrayRoot
|
|
2969
3047
|
);
|
|
2970
3048
|
case "S":
|
|
@@ -2974,7 +3052,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2974
3052
|
Int16Array,
|
|
2975
3053
|
2,
|
|
2976
3054
|
obj,
|
|
2977
|
-
key,
|
|
3055
|
+
key$jscomp$0,
|
|
2978
3056
|
arrayRoot
|
|
2979
3057
|
);
|
|
2980
3058
|
case "s":
|
|
@@ -2984,7 +3062,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2984
3062
|
Uint16Array,
|
|
2985
3063
|
2,
|
|
2986
3064
|
obj,
|
|
2987
|
-
key,
|
|
3065
|
+
key$jscomp$0,
|
|
2988
3066
|
arrayRoot
|
|
2989
3067
|
);
|
|
2990
3068
|
case "L":
|
|
@@ -2994,7 +3072,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
2994
3072
|
Int32Array,
|
|
2995
3073
|
4,
|
|
2996
3074
|
obj,
|
|
2997
|
-
key,
|
|
3075
|
+
key$jscomp$0,
|
|
2998
3076
|
arrayRoot
|
|
2999
3077
|
);
|
|
3000
3078
|
case "l":
|
|
@@ -3004,7 +3082,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3004
3082
|
Uint32Array,
|
|
3005
3083
|
4,
|
|
3006
3084
|
obj,
|
|
3007
|
-
key,
|
|
3085
|
+
key$jscomp$0,
|
|
3008
3086
|
arrayRoot
|
|
3009
3087
|
);
|
|
3010
3088
|
case "G":
|
|
@@ -3014,7 +3092,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3014
3092
|
Float32Array,
|
|
3015
3093
|
4,
|
|
3016
3094
|
obj,
|
|
3017
|
-
key,
|
|
3095
|
+
key$jscomp$0,
|
|
3018
3096
|
arrayRoot
|
|
3019
3097
|
);
|
|
3020
3098
|
case "g":
|
|
@@ -3024,7 +3102,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3024
3102
|
Float64Array,
|
|
3025
3103
|
8,
|
|
3026
3104
|
obj,
|
|
3027
|
-
key,
|
|
3105
|
+
key$jscomp$0,
|
|
3028
3106
|
arrayRoot
|
|
3029
3107
|
);
|
|
3030
3108
|
case "M":
|
|
@@ -3034,7 +3112,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3034
3112
|
BigInt64Array,
|
|
3035
3113
|
8,
|
|
3036
3114
|
obj,
|
|
3037
|
-
key,
|
|
3115
|
+
key$jscomp$0,
|
|
3038
3116
|
arrayRoot
|
|
3039
3117
|
);
|
|
3040
3118
|
case "m":
|
|
@@ -3044,7 +3122,7 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3044
3122
|
BigUint64Array,
|
|
3045
3123
|
8,
|
|
3046
3124
|
obj,
|
|
3047
|
-
key,
|
|
3125
|
+
key$jscomp$0,
|
|
3048
3126
|
arrayRoot
|
|
3049
3127
|
);
|
|
3050
3128
|
case "V":
|
|
@@ -3054,13 +3132,13 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3054
3132
|
DataView,
|
|
3055
3133
|
1,
|
|
3056
3134
|
obj,
|
|
3057
|
-
key,
|
|
3135
|
+
key$jscomp$0,
|
|
3058
3136
|
arrayRoot
|
|
3059
3137
|
);
|
|
3060
3138
|
case "B":
|
|
3061
3139
|
return (
|
|
3062
3140
|
(obj = parseInt(value.slice(2), 16)),
|
|
3063
|
-
response._formData
|
|
3141
|
+
getBackingBlob(response._formData, response._prefix + obj)
|
|
3064
3142
|
);
|
|
3065
3143
|
}
|
|
3066
3144
|
switch (value[1]) {
|
|
@@ -3074,7 +3152,14 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3074
3152
|
return parseAsyncIterable(response, value, !0);
|
|
3075
3153
|
}
|
|
3076
3154
|
value = value.slice(1);
|
|
3077
|
-
return getOutlinedModel(
|
|
3155
|
+
return getOutlinedModel(
|
|
3156
|
+
response,
|
|
3157
|
+
value,
|
|
3158
|
+
obj,
|
|
3159
|
+
key$jscomp$0,
|
|
3160
|
+
arrayRoot,
|
|
3161
|
+
createModel
|
|
3162
|
+
);
|
|
3078
3163
|
}
|
|
3079
3164
|
null !== arrayRoot && bumpArrayCount(arrayRoot, value.length, response);
|
|
3080
3165
|
return value;
|
|
@@ -3086,11 +3171,20 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
3086
3171
|
: new FormData(),
|
|
3087
3172
|
arraySizeLimit =
|
|
3088
3173
|
4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 1e6,
|
|
3089
|
-
chunks = new Map()
|
|
3174
|
+
chunks = new Map(),
|
|
3175
|
+
backingStore = {
|
|
3176
|
+
prefix: formFieldPrefix,
|
|
3177
|
+
referencedEntries: null,
|
|
3178
|
+
keyPointer: 0,
|
|
3179
|
+
stringChunks: null,
|
|
3180
|
+
streamChunks: null,
|
|
3181
|
+
blobs: null
|
|
3182
|
+
};
|
|
3183
|
+
backingFormData.forEach(appendBackingEntry.bind(null, backingStore));
|
|
3090
3184
|
return {
|
|
3091
3185
|
_bundlerConfig: bundlerConfig,
|
|
3092
3186
|
_prefix: formFieldPrefix,
|
|
3093
|
-
_formData:
|
|
3187
|
+
_formData: backingStore,
|
|
3094
3188
|
_chunks: chunks,
|
|
3095
3189
|
_temporaryReferences: temporaryReferences,
|
|
3096
3190
|
_rootArrayContexts: new WeakMap(),
|
|
@@ -3152,44 +3246,41 @@ exports.createTemporaryReferenceSet = function () {
|
|
|
3152
3246
|
};
|
|
3153
3247
|
exports.decodeAction = function (body, serverManifest) {
|
|
3154
3248
|
var formData = new FormData(),
|
|
3155
|
-
|
|
3156
|
-
seenActions = new Set();
|
|
3249
|
+
maybeActionKey = null;
|
|
3157
3250
|
body.forEach(function (value, key) {
|
|
3158
3251
|
key.startsWith("$ACTION_")
|
|
3159
3252
|
? key.startsWith("$ACTION_REF_")
|
|
3160
|
-
?
|
|
3161
|
-
|
|
3162
|
-
(value = "$ACTION_" + key.slice(12) + ":"),
|
|
3163
|
-
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
|
3164
|
-
(action = loadServerReference(serverManifest, value)))
|
|
3165
|
-
: key.startsWith("$ACTION_ID_") &&
|
|
3166
|
-
!seenActions.has(key) &&
|
|
3167
|
-
(seenActions.add(key),
|
|
3168
|
-
(value = key.slice(11)),
|
|
3169
|
-
(action = loadServerReference(serverManifest, {
|
|
3170
|
-
id: value,
|
|
3171
|
-
bound: null
|
|
3172
|
-
})))
|
|
3253
|
+
? (maybeActionKey = key)
|
|
3254
|
+
: key.startsWith("$ACTION_ID_") && (maybeActionKey = key)
|
|
3173
3255
|
: formData.append(key, value);
|
|
3174
3256
|
});
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3257
|
+
if (null === maybeActionKey) return null;
|
|
3258
|
+
var actionKey = maybeActionKey,
|
|
3259
|
+
action = null;
|
|
3260
|
+
if (actionKey.startsWith("$ACTION_REF_"))
|
|
3261
|
+
(actionKey = "$ACTION_" + actionKey.slice(12) + ":"),
|
|
3262
|
+
(body = decodeBoundActionMetaData(body, serverManifest, actionKey)),
|
|
3263
|
+
(action = loadServerReference(serverManifest, body));
|
|
3264
|
+
else if (actionKey.startsWith("$ACTION_ID_"))
|
|
3265
|
+
(body = actionKey.slice(11)),
|
|
3266
|
+
(action = loadServerReference(serverManifest, { id: body, bound: null }));
|
|
3267
|
+
else throw Error("Cannot handle action key. This is a bug in React.");
|
|
3268
|
+
return action.then(function (fn) {
|
|
3269
|
+
return fn.bind(null, formData);
|
|
3270
|
+
});
|
|
3180
3271
|
};
|
|
3181
3272
|
exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
3182
3273
|
var keyPath = body.get("$ACTION_KEY");
|
|
3183
3274
|
if ("string" !== typeof keyPath) return Promise.resolve(null);
|
|
3184
|
-
var
|
|
3275
|
+
var actionKey = null;
|
|
3185
3276
|
body.forEach(function (value, key) {
|
|
3186
|
-
key.startsWith("$ACTION_REF_") &&
|
|
3187
|
-
((value = "$ACTION_" + key.slice(12) + ":"),
|
|
3188
|
-
(metaData = decodeBoundActionMetaData(body, serverManifest, value)));
|
|
3277
|
+
key.startsWith("$ACTION_REF_") && (actionKey = key);
|
|
3189
3278
|
});
|
|
3190
|
-
if (null ===
|
|
3191
|
-
var
|
|
3192
|
-
|
|
3279
|
+
if (null === actionKey) return Promise.resolve(null);
|
|
3280
|
+
var formFieldPrefix = "$ACTION_" + actionKey.slice(12) + ":";
|
|
3281
|
+
body = decodeBoundActionMetaData(body, serverManifest, formFieldPrefix);
|
|
3282
|
+
var referenceId = body.id;
|
|
3283
|
+
return Promise.resolve(body.bound).then(function (bound) {
|
|
3193
3284
|
return null === bound
|
|
3194
3285
|
? null
|
|
3195
3286
|
: [actionResult, keyPath, referenceId, bound.length - 1];
|