react-server-dom-turbopack 19.0.3 → 19.0.5
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 +94 -76
- package/cjs/react-server-dom-turbopack-client.browser.production.js +63 -51
- package/cjs/react-server-dom-turbopack-client.edge.development.js +92 -74
- package/cjs/react-server-dom-turbopack-client.edge.production.js +63 -51
- package/cjs/react-server-dom-turbopack-client.node.development.js +92 -74
- package/cjs/react-server-dom-turbopack-client.node.production.js +63 -51
- package/cjs/react-server-dom-turbopack-server.browser.development.js +619 -343
- package/cjs/react-server-dom-turbopack-server.browser.production.js +592 -307
- package/cjs/react-server-dom-turbopack-server.edge.development.js +619 -343
- package/cjs/react-server-dom-turbopack-server.edge.production.js +592 -307
- package/cjs/react-server-dom-turbopack-server.node.development.js +625 -347
- package/cjs/react-server-dom-turbopack-server.node.production.js +598 -311
- package/package.json +3 -3
|
@@ -710,7 +710,7 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
|
710
710
|
"\n " + str + "\n " + objectOrArray)
|
|
711
711
|
: "\n " + str;
|
|
712
712
|
}
|
|
713
|
-
var ObjectPrototype = Object.prototype,
|
|
713
|
+
var ObjectPrototype$1 = Object.prototype,
|
|
714
714
|
stringify = JSON.stringify;
|
|
715
715
|
function defaultErrorHandler(error) {
|
|
716
716
|
console.error(error);
|
|
@@ -1529,7 +1529,7 @@ function renderModelDestructive(
|
|
|
1529
1529
|
if (value instanceof Date) return "$D" + value.toJSON();
|
|
1530
1530
|
request = getPrototypeOf(value);
|
|
1531
1531
|
if (
|
|
1532
|
-
request !== ObjectPrototype &&
|
|
1532
|
+
request !== ObjectPrototype$1 &&
|
|
1533
1533
|
(null === request || null !== getPrototypeOf(request))
|
|
1534
1534
|
)
|
|
1535
1535
|
throw Error(
|
|
@@ -2014,16 +2014,23 @@ ReactPromise.prototype.then = function (resolve, reject) {
|
|
|
2014
2014
|
case "fulfilled":
|
|
2015
2015
|
if ("function" === typeof resolve) {
|
|
2016
2016
|
for (
|
|
2017
|
-
var inspectedValue = this.value,
|
|
2017
|
+
var inspectedValue = this.value,
|
|
2018
|
+
cycleProtection = 0,
|
|
2019
|
+
visited = new Set();
|
|
2018
2020
|
inspectedValue instanceof ReactPromise;
|
|
2019
2021
|
|
|
2020
2022
|
) {
|
|
2021
2023
|
cycleProtection++;
|
|
2022
|
-
if (
|
|
2024
|
+
if (
|
|
2025
|
+
inspectedValue === this ||
|
|
2026
|
+
visited.has(inspectedValue) ||
|
|
2027
|
+
1e3 < cycleProtection
|
|
2028
|
+
) {
|
|
2023
2029
|
"function" === typeof reject &&
|
|
2024
2030
|
reject(Error("Cannot have cyclic thenables."));
|
|
2025
2031
|
return;
|
|
2026
2032
|
}
|
|
2033
|
+
visited.add(inspectedValue);
|
|
2027
2034
|
if ("fulfilled" === inspectedValue.status)
|
|
2028
2035
|
inspectedValue = inspectedValue.value;
|
|
2029
2036
|
else break;
|
|
@@ -2042,12 +2049,14 @@ ReactPromise.prototype.then = function (resolve, reject) {
|
|
|
2042
2049
|
"function" === typeof reject && reject(this.reason);
|
|
2043
2050
|
}
|
|
2044
2051
|
};
|
|
2045
|
-
|
|
2052
|
+
var ObjectPrototype = Object.prototype,
|
|
2053
|
+
ArrayPrototype = Array.prototype;
|
|
2054
|
+
function wakeChunk(response, listeners, value, chunk) {
|
|
2046
2055
|
for (var i = 0; i < listeners.length; i++) {
|
|
2047
2056
|
var listener = listeners[i];
|
|
2048
2057
|
"function" === typeof listener
|
|
2049
2058
|
? listener(value)
|
|
2050
|
-
: fulfillReference(response, listener, value);
|
|
2059
|
+
: fulfillReference(response, listener, value, chunk.reason);
|
|
2051
2060
|
}
|
|
2052
2061
|
}
|
|
2053
2062
|
function rejectChunk(response, listeners, error) {
|
|
@@ -2058,27 +2067,6 @@ function rejectChunk(response, listeners, error) {
|
|
|
2058
2067
|
: rejectReference(response, listener.handler, error);
|
|
2059
2068
|
}
|
|
2060
2069
|
}
|
|
2061
|
-
function resolveBlockedCycle(resolvedChunk, reference) {
|
|
2062
|
-
var referencedChunk = reference.handler.chunk;
|
|
2063
|
-
if (null === referencedChunk) return null;
|
|
2064
|
-
if (referencedChunk === resolvedChunk) return reference.handler;
|
|
2065
|
-
reference = referencedChunk.value;
|
|
2066
|
-
if (null !== reference)
|
|
2067
|
-
for (
|
|
2068
|
-
referencedChunk = 0;
|
|
2069
|
-
referencedChunk < reference.length;
|
|
2070
|
-
referencedChunk++
|
|
2071
|
-
) {
|
|
2072
|
-
var listener = reference[referencedChunk];
|
|
2073
|
-
if (
|
|
2074
|
-
"function" !== typeof listener &&
|
|
2075
|
-
((listener = resolveBlockedCycle(resolvedChunk, listener)),
|
|
2076
|
-
null !== listener)
|
|
2077
|
-
)
|
|
2078
|
-
return listener;
|
|
2079
|
-
}
|
|
2080
|
-
return null;
|
|
2081
|
-
}
|
|
2082
2070
|
function triggerErrorOnChunk(response, chunk, error) {
|
|
2083
2071
|
if ("pending" !== chunk.status && "blocked" !== chunk.status)
|
|
2084
2072
|
chunk.reason.error(error);
|
|
@@ -2114,33 +2102,11 @@ function resolveModelChunk(response, chunk, value, id) {
|
|
|
2114
2102
|
chunk.reason =
|
|
2115
2103
|
((value.id = id), (value[RESPONSE_SYMBOL] = response), value);
|
|
2116
2104
|
if (null !== resolveListeners)
|
|
2117
|
-
|
|
2105
|
+
switch ((initializeModelChunk(chunk), chunk.status)) {
|
|
2118
2106
|
case "fulfilled":
|
|
2119
|
-
wakeChunk(response, resolveListeners, chunk.value);
|
|
2107
|
+
wakeChunk(response, resolveListeners, chunk.value, chunk);
|
|
2120
2108
|
break;
|
|
2121
2109
|
case "blocked":
|
|
2122
|
-
for (value = 0; value < resolveListeners.length; value++)
|
|
2123
|
-
if (((id = resolveListeners[value]), "function" !== typeof id)) {
|
|
2124
|
-
var cyclicHandler = resolveBlockedCycle(chunk, id);
|
|
2125
|
-
if (null !== cyclicHandler)
|
|
2126
|
-
switch (
|
|
2127
|
-
(fulfillReference(response, id, cyclicHandler.value),
|
|
2128
|
-
resolveListeners.splice(value, 1),
|
|
2129
|
-
value--,
|
|
2130
|
-
null !== rejectListeners &&
|
|
2131
|
-
((id = rejectListeners.indexOf(id)),
|
|
2132
|
-
-1 !== id && rejectListeners.splice(id, 1)),
|
|
2133
|
-
chunk.status)
|
|
2134
|
-
) {
|
|
2135
|
-
case "fulfilled":
|
|
2136
|
-
wakeChunk(response, resolveListeners, chunk.value);
|
|
2137
|
-
break a;
|
|
2138
|
-
case "rejected":
|
|
2139
|
-
null !== rejectListeners &&
|
|
2140
|
-
rejectChunk(response, rejectListeners, chunk.reason);
|
|
2141
|
-
break a;
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
2110
|
case "pending":
|
|
2145
2111
|
if (chunk.value)
|
|
2146
2112
|
for (response = 0; response < resolveListeners.length; response++)
|
|
@@ -2157,7 +2123,8 @@ function resolveModelChunk(response, chunk, value, id) {
|
|
|
2157
2123
|
} else chunk.reason = rejectListeners;
|
|
2158
2124
|
break;
|
|
2159
2125
|
case "rejected":
|
|
2160
|
-
rejectListeners &&
|
|
2126
|
+
rejectListeners &&
|
|
2127
|
+
rejectChunk(response, rejectListeners, chunk.reason);
|
|
2161
2128
|
}
|
|
2162
2129
|
}
|
|
2163
2130
|
}
|
|
@@ -2180,15 +2147,50 @@ function resolveIteratorResultChunk(response, chunk, value, done) {
|
|
|
2180
2147
|
);
|
|
2181
2148
|
}
|
|
2182
2149
|
function loadServerReference$1(response, metaData, parentObject, key) {
|
|
2150
|
+
function reject(error) {
|
|
2151
|
+
var rejectListeners = blockedPromise.reason,
|
|
2152
|
+
erroredPromise = blockedPromise;
|
|
2153
|
+
erroredPromise.status = "rejected";
|
|
2154
|
+
erroredPromise.value = null;
|
|
2155
|
+
erroredPromise.reason = error;
|
|
2156
|
+
null !== rejectListeners && rejectChunk(response, rejectListeners, error);
|
|
2157
|
+
rejectReference(response, handler, error);
|
|
2158
|
+
}
|
|
2183
2159
|
var id = metaData.id;
|
|
2184
2160
|
if ("string" !== typeof id || "then" === key) return null;
|
|
2161
|
+
var cachedPromise = metaData.$$promise;
|
|
2162
|
+
if (void 0 !== cachedPromise) {
|
|
2163
|
+
if ("fulfilled" === cachedPromise.status)
|
|
2164
|
+
return (
|
|
2165
|
+
(cachedPromise = cachedPromise.value),
|
|
2166
|
+
"__proto__" === key ? null : (parentObject[key] = cachedPromise)
|
|
2167
|
+
);
|
|
2168
|
+
initializingHandler
|
|
2169
|
+
? ((id = initializingHandler), id.deps++)
|
|
2170
|
+
: (id = initializingHandler =
|
|
2171
|
+
{ chunk: null, value: null, reason: null, deps: 1, errored: !1 });
|
|
2172
|
+
cachedPromise.then(
|
|
2173
|
+
resolveReference.bind(null, response, id, parentObject, key),
|
|
2174
|
+
rejectReference.bind(null, response, id)
|
|
2175
|
+
);
|
|
2176
|
+
return null;
|
|
2177
|
+
}
|
|
2178
|
+
var blockedPromise = new ReactPromise("blocked", null, null);
|
|
2179
|
+
metaData.$$promise = blockedPromise;
|
|
2185
2180
|
var serverReference = resolveServerReference(response._bundlerConfig, id);
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
else if (
|
|
2191
|
-
|
|
2181
|
+
cachedPromise = metaData.bound;
|
|
2182
|
+
if ((id = preloadModule(serverReference)))
|
|
2183
|
+
cachedPromise instanceof ReactPromise &&
|
|
2184
|
+
(id = Promise.all([id, cachedPromise]));
|
|
2185
|
+
else if (cachedPromise instanceof ReactPromise)
|
|
2186
|
+
id = Promise.resolve(cachedPromise);
|
|
2187
|
+
else
|
|
2188
|
+
return (
|
|
2189
|
+
(cachedPromise = requireModule(serverReference)),
|
|
2190
|
+
(id = blockedPromise),
|
|
2191
|
+
(id.status = "fulfilled"),
|
|
2192
|
+
(id.value = cachedPromise)
|
|
2193
|
+
);
|
|
2192
2194
|
if (initializingHandler) {
|
|
2193
2195
|
var handler = initializingHandler;
|
|
2194
2196
|
handler.deps++;
|
|
@@ -2200,74 +2202,105 @@ function loadServerReference$1(response, metaData, parentObject, key) {
|
|
|
2200
2202
|
deps: 1,
|
|
2201
2203
|
errored: !1
|
|
2202
2204
|
};
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
null !== resolvedValue &&
|
|
2218
|
-
"blocked" === resolvedValue.status &&
|
|
2219
|
-
((promiseValue = resolvedValue.value),
|
|
2220
|
-
(resolvedValue.status = "fulfilled"),
|
|
2221
|
-
(resolvedValue.value = handler.value),
|
|
2222
|
-
(resolvedValue.reason = null),
|
|
2223
|
-
null !== promiseValue &&
|
|
2224
|
-
wakeChunk(response, promiseValue, handler.value)));
|
|
2225
|
-
},
|
|
2226
|
-
function (error) {
|
|
2227
|
-
if (!handler.errored) {
|
|
2228
|
-
handler.errored = !0;
|
|
2229
|
-
handler.value = null;
|
|
2230
|
-
handler.reason = error;
|
|
2231
|
-
var chunk = handler.chunk;
|
|
2232
|
-
null !== chunk &&
|
|
2233
|
-
"blocked" === chunk.status &&
|
|
2234
|
-
triggerErrorOnChunk(response, chunk, error);
|
|
2205
|
+
id.then(function () {
|
|
2206
|
+
var resolvedValue = requireModule(serverReference);
|
|
2207
|
+
if (metaData.bound) {
|
|
2208
|
+
var promiseValue = metaData.bound.value;
|
|
2209
|
+
promiseValue = isArrayImpl(promiseValue) ? promiseValue.slice(0) : [];
|
|
2210
|
+
if (1e3 < promiseValue.length) {
|
|
2211
|
+
reject(
|
|
2212
|
+
Error(
|
|
2213
|
+
"Server Function has too many bound arguments. Received " +
|
|
2214
|
+
promiseValue.length +
|
|
2215
|
+
" but the limit is 1000."
|
|
2216
|
+
)
|
|
2217
|
+
);
|
|
2218
|
+
return;
|
|
2235
2219
|
}
|
|
2220
|
+
promiseValue.unshift(null);
|
|
2221
|
+
resolvedValue = resolvedValue.bind.apply(resolvedValue, promiseValue);
|
|
2236
2222
|
}
|
|
2237
|
-
|
|
2223
|
+
promiseValue = blockedPromise.value;
|
|
2224
|
+
var initializedPromise = blockedPromise;
|
|
2225
|
+
initializedPromise.status = "fulfilled";
|
|
2226
|
+
initializedPromise.value = resolvedValue;
|
|
2227
|
+
initializedPromise.reason = null;
|
|
2228
|
+
null !== promiseValue &&
|
|
2229
|
+
wakeChunk(response, promiseValue, resolvedValue, initializedPromise);
|
|
2230
|
+
resolveReference(response, handler, parentObject, key, resolvedValue);
|
|
2231
|
+
}, reject);
|
|
2238
2232
|
return null;
|
|
2239
2233
|
}
|
|
2240
|
-
function reviveModel(
|
|
2234
|
+
function reviveModel(
|
|
2235
|
+
response,
|
|
2236
|
+
parentObj,
|
|
2237
|
+
parentKey,
|
|
2238
|
+
value,
|
|
2239
|
+
reference,
|
|
2240
|
+
arrayRoot
|
|
2241
|
+
) {
|
|
2241
2242
|
if ("string" === typeof value)
|
|
2242
|
-
return parseModelString(
|
|
2243
|
+
return parseModelString(
|
|
2244
|
+
response,
|
|
2245
|
+
parentObj,
|
|
2246
|
+
parentKey,
|
|
2247
|
+
value,
|
|
2248
|
+
reference,
|
|
2249
|
+
arrayRoot
|
|
2250
|
+
);
|
|
2243
2251
|
if ("object" === typeof value && null !== value)
|
|
2244
2252
|
if (
|
|
2245
2253
|
(void 0 !== reference &&
|
|
2246
2254
|
void 0 !== response._temporaryReferences &&
|
|
2247
2255
|
response._temporaryReferences.set(value, reference),
|
|
2248
|
-
|
|
2249
|
-
)
|
|
2250
|
-
|
|
2251
|
-
|
|
2256
|
+
isArrayImpl(value))
|
|
2257
|
+
) {
|
|
2258
|
+
if (null === arrayRoot) {
|
|
2259
|
+
var childContext = { count: 0, fork: !1 };
|
|
2260
|
+
response._rootArrayContexts.set(value, childContext);
|
|
2261
|
+
} else childContext = arrayRoot;
|
|
2262
|
+
1 < value.length && (childContext.fork = !0);
|
|
2263
|
+
bumpArrayCount(childContext, value.length + 1, response);
|
|
2264
|
+
for (parentObj = 0; parentObj < value.length; parentObj++)
|
|
2265
|
+
value[parentObj] = reviveModel(
|
|
2252
2266
|
response,
|
|
2253
2267
|
value,
|
|
2254
|
-
"" +
|
|
2255
|
-
value[
|
|
2256
|
-
void 0 !== reference ? reference + ":" +
|
|
2268
|
+
"" + parentObj,
|
|
2269
|
+
value[parentObj],
|
|
2270
|
+
void 0 !== reference ? reference + ":" + parentObj : void 0,
|
|
2271
|
+
childContext
|
|
2257
2272
|
);
|
|
2258
|
-
else
|
|
2259
|
-
for (
|
|
2260
|
-
hasOwnProperty.call(value,
|
|
2261
|
-
(
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2273
|
+
} else
|
|
2274
|
+
for (childContext in value)
|
|
2275
|
+
hasOwnProperty.call(value, childContext) &&
|
|
2276
|
+
("__proto__" === childContext
|
|
2277
|
+
? delete value[childContext]
|
|
2278
|
+
: ((parentObj =
|
|
2279
|
+
void 0 !== reference && -1 === childContext.indexOf(":")
|
|
2280
|
+
? reference + ":" + childContext
|
|
2281
|
+
: void 0),
|
|
2282
|
+
(parentObj = reviveModel(
|
|
2283
|
+
response,
|
|
2284
|
+
value,
|
|
2285
|
+
childContext,
|
|
2286
|
+
value[childContext],
|
|
2287
|
+
parentObj,
|
|
2288
|
+
null
|
|
2289
|
+
)),
|
|
2290
|
+
void 0 !== parentObj
|
|
2291
|
+
? (value[childContext] = parentObj)
|
|
2292
|
+
: delete value[childContext]));
|
|
2269
2293
|
return value;
|
|
2270
2294
|
}
|
|
2295
|
+
function bumpArrayCount(arrayContext, slots, response) {
|
|
2296
|
+
if (
|
|
2297
|
+
(arrayContext.count += slots) > response._arraySizeLimit &&
|
|
2298
|
+
arrayContext.fork
|
|
2299
|
+
)
|
|
2300
|
+
throw Error(
|
|
2301
|
+
"Maximum array nesting exceeded. Large nested arrays can be dangerous. Try adding intermediate objects."
|
|
2302
|
+
);
|
|
2303
|
+
}
|
|
2271
2304
|
var initializingHandler = null;
|
|
2272
2305
|
function initializeModelChunk(chunk) {
|
|
2273
2306
|
var prevHandler = initializingHandler;
|
|
@@ -2281,13 +2314,15 @@ function initializeModelChunk(chunk) {
|
|
|
2281
2314
|
chunk.value = null;
|
|
2282
2315
|
chunk.reason = null;
|
|
2283
2316
|
try {
|
|
2284
|
-
var rawModel = JSON.parse(resolvedModel)
|
|
2285
|
-
|
|
2317
|
+
var rawModel = JSON.parse(resolvedModel);
|
|
2318
|
+
resolvedModel = { count: 0, fork: !1 };
|
|
2319
|
+
var value = reviveModel(
|
|
2286
2320
|
response,
|
|
2287
2321
|
{ "": rawModel },
|
|
2288
2322
|
"",
|
|
2289
2323
|
rawModel,
|
|
2290
|
-
_chunk$reason
|
|
2324
|
+
_chunk$reason,
|
|
2325
|
+
resolvedModel
|
|
2291
2326
|
),
|
|
2292
2327
|
resolveListeners = chunk.value;
|
|
2293
2328
|
if (null !== resolveListeners)
|
|
@@ -2299,19 +2334,20 @@ function initializeModelChunk(chunk) {
|
|
|
2299
2334
|
var listener = resolveListeners[rawModel];
|
|
2300
2335
|
"function" === typeof listener
|
|
2301
2336
|
? listener(value)
|
|
2302
|
-
: fulfillReference(response, listener, value);
|
|
2337
|
+
: fulfillReference(response, listener, value, resolvedModel);
|
|
2303
2338
|
}
|
|
2304
2339
|
if (null !== initializingHandler) {
|
|
2305
2340
|
if (initializingHandler.errored) throw initializingHandler.reason;
|
|
2306
2341
|
if (0 < initializingHandler.deps) {
|
|
2307
2342
|
initializingHandler.value = value;
|
|
2343
|
+
initializingHandler.reason = resolvedModel;
|
|
2308
2344
|
initializingHandler.chunk = chunk;
|
|
2309
2345
|
return;
|
|
2310
2346
|
}
|
|
2311
2347
|
}
|
|
2312
2348
|
chunk.status = "fulfilled";
|
|
2313
2349
|
chunk.value = value;
|
|
2314
|
-
chunk.reason =
|
|
2350
|
+
chunk.reason = resolvedModel;
|
|
2315
2351
|
} catch (error) {
|
|
2316
2352
|
(chunk.status = "rejected"), (chunk.reason = error);
|
|
2317
2353
|
} finally {
|
|
@@ -2324,7 +2360,8 @@ function reportGlobalError(response, error) {
|
|
|
2324
2360
|
? triggerErrorOnChunk(response, chunk, error)
|
|
2325
2361
|
: "fulfilled" === chunk.status &&
|
|
2326
2362
|
null !== chunk.reason &&
|
|
2327
|
-
chunk.reason
|
|
2363
|
+
((chunk = chunk.reason),
|
|
2364
|
+
"function" === typeof chunk.error && chunk.error(error));
|
|
2328
2365
|
});
|
|
2329
2366
|
}
|
|
2330
2367
|
function getChunk(response, id) {
|
|
@@ -2339,40 +2376,67 @@ function getChunk(response, id) {
|
|
|
2339
2376
|
chunks.set(id, chunk));
|
|
2340
2377
|
return chunk;
|
|
2341
2378
|
}
|
|
2342
|
-
function fulfillReference(response, reference, value) {
|
|
2379
|
+
function fulfillReference(response, reference, value, arrayRoot) {
|
|
2343
2380
|
var handler = reference.handler,
|
|
2344
2381
|
parentObject = reference.parentObject,
|
|
2345
2382
|
key = reference.key,
|
|
2346
2383
|
map = reference.map,
|
|
2347
2384
|
path = reference.path;
|
|
2348
2385
|
try {
|
|
2349
|
-
for (
|
|
2386
|
+
for (
|
|
2387
|
+
var localLength = 0,
|
|
2388
|
+
rootArrayContexts = response._rootArrayContexts,
|
|
2389
|
+
i = 1;
|
|
2390
|
+
i < path.length;
|
|
2391
|
+
i++
|
|
2392
|
+
) {
|
|
2350
2393
|
var name = path[i];
|
|
2351
2394
|
if (
|
|
2352
2395
|
"object" !== typeof value ||
|
|
2353
|
-
|
|
2354
|
-
value
|
|
2396
|
+
null === value ||
|
|
2397
|
+
(getPrototypeOf(value) !== ObjectPrototype &&
|
|
2398
|
+
getPrototypeOf(value) !== ArrayPrototype) ||
|
|
2399
|
+
!hasOwnProperty.call(value, name)
|
|
2355
2400
|
)
|
|
2356
2401
|
throw Error("Invalid reference.");
|
|
2357
2402
|
value = value[name];
|
|
2403
|
+
if (isArrayImpl(value))
|
|
2404
|
+
(localLength = 0),
|
|
2405
|
+
(arrayRoot = rootArrayContexts.get(value) || arrayRoot);
|
|
2406
|
+
else if (((arrayRoot = null), "string" === typeof value))
|
|
2407
|
+
localLength = value.length;
|
|
2408
|
+
else if ("bigint" === typeof value) {
|
|
2409
|
+
var n = Math.abs(Number(value));
|
|
2410
|
+
localLength = 0 === n ? 1 : Math.floor(Math.log10(n)) + 1;
|
|
2411
|
+
} else localLength = ArrayBuffer.isView(value) ? value.byteLength : 0;
|
|
2358
2412
|
}
|
|
2359
|
-
var
|
|
2360
|
-
|
|
2361
|
-
|
|
2413
|
+
var resolvedValue = map(response, value, parentObject, key);
|
|
2414
|
+
var referenceArrayRoot = reference.arrayRoot;
|
|
2415
|
+
null !== referenceArrayRoot &&
|
|
2416
|
+
(null !== arrayRoot
|
|
2417
|
+
? (arrayRoot.fork && (referenceArrayRoot.fork = !0),
|
|
2418
|
+
bumpArrayCount(referenceArrayRoot, arrayRoot.count, response))
|
|
2419
|
+
: 0 < localLength &&
|
|
2420
|
+
bumpArrayCount(referenceArrayRoot, localLength, response));
|
|
2362
2421
|
} catch (error) {
|
|
2363
|
-
rejectReference(response,
|
|
2422
|
+
rejectReference(response, handler, error);
|
|
2364
2423
|
return;
|
|
2365
2424
|
}
|
|
2425
|
+
resolveReference(response, handler, parentObject, key, resolvedValue);
|
|
2426
|
+
}
|
|
2427
|
+
function resolveReference(response, handler, parentObject, key, resolvedValue) {
|
|
2428
|
+
"__proto__" !== key && (parentObject[key] = resolvedValue);
|
|
2429
|
+
"" === key && null === handler.value && (handler.value = resolvedValue);
|
|
2366
2430
|
handler.deps--;
|
|
2367
2431
|
0 === handler.deps &&
|
|
2368
|
-
((
|
|
2369
|
-
null !==
|
|
2370
|
-
"blocked" ===
|
|
2371
|
-
((
|
|
2372
|
-
(
|
|
2373
|
-
(
|
|
2374
|
-
(
|
|
2375
|
-
null !==
|
|
2432
|
+
((parentObject = handler.chunk),
|
|
2433
|
+
null !== parentObject &&
|
|
2434
|
+
"blocked" === parentObject.status &&
|
|
2435
|
+
((key = parentObject.value),
|
|
2436
|
+
(parentObject.status = "fulfilled"),
|
|
2437
|
+
(parentObject.value = handler.value),
|
|
2438
|
+
(parentObject.reason = handler.reason),
|
|
2439
|
+
null !== key && wakeChunk(response, key, handler.value, parentObject)));
|
|
2376
2440
|
}
|
|
2377
2441
|
function rejectReference(response, handler, error) {
|
|
2378
2442
|
handler.errored ||
|
|
@@ -2384,60 +2448,97 @@ function rejectReference(response, handler, error) {
|
|
|
2384
2448
|
"blocked" === handler.status &&
|
|
2385
2449
|
triggerErrorOnChunk(response, handler, error));
|
|
2386
2450
|
}
|
|
2387
|
-
function getOutlinedModel(
|
|
2451
|
+
function getOutlinedModel(
|
|
2452
|
+
response,
|
|
2453
|
+
reference,
|
|
2454
|
+
parentObject,
|
|
2455
|
+
key,
|
|
2456
|
+
referenceArrayRoot,
|
|
2457
|
+
map
|
|
2458
|
+
) {
|
|
2388
2459
|
reference = reference.split(":");
|
|
2389
|
-
var id = parseInt(reference[0], 16)
|
|
2390
|
-
|
|
2391
|
-
switch (
|
|
2460
|
+
var id = parseInt(reference[0], 16),
|
|
2461
|
+
chunk = getChunk(response, id);
|
|
2462
|
+
switch (chunk.status) {
|
|
2392
2463
|
case "resolved_model":
|
|
2393
|
-
initializeModelChunk(
|
|
2464
|
+
initializeModelChunk(chunk);
|
|
2394
2465
|
}
|
|
2395
|
-
switch (
|
|
2466
|
+
switch (chunk.status) {
|
|
2396
2467
|
case "fulfilled":
|
|
2397
|
-
id =
|
|
2398
|
-
|
|
2399
|
-
|
|
2468
|
+
id = chunk.value;
|
|
2469
|
+
chunk = chunk.reason;
|
|
2470
|
+
for (
|
|
2471
|
+
var localLength = 0,
|
|
2472
|
+
rootArrayContexts = response._rootArrayContexts,
|
|
2473
|
+
i = 1;
|
|
2474
|
+
i < reference.length;
|
|
2475
|
+
i++
|
|
2476
|
+
) {
|
|
2477
|
+
localLength = reference[i];
|
|
2400
2478
|
if (
|
|
2401
2479
|
"object" !== typeof id ||
|
|
2402
|
-
|
|
2403
|
-
id
|
|
2480
|
+
null === id ||
|
|
2481
|
+
(getPrototypeOf(id) !== ObjectPrototype &&
|
|
2482
|
+
getPrototypeOf(id) !== ArrayPrototype) ||
|
|
2483
|
+
!hasOwnProperty.call(id, localLength)
|
|
2404
2484
|
)
|
|
2405
2485
|
throw Error("Invalid reference.");
|
|
2406
|
-
id = id[
|
|
2486
|
+
id = id[localLength];
|
|
2487
|
+
isArrayImpl(id)
|
|
2488
|
+
? ((localLength = 0), (chunk = rootArrayContexts.get(id) || chunk))
|
|
2489
|
+
: ((chunk = null),
|
|
2490
|
+
"string" === typeof id
|
|
2491
|
+
? (localLength = id.length)
|
|
2492
|
+
: "bigint" === typeof id
|
|
2493
|
+
? ((localLength = Math.abs(Number(id))),
|
|
2494
|
+
(localLength =
|
|
2495
|
+
0 === localLength
|
|
2496
|
+
? 1
|
|
2497
|
+
: Math.floor(Math.log10(localLength)) + 1))
|
|
2498
|
+
: (localLength = ArrayBuffer.isView(id) ? id.byteLength : 0));
|
|
2407
2499
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2500
|
+
parentObject = map(response, id, parentObject, key);
|
|
2501
|
+
null !== referenceArrayRoot &&
|
|
2502
|
+
(null !== chunk
|
|
2503
|
+
? (chunk.fork && (referenceArrayRoot.fork = !0),
|
|
2504
|
+
bumpArrayCount(referenceArrayRoot, chunk.count, response))
|
|
2505
|
+
: 0 < localLength &&
|
|
2506
|
+
bumpArrayCount(referenceArrayRoot, localLength, response));
|
|
2507
|
+
return parentObject;
|
|
2410
2508
|
case "blocked":
|
|
2411
2509
|
return (
|
|
2412
2510
|
initializingHandler
|
|
2413
2511
|
? ((response = initializingHandler), response.deps++)
|
|
2414
2512
|
: (response = initializingHandler =
|
|
2415
2513
|
{ chunk: null, value: null, reason: null, deps: 1, errored: !1 }),
|
|
2416
|
-
(
|
|
2514
|
+
(referenceArrayRoot = {
|
|
2417
2515
|
handler: response,
|
|
2418
2516
|
parentObject: parentObject,
|
|
2419
2517
|
key: key,
|
|
2420
2518
|
map: map,
|
|
2421
|
-
path: reference
|
|
2519
|
+
path: reference,
|
|
2520
|
+
arrayRoot: referenceArrayRoot
|
|
2422
2521
|
}),
|
|
2423
|
-
null ===
|
|
2424
|
-
? (
|
|
2425
|
-
:
|
|
2426
|
-
null ===
|
|
2427
|
-
? (
|
|
2428
|
-
:
|
|
2522
|
+
null === chunk.value
|
|
2523
|
+
? (chunk.value = [referenceArrayRoot])
|
|
2524
|
+
: chunk.value.push(referenceArrayRoot),
|
|
2525
|
+
null === chunk.reason
|
|
2526
|
+
? (chunk.reason = [referenceArrayRoot])
|
|
2527
|
+
: chunk.reason.push(referenceArrayRoot),
|
|
2429
2528
|
null
|
|
2430
2529
|
);
|
|
2530
|
+
case "pending":
|
|
2531
|
+
throw Error("Invalid forward reference.");
|
|
2431
2532
|
default:
|
|
2432
2533
|
return (
|
|
2433
2534
|
initializingHandler
|
|
2434
2535
|
? ((initializingHandler.errored = !0),
|
|
2435
2536
|
(initializingHandler.value = null),
|
|
2436
|
-
(initializingHandler.reason =
|
|
2537
|
+
(initializingHandler.reason = chunk.reason))
|
|
2437
2538
|
: (initializingHandler = {
|
|
2438
2539
|
chunk: null,
|
|
2439
2540
|
value: null,
|
|
2440
|
-
reason:
|
|
2541
|
+
reason: chunk.reason,
|
|
2441
2542
|
deps: 0,
|
|
2442
2543
|
errored: !0
|
|
2443
2544
|
}),
|
|
@@ -2446,12 +2547,21 @@ function getOutlinedModel(response, reference, parentObject, key, map) {
|
|
|
2446
2547
|
}
|
|
2447
2548
|
}
|
|
2448
2549
|
function createMap(response, model) {
|
|
2550
|
+
if (!isArrayImpl(model)) throw Error("Invalid Map initializer.");
|
|
2551
|
+
if (!0 === model.$$consumed) throw Error("Already initialized Map.");
|
|
2552
|
+
model.$$consumed = !0;
|
|
2449
2553
|
return new Map(model);
|
|
2450
2554
|
}
|
|
2451
2555
|
function createSet(response, model) {
|
|
2556
|
+
if (!isArrayImpl(model)) throw Error("Invalid Set initializer.");
|
|
2557
|
+
if (!0 === model.$$consumed) throw Error("Already initialized Set.");
|
|
2558
|
+
model.$$consumed = !0;
|
|
2452
2559
|
return new Set(model);
|
|
2453
2560
|
}
|
|
2454
2561
|
function extractIterator(response, model) {
|
|
2562
|
+
if (!isArrayImpl(model)) throw Error("Invalid Iterator initializer.");
|
|
2563
|
+
if (!0 === model.$$consumed) throw Error("Already initialized Iterator.");
|
|
2564
|
+
model.$$consumed = !0;
|
|
2455
2565
|
return model[Symbol.iterator]();
|
|
2456
2566
|
}
|
|
2457
2567
|
function createModel(response, model, parentObject, key) {
|
|
@@ -2463,13 +2573,34 @@ function parseTypedArray(
|
|
|
2463
2573
|
constructor,
|
|
2464
2574
|
bytesPerElement,
|
|
2465
2575
|
parentObject,
|
|
2466
|
-
parentKey
|
|
2576
|
+
parentKey,
|
|
2577
|
+
referenceArrayRoot
|
|
2467
2578
|
) {
|
|
2579
|
+
function reject(error) {
|
|
2580
|
+
if (!handler.errored) {
|
|
2581
|
+
handler.errored = !0;
|
|
2582
|
+
handler.value = null;
|
|
2583
|
+
handler.reason = error;
|
|
2584
|
+
var chunk = handler.chunk;
|
|
2585
|
+
null !== chunk &&
|
|
2586
|
+
"blocked" === chunk.status &&
|
|
2587
|
+
triggerErrorOnChunk(response, chunk, error);
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2468
2590
|
reference = parseInt(reference.slice(2), 16);
|
|
2469
|
-
|
|
2470
|
-
|
|
2591
|
+
var key = response._prefix + reference;
|
|
2592
|
+
bytesPerElement = response._chunks;
|
|
2593
|
+
if (bytesPerElement.has(reference))
|
|
2471
2594
|
throw Error("Already initialized typed array.");
|
|
2472
|
-
|
|
2595
|
+
bytesPerElement.set(
|
|
2596
|
+
reference,
|
|
2597
|
+
new ReactPromise(
|
|
2598
|
+
"rejected",
|
|
2599
|
+
null,
|
|
2600
|
+
Error("Already initialized typed array.")
|
|
2601
|
+
)
|
|
2602
|
+
);
|
|
2603
|
+
reference = response._formData.get(key).arrayBuffer();
|
|
2473
2604
|
if (initializingHandler) {
|
|
2474
2605
|
var handler = initializingHandler;
|
|
2475
2606
|
handler.deps++;
|
|
@@ -2481,37 +2612,32 @@ function parseTypedArray(
|
|
|
2481
2612
|
deps: 1,
|
|
2482
2613
|
errored: !1
|
|
2483
2614
|
};
|
|
2484
|
-
reference.then(
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
buffer.value = handler.value;
|
|
2498
|
-
buffer.reason = null;
|
|
2499
|
-
null !== resolveListeners &&
|
|
2500
|
-
wakeChunk(response, resolveListeners, handler.value);
|
|
2501
|
-
}
|
|
2502
|
-
},
|
|
2503
|
-
function (error) {
|
|
2504
|
-
if (!handler.errored) {
|
|
2505
|
-
handler.errored = !0;
|
|
2506
|
-
handler.value = null;
|
|
2507
|
-
handler.reason = error;
|
|
2508
|
-
var chunk = handler.chunk;
|
|
2509
|
-
null !== chunk &&
|
|
2510
|
-
"blocked" === chunk.status &&
|
|
2511
|
-
triggerErrorOnChunk(response, chunk, error);
|
|
2512
|
-
}
|
|
2615
|
+
reference.then(function (buffer) {
|
|
2616
|
+
try {
|
|
2617
|
+
null !== referenceArrayRoot &&
|
|
2618
|
+
bumpArrayCount(referenceArrayRoot, buffer.byteLength, response);
|
|
2619
|
+
var resolvedValue =
|
|
2620
|
+
constructor === ArrayBuffer ? buffer : new constructor(buffer);
|
|
2621
|
+
"__proto__" !== key && (parentObject[parentKey] = resolvedValue);
|
|
2622
|
+
"" === parentKey &&
|
|
2623
|
+
null === handler.value &&
|
|
2624
|
+
(handler.value = resolvedValue);
|
|
2625
|
+
} catch (x) {
|
|
2626
|
+
reject(x);
|
|
2627
|
+
return;
|
|
2513
2628
|
}
|
|
2514
|
-
|
|
2629
|
+
handler.deps--;
|
|
2630
|
+
0 === handler.deps &&
|
|
2631
|
+
((buffer = handler.chunk),
|
|
2632
|
+
null !== buffer &&
|
|
2633
|
+
"blocked" === buffer.status &&
|
|
2634
|
+
((resolvedValue = buffer.value),
|
|
2635
|
+
(buffer.status = "fulfilled"),
|
|
2636
|
+
(buffer.value = handler.value),
|
|
2637
|
+
(buffer.reason = null),
|
|
2638
|
+
null !== resolvedValue &&
|
|
2639
|
+
wakeChunk(response, resolvedValue, handler.value, buffer)));
|
|
2640
|
+
}, reject);
|
|
2515
2641
|
return null;
|
|
2516
2642
|
}
|
|
2517
2643
|
function resolveStream(response, id, stream, controller) {
|
|
@@ -2527,86 +2653,78 @@ function resolveStream(response, id, stream, controller) {
|
|
|
2527
2653
|
: controller.enqueueModel(chunks));
|
|
2528
2654
|
}
|
|
2529
2655
|
function parseReadableStream(response, reference, type) {
|
|
2656
|
+
function enqueue(value) {
|
|
2657
|
+
"bytes" !== type || ArrayBuffer.isView(value)
|
|
2658
|
+
? controller.enqueue(value)
|
|
2659
|
+
: flightController.error(Error("Invalid data for bytes stream."));
|
|
2660
|
+
}
|
|
2530
2661
|
reference = parseInt(reference.slice(2), 16);
|
|
2531
2662
|
if (response._chunks.has(reference))
|
|
2532
2663
|
throw Error("Already initialized stream.");
|
|
2533
2664
|
var controller = null,
|
|
2534
|
-
closed = !1
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
}
|
|
2540
|
-
});
|
|
2541
|
-
var previousBlockedChunk = null;
|
|
2542
|
-
resolveStream(response, reference, type, {
|
|
2543
|
-
enqueueModel: function (json) {
|
|
2544
|
-
if (null === previousBlockedChunk) {
|
|
2545
|
-
var chunk = createResolvedModelChunk(response, json, -1);
|
|
2546
|
-
initializeModelChunk(chunk);
|
|
2547
|
-
"fulfilled" === chunk.status
|
|
2548
|
-
? controller.enqueue(chunk.value)
|
|
2549
|
-
: (chunk.then(
|
|
2550
|
-
function (v) {
|
|
2551
|
-
return controller.enqueue(v);
|
|
2552
|
-
},
|
|
2553
|
-
function (e) {
|
|
2554
|
-
return controller.error(e);
|
|
2555
|
-
}
|
|
2556
|
-
),
|
|
2557
|
-
(previousBlockedChunk = chunk));
|
|
2558
|
-
} else {
|
|
2559
|
-
chunk = previousBlockedChunk;
|
|
2560
|
-
var chunk$31 = new ReactPromise("pending", null, null);
|
|
2561
|
-
chunk$31.then(
|
|
2562
|
-
function (v) {
|
|
2563
|
-
return controller.enqueue(v);
|
|
2564
|
-
},
|
|
2565
|
-
function (e) {
|
|
2566
|
-
return controller.error(e);
|
|
2567
|
-
}
|
|
2568
|
-
);
|
|
2569
|
-
previousBlockedChunk = chunk$31;
|
|
2570
|
-
chunk.then(function () {
|
|
2571
|
-
previousBlockedChunk === chunk$31 && (previousBlockedChunk = null);
|
|
2572
|
-
resolveModelChunk(response, chunk$31, json, -1);
|
|
2573
|
-
});
|
|
2665
|
+
closed = !1,
|
|
2666
|
+
stream = new ReadableStream({
|
|
2667
|
+
type: type,
|
|
2668
|
+
start: function (c) {
|
|
2669
|
+
controller = c;
|
|
2574
2670
|
}
|
|
2575
|
-
},
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
var
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
blockedChunk.then(function () {
|
|
2595
|
-
return controller.error(error);
|
|
2671
|
+
}),
|
|
2672
|
+
previousBlockedChunk = null,
|
|
2673
|
+
flightController = {
|
|
2674
|
+
enqueueModel: function (json) {
|
|
2675
|
+
if (null === previousBlockedChunk) {
|
|
2676
|
+
var chunk = createResolvedModelChunk(response, json, -1);
|
|
2677
|
+
initializeModelChunk(chunk);
|
|
2678
|
+
"fulfilled" === chunk.status
|
|
2679
|
+
? enqueue(chunk.value)
|
|
2680
|
+
: (chunk.then(enqueue, flightController.error),
|
|
2681
|
+
(previousBlockedChunk = chunk));
|
|
2682
|
+
} else {
|
|
2683
|
+
chunk = previousBlockedChunk;
|
|
2684
|
+
var chunk$32 = new ReactPromise("pending", null, null);
|
|
2685
|
+
chunk$32.then(enqueue, flightController.error);
|
|
2686
|
+
previousBlockedChunk = chunk$32;
|
|
2687
|
+
chunk.then(function () {
|
|
2688
|
+
previousBlockedChunk === chunk$32 && (previousBlockedChunk = null);
|
|
2689
|
+
resolveModelChunk(response, chunk$32, json, -1);
|
|
2596
2690
|
});
|
|
2597
2691
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2692
|
+
},
|
|
2693
|
+
close: function () {
|
|
2694
|
+
if (!closed)
|
|
2695
|
+
if (((closed = !0), null === previousBlockedChunk))
|
|
2696
|
+
controller.close();
|
|
2697
|
+
else {
|
|
2698
|
+
var blockedChunk = previousBlockedChunk;
|
|
2699
|
+
previousBlockedChunk = null;
|
|
2700
|
+
blockedChunk.then(function () {
|
|
2701
|
+
return controller.close();
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2705
|
+
error: function (error) {
|
|
2706
|
+
if (!closed)
|
|
2707
|
+
if (((closed = !0), null === previousBlockedChunk))
|
|
2708
|
+
controller.error(error);
|
|
2709
|
+
else {
|
|
2710
|
+
var blockedChunk = previousBlockedChunk;
|
|
2711
|
+
previousBlockedChunk = null;
|
|
2712
|
+
blockedChunk.then(function () {
|
|
2713
|
+
return controller.error(error);
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
};
|
|
2718
|
+
resolveStream(response, reference, stream, flightController);
|
|
2719
|
+
return stream;
|
|
2604
2720
|
}
|
|
2605
|
-
function
|
|
2606
|
-
next =
|
|
2607
|
-
next[ASYNC_ITERATOR] = asyncIterator;
|
|
2608
|
-
return next;
|
|
2721
|
+
function FlightIterator(next) {
|
|
2722
|
+
this.next = next;
|
|
2609
2723
|
}
|
|
2724
|
+
FlightIterator.prototype = {};
|
|
2725
|
+
FlightIterator.prototype[ASYNC_ITERATOR] = function () {
|
|
2726
|
+
return this;
|
|
2727
|
+
};
|
|
2610
2728
|
function parseAsyncIterable(response, reference, iterator) {
|
|
2611
2729
|
reference = parseInt(reference.slice(2), 16);
|
|
2612
2730
|
if (response._chunks.has(reference))
|
|
@@ -2618,7 +2736,7 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2618
2736
|
$jscomp$compprop5 =
|
|
2619
2737
|
(($jscomp$compprop5[ASYNC_ITERATOR] = function () {
|
|
2620
2738
|
var nextReadIndex = 0;
|
|
2621
|
-
return
|
|
2739
|
+
return new FlightIterator(function (arg) {
|
|
2622
2740
|
if (void 0 !== arg)
|
|
2623
2741
|
throw Error(
|
|
2624
2742
|
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
|
@@ -2698,17 +2816,28 @@ function parseAsyncIterable(response, reference, iterator) {
|
|
|
2698
2816
|
});
|
|
2699
2817
|
return iterator;
|
|
2700
2818
|
}
|
|
2701
|
-
function parseModelString(response, obj, key, value, reference) {
|
|
2819
|
+
function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
2702
2820
|
if ("$" === value[0]) {
|
|
2703
2821
|
switch (value[1]) {
|
|
2704
2822
|
case "$":
|
|
2705
|
-
return
|
|
2823
|
+
return (
|
|
2824
|
+
null !== arrayRoot &&
|
|
2825
|
+
bumpArrayCount(arrayRoot, value.length - 1, response),
|
|
2826
|
+
value.slice(1)
|
|
2827
|
+
);
|
|
2706
2828
|
case "@":
|
|
2707
2829
|
return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
|
|
2708
2830
|
case "h":
|
|
2709
2831
|
return (
|
|
2710
|
-
(
|
|
2711
|
-
getOutlinedModel(
|
|
2832
|
+
(arrayRoot = value.slice(2)),
|
|
2833
|
+
getOutlinedModel(
|
|
2834
|
+
response,
|
|
2835
|
+
arrayRoot,
|
|
2836
|
+
obj,
|
|
2837
|
+
key,
|
|
2838
|
+
null,
|
|
2839
|
+
loadServerReference$1
|
|
2840
|
+
)
|
|
2712
2841
|
);
|
|
2713
2842
|
case "T":
|
|
2714
2843
|
if (void 0 === reference || void 0 === response._temporaryReferences)
|
|
@@ -2721,27 +2850,37 @@ function parseModelString(response, obj, key, value, reference) {
|
|
|
2721
2850
|
);
|
|
2722
2851
|
case "Q":
|
|
2723
2852
|
return (
|
|
2724
|
-
(
|
|
2725
|
-
getOutlinedModel(response,
|
|
2853
|
+
(arrayRoot = value.slice(2)),
|
|
2854
|
+
getOutlinedModel(response, arrayRoot, obj, key, null, createMap)
|
|
2726
2855
|
);
|
|
2727
2856
|
case "W":
|
|
2728
2857
|
return (
|
|
2729
|
-
(
|
|
2730
|
-
getOutlinedModel(response,
|
|
2858
|
+
(arrayRoot = value.slice(2)),
|
|
2859
|
+
getOutlinedModel(response, arrayRoot, obj, key, null, createSet)
|
|
2731
2860
|
);
|
|
2732
2861
|
case "K":
|
|
2733
2862
|
obj = value.slice(2);
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
response._formData
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2863
|
+
obj = response._prefix + obj + "_";
|
|
2864
|
+
key = new FormData();
|
|
2865
|
+
response = response._formData;
|
|
2866
|
+
arrayRoot = Array.from(response.keys());
|
|
2867
|
+
for (value = 0; value < arrayRoot.length; value++)
|
|
2868
|
+
if (((reference = arrayRoot[value]), reference.startsWith(obj))) {
|
|
2869
|
+
for (
|
|
2870
|
+
var entries = response.getAll(reference),
|
|
2871
|
+
newKey = reference.slice(obj.length),
|
|
2872
|
+
j = 0;
|
|
2873
|
+
j < entries.length;
|
|
2874
|
+
j++
|
|
2875
|
+
)
|
|
2876
|
+
key.append(newKey, entries[j]);
|
|
2877
|
+
response.delete(reference);
|
|
2878
|
+
}
|
|
2879
|
+
return key;
|
|
2741
2880
|
case "i":
|
|
2742
2881
|
return (
|
|
2743
|
-
(
|
|
2744
|
-
getOutlinedModel(response,
|
|
2882
|
+
(arrayRoot = value.slice(2)),
|
|
2883
|
+
getOutlinedModel(response, arrayRoot, obj, key, null, extractIterator)
|
|
2745
2884
|
);
|
|
2746
2885
|
case "I":
|
|
2747
2886
|
return Infinity;
|
|
@@ -2754,35 +2893,147 @@ function parseModelString(response, obj, key, value, reference) {
|
|
|
2754
2893
|
case "D":
|
|
2755
2894
|
return new Date(Date.parse(value.slice(2)));
|
|
2756
2895
|
case "n":
|
|
2757
|
-
|
|
2896
|
+
obj = value.slice(2);
|
|
2897
|
+
if (300 < obj.length)
|
|
2898
|
+
throw Error(
|
|
2899
|
+
"BigInt is too large. Received " +
|
|
2900
|
+
obj.length +
|
|
2901
|
+
" digits but the limit is 300."
|
|
2902
|
+
);
|
|
2903
|
+
null !== arrayRoot && bumpArrayCount(arrayRoot, obj.length, response);
|
|
2904
|
+
return BigInt(obj);
|
|
2758
2905
|
}
|
|
2759
2906
|
switch (value[1]) {
|
|
2760
2907
|
case "A":
|
|
2761
|
-
return parseTypedArray(
|
|
2908
|
+
return parseTypedArray(
|
|
2909
|
+
response,
|
|
2910
|
+
value,
|
|
2911
|
+
ArrayBuffer,
|
|
2912
|
+
1,
|
|
2913
|
+
obj,
|
|
2914
|
+
key,
|
|
2915
|
+
arrayRoot
|
|
2916
|
+
);
|
|
2762
2917
|
case "O":
|
|
2763
|
-
return parseTypedArray(
|
|
2918
|
+
return parseTypedArray(
|
|
2919
|
+
response,
|
|
2920
|
+
value,
|
|
2921
|
+
Int8Array,
|
|
2922
|
+
1,
|
|
2923
|
+
obj,
|
|
2924
|
+
key,
|
|
2925
|
+
arrayRoot
|
|
2926
|
+
);
|
|
2764
2927
|
case "o":
|
|
2765
|
-
return parseTypedArray(
|
|
2928
|
+
return parseTypedArray(
|
|
2929
|
+
response,
|
|
2930
|
+
value,
|
|
2931
|
+
Uint8Array,
|
|
2932
|
+
1,
|
|
2933
|
+
obj,
|
|
2934
|
+
key,
|
|
2935
|
+
arrayRoot
|
|
2936
|
+
);
|
|
2766
2937
|
case "U":
|
|
2767
|
-
return parseTypedArray(
|
|
2938
|
+
return parseTypedArray(
|
|
2939
|
+
response,
|
|
2940
|
+
value,
|
|
2941
|
+
Uint8ClampedArray,
|
|
2942
|
+
1,
|
|
2943
|
+
obj,
|
|
2944
|
+
key,
|
|
2945
|
+
arrayRoot
|
|
2946
|
+
);
|
|
2768
2947
|
case "S":
|
|
2769
|
-
return parseTypedArray(
|
|
2948
|
+
return parseTypedArray(
|
|
2949
|
+
response,
|
|
2950
|
+
value,
|
|
2951
|
+
Int16Array,
|
|
2952
|
+
2,
|
|
2953
|
+
obj,
|
|
2954
|
+
key,
|
|
2955
|
+
arrayRoot
|
|
2956
|
+
);
|
|
2770
2957
|
case "s":
|
|
2771
|
-
return parseTypedArray(
|
|
2958
|
+
return parseTypedArray(
|
|
2959
|
+
response,
|
|
2960
|
+
value,
|
|
2961
|
+
Uint16Array,
|
|
2962
|
+
2,
|
|
2963
|
+
obj,
|
|
2964
|
+
key,
|
|
2965
|
+
arrayRoot
|
|
2966
|
+
);
|
|
2772
2967
|
case "L":
|
|
2773
|
-
return parseTypedArray(
|
|
2968
|
+
return parseTypedArray(
|
|
2969
|
+
response,
|
|
2970
|
+
value,
|
|
2971
|
+
Int32Array,
|
|
2972
|
+
4,
|
|
2973
|
+
obj,
|
|
2974
|
+
key,
|
|
2975
|
+
arrayRoot
|
|
2976
|
+
);
|
|
2774
2977
|
case "l":
|
|
2775
|
-
return parseTypedArray(
|
|
2978
|
+
return parseTypedArray(
|
|
2979
|
+
response,
|
|
2980
|
+
value,
|
|
2981
|
+
Uint32Array,
|
|
2982
|
+
4,
|
|
2983
|
+
obj,
|
|
2984
|
+
key,
|
|
2985
|
+
arrayRoot
|
|
2986
|
+
);
|
|
2776
2987
|
case "G":
|
|
2777
|
-
return parseTypedArray(
|
|
2988
|
+
return parseTypedArray(
|
|
2989
|
+
response,
|
|
2990
|
+
value,
|
|
2991
|
+
Float32Array,
|
|
2992
|
+
4,
|
|
2993
|
+
obj,
|
|
2994
|
+
key,
|
|
2995
|
+
arrayRoot
|
|
2996
|
+
);
|
|
2778
2997
|
case "g":
|
|
2779
|
-
return parseTypedArray(
|
|
2998
|
+
return parseTypedArray(
|
|
2999
|
+
response,
|
|
3000
|
+
value,
|
|
3001
|
+
Float64Array,
|
|
3002
|
+
8,
|
|
3003
|
+
obj,
|
|
3004
|
+
key,
|
|
3005
|
+
arrayRoot
|
|
3006
|
+
);
|
|
2780
3007
|
case "M":
|
|
2781
|
-
return parseTypedArray(
|
|
3008
|
+
return parseTypedArray(
|
|
3009
|
+
response,
|
|
3010
|
+
value,
|
|
3011
|
+
BigInt64Array,
|
|
3012
|
+
8,
|
|
3013
|
+
obj,
|
|
3014
|
+
key,
|
|
3015
|
+
arrayRoot
|
|
3016
|
+
);
|
|
2782
3017
|
case "m":
|
|
2783
|
-
return parseTypedArray(
|
|
3018
|
+
return parseTypedArray(
|
|
3019
|
+
response,
|
|
3020
|
+
value,
|
|
3021
|
+
BigUint64Array,
|
|
3022
|
+
8,
|
|
3023
|
+
obj,
|
|
3024
|
+
key,
|
|
3025
|
+
arrayRoot
|
|
3026
|
+
);
|
|
2784
3027
|
case "V":
|
|
2785
|
-
return parseTypedArray(
|
|
3028
|
+
return parseTypedArray(
|
|
3029
|
+
response,
|
|
3030
|
+
value,
|
|
3031
|
+
DataView,
|
|
3032
|
+
1,
|
|
3033
|
+
obj,
|
|
3034
|
+
key,
|
|
3035
|
+
arrayRoot
|
|
3036
|
+
);
|
|
2786
3037
|
case "B":
|
|
2787
3038
|
return (
|
|
2788
3039
|
(obj = parseInt(value.slice(2), 16)),
|
|
@@ -2800,8 +3051,9 @@ function parseModelString(response, obj, key, value, reference) {
|
|
|
2800
3051
|
return parseAsyncIterable(response, value, !0);
|
|
2801
3052
|
}
|
|
2802
3053
|
value = value.slice(1);
|
|
2803
|
-
return getOutlinedModel(response, value, obj, key, createModel);
|
|
3054
|
+
return getOutlinedModel(response, value, obj, key, arrayRoot, createModel);
|
|
2804
3055
|
}
|
|
3056
|
+
null !== arrayRoot && bumpArrayCount(arrayRoot, value.length, response);
|
|
2805
3057
|
return value;
|
|
2806
3058
|
}
|
|
2807
3059
|
function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
@@ -2809,25 +3061,38 @@ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
|
2809
3061
|
3 < arguments.length && void 0 !== arguments[3]
|
|
2810
3062
|
? arguments[3]
|
|
2811
3063
|
: new FormData(),
|
|
3064
|
+
arraySizeLimit =
|
|
3065
|
+
4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 1e6,
|
|
2812
3066
|
chunks = new Map();
|
|
2813
3067
|
return {
|
|
2814
3068
|
_bundlerConfig: bundlerConfig,
|
|
2815
3069
|
_prefix: formFieldPrefix,
|
|
2816
3070
|
_formData: backingFormData,
|
|
2817
3071
|
_chunks: chunks,
|
|
2818
|
-
_temporaryReferences: temporaryReferences
|
|
3072
|
+
_temporaryReferences: temporaryReferences,
|
|
3073
|
+
_rootArrayContexts: new WeakMap(),
|
|
3074
|
+
_arraySizeLimit: arraySizeLimit
|
|
2819
3075
|
};
|
|
2820
3076
|
}
|
|
2821
3077
|
function close(response) {
|
|
2822
3078
|
reportGlobalError(response, Error("Connection closed."));
|
|
2823
3079
|
}
|
|
2824
|
-
function loadServerReference(bundlerConfig,
|
|
3080
|
+
function loadServerReference(bundlerConfig, metaData) {
|
|
3081
|
+
var id = metaData.id;
|
|
3082
|
+
if ("string" !== typeof id) return null;
|
|
2825
3083
|
var serverReference = resolveServerReference(bundlerConfig, id);
|
|
2826
3084
|
bundlerConfig = preloadModule(serverReference);
|
|
2827
|
-
|
|
2828
|
-
|
|
3085
|
+
metaData = metaData.bound;
|
|
3086
|
+
return metaData instanceof Promise
|
|
3087
|
+
? Promise.all([metaData, bundlerConfig]).then(function (_ref) {
|
|
2829
3088
|
_ref = _ref[0];
|
|
2830
3089
|
var fn = requireModule(serverReference);
|
|
3090
|
+
if (1e3 < _ref.length)
|
|
3091
|
+
throw Error(
|
|
3092
|
+
"Server Function has too many bound arguments. Received " +
|
|
3093
|
+
_ref.length +
|
|
3094
|
+
" but the limit is 1000."
|
|
3095
|
+
);
|
|
2831
3096
|
return fn.bind.apply(fn, [null].concat(_ref));
|
|
2832
3097
|
})
|
|
2833
3098
|
: bundlerConfig
|
|
@@ -2836,8 +3101,19 @@ function loadServerReference(bundlerConfig, id, bound) {
|
|
|
2836
3101
|
})
|
|
2837
3102
|
: Promise.resolve(requireModule(serverReference));
|
|
2838
3103
|
}
|
|
2839
|
-
function decodeBoundActionMetaData(
|
|
2840
|
-
body
|
|
3104
|
+
function decodeBoundActionMetaData(
|
|
3105
|
+
body,
|
|
3106
|
+
serverManifest,
|
|
3107
|
+
formFieldPrefix,
|
|
3108
|
+
arraySizeLimit
|
|
3109
|
+
) {
|
|
3110
|
+
body = createResponse(
|
|
3111
|
+
serverManifest,
|
|
3112
|
+
formFieldPrefix,
|
|
3113
|
+
void 0,
|
|
3114
|
+
body,
|
|
3115
|
+
arraySizeLimit
|
|
3116
|
+
);
|
|
2841
3117
|
close(body);
|
|
2842
3118
|
body = getChunk(body, 0);
|
|
2843
3119
|
body.then(function () {});
|
|
@@ -2853,16 +3129,24 @@ exports.createTemporaryReferenceSet = function () {
|
|
|
2853
3129
|
};
|
|
2854
3130
|
exports.decodeAction = function (body, serverManifest) {
|
|
2855
3131
|
var formData = new FormData(),
|
|
2856
|
-
action = null
|
|
3132
|
+
action = null,
|
|
3133
|
+
seenActions = new Set();
|
|
2857
3134
|
body.forEach(function (value, key) {
|
|
2858
3135
|
key.startsWith("$ACTION_")
|
|
2859
3136
|
? key.startsWith("$ACTION_REF_")
|
|
2860
|
-
? (
|
|
3137
|
+
? seenActions.has(key) ||
|
|
3138
|
+
(seenActions.add(key),
|
|
3139
|
+
(value = "$ACTION_" + key.slice(12) + ":"),
|
|
2861
3140
|
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
|
2862
|
-
(action = loadServerReference(serverManifest, value
|
|
3141
|
+
(action = loadServerReference(serverManifest, value)))
|
|
2863
3142
|
: key.startsWith("$ACTION_ID_") &&
|
|
2864
|
-
(
|
|
2865
|
-
(
|
|
3143
|
+
!seenActions.has(key) &&
|
|
3144
|
+
(seenActions.add(key),
|
|
3145
|
+
(value = key.slice(11)),
|
|
3146
|
+
(action = loadServerReference(serverManifest, {
|
|
3147
|
+
id: value,
|
|
3148
|
+
bound: null
|
|
3149
|
+
})))
|
|
2866
3150
|
: formData.append(key, value);
|
|
2867
3151
|
});
|
|
2868
3152
|
return null === action
|
|
@@ -2898,7 +3182,8 @@ exports.decodeReply = function (body, turbopackMap, options) {
|
|
|
2898
3182
|
turbopackMap,
|
|
2899
3183
|
"",
|
|
2900
3184
|
options ? options.temporaryReferences : void 0,
|
|
2901
|
-
body
|
|
3185
|
+
body,
|
|
3186
|
+
options ? options.arraySizeLimit : void 0
|
|
2902
3187
|
);
|
|
2903
3188
|
turbopackMap = getChunk(body, 0);
|
|
2904
3189
|
close(body);
|