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