@vitejs/plugin-rsc 0.4.34 → 0.5.0
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/dist/{browser-CQv7Z3J4.d.ts → browser-STIFJSFF.d.ts} +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +19 -1
- package/dist/{cjs-BamOAUgw.js → cjs-C5-IrxV9.js} +1 -1
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/plugin.js +1 -1
- package/dist/core/rsc.d.ts +2 -2
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +2 -2
- package/dist/core/ssr.js +1 -1
- package/dist/{encryption-runtime-DT6dtlC5.js → encryption-runtime-FhNKiASK.js} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/{plugin-BLedJFh7.js → plugin-CrduXSyi.js} +6 -14
- package/dist/{plugin-DCLI7Wh8.d.ts → plugin-DGhnAIi6.d.ts} +1 -5
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +7 -7
- package/dist/plugins/cjs.js +2 -2
- package/dist/react/browser.d.ts +3 -3
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/rsc.js +2 -2
- package/dist/react/ssr.d.ts +3 -3
- package/dist/react/ssr.js +2 -2
- package/dist/{rsc-3bkzqdsJ.d.ts → rsc-Cg31p8XR.d.ts} +1 -1
- package/dist/{rsc-BdCB3621.js → rsc-DdBcg-Lb.js} +1 -1
- package/dist/rsc.d.ts +4 -4
- package/dist/rsc.js +22 -5
- package/dist/{ssr-CMjeQ9AS.d.ts → ssr-00tY_Tdf.d.ts} +1 -1
- package/dist/{ssr-Cd4SbAaO.js → ssr-CE8X2HyS.js} +1 -1
- package/dist/ssr.d.ts +3 -3
- package/dist/ssr.js +52 -4
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +1 -1
- package/dist/utils/encryption-runtime.d.ts +1 -1
- package/dist/utils/encryption-runtime.js +4 -4
- package/dist/utils/rpc.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +2964 -774
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +554 -312
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +2721 -724
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +541 -300
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +2955 -858
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +652 -332
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2956 -861
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.production.js +652 -332
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-plugin.js +6 -2
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +1931 -713
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +544 -295
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +1926 -715
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +542 -299
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +2719 -743
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +725 -338
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.development.js +2703 -727
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.production.js +725 -338
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/dist/vendor/react-server-dom/server.node.js +3 -1
- package/dist/vendor/react-server-dom/server.node.unbundled.js +3 -1
- package/dist/vendor/react-server-dom/static.browser.js +1 -3
- package/dist/vendor/react-server-dom/static.edge.js +1 -3
- package/dist/vendor/react-server-dom/static.node.js +2 -3
- package/dist/vendor/react-server-dom/static.node.unbundled.js +1 -3
- package/package.json +6 -7
- package/types/index.d.ts +0 -4
- package/dist/browser--ZREVnM9.js +0 -22
- package/dist/client-C7Eok9hc.js +0 -23
- package/dist/extra/browser.d.ts +0 -14
- package/dist/extra/browser.js +0 -88
- package/dist/extra/rsc.d.ts +0 -2
- package/dist/extra/rsc.js +0 -56
- package/dist/extra/ssr.d.ts +0 -14
- package/dist/extra/ssr.js +0 -37
- package/dist/rsc-CiAoLCx8.js +0 -21
- package/dist/rsc-c22DF1A7.d.ts +0 -16
- package/dist/rsc-html-stream/browser.d.ts +0 -5
- package/dist/rsc-html-stream/browser.js +0 -8
- package/dist/rsc-html-stream/ssr.d.ts +0 -7
- package/dist/rsc-html-stream/ssr.js +0 -8
- package/dist/server-DMhFuTz_.js +0 -72
- package/dist/ssr-BQwZitKq.js +0 -53
- package/types/virtual.d.ts +0 -5
- /package/dist/{browser-DwWQeoll.d.ts → browser-CXHICuDc.d.ts} +0 -0
- /package/dist/{encryption-runtime-B8xcnJoN.d.ts → encryption-runtime-DwihLkYv.d.ts} +0 -0
- /package/dist/{encryption-utils-BDwwcMVT.js → encryption-utils-CoE0gWjC.js} +0 -0
- /package/dist/{index-B04iFwO5.d.ts → index-DYBWAuKP.d.ts} +0 -0
- /package/dist/{index-CPkExgij.d.ts → index-kBz3NvVt.d.ts} +0 -0
- /package/dist/{plugin-CZbI4rhS.js → plugin-BwI7mYXI.js} +0 -0
- /package/dist/{rpc-CUvSZurk.js → rpc-D7cb_Wd5.js} +0 -0
- /package/dist/{rsc-JJjz3Z0i.d.ts → rsc-Fgmk6j0z.d.ts} +0 -0
- /package/dist/{rsc-GFzFWyhT.js → rsc-cp4EenMG.js} +0 -0
- /package/dist/{shared-n-ykEs15.js → shared-CceFFukJ.js} +0 -0
- /package/dist/{ssr-BrSGyrxe.d.ts → ssr-BnYZ8xo9.d.ts} +0 -0
- /package/dist/{ssr-Cm2FP2zD.js → ssr-C468YlFl.js} +0 -0
- /package/dist/{transforms-CpF3zNE0.js → transforms-wFF-pWF7.js} +0 -0
|
@@ -15,6 +15,26 @@ require("crypto");
|
|
|
15
15
|
var async_hooks = require("async_hooks"),
|
|
16
16
|
ReactDOM = require("react-dom"),
|
|
17
17
|
React = require("react"),
|
|
18
|
+
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
|
19
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
20
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
21
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
22
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
23
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
24
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
25
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
26
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
27
|
+
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
28
|
+
Symbol.for("react.postpone");
|
|
29
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
30
|
+
function getIteratorFn(maybeIterable) {
|
|
31
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
32
|
+
maybeIterable =
|
|
33
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|
34
|
+
maybeIterable["@@iterator"];
|
|
35
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
36
|
+
}
|
|
37
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
|
18
38
|
scheduleMicrotask = queueMicrotask,
|
|
19
39
|
currentView = null,
|
|
20
40
|
writtenBytes = 0,
|
|
@@ -134,6 +154,8 @@ var PROMISE_PROTOTYPE = Promise.prototype,
|
|
|
134
154
|
return;
|
|
135
155
|
case "defaultProps":
|
|
136
156
|
return;
|
|
157
|
+
case "_debugInfo":
|
|
158
|
+
return;
|
|
137
159
|
case "toJSON":
|
|
138
160
|
return;
|
|
139
161
|
case Symbol.toPrimitive:
|
|
@@ -171,6 +193,8 @@ function getReference(target, name) {
|
|
|
171
193
|
return target.name;
|
|
172
194
|
case "defaultProps":
|
|
173
195
|
return;
|
|
196
|
+
case "_debugInfo":
|
|
197
|
+
return;
|
|
174
198
|
case "toJSON":
|
|
175
199
|
return;
|
|
176
200
|
case Symbol.toPrimitive:
|
|
@@ -392,6 +416,105 @@ function trimOptions(options) {
|
|
|
392
416
|
((hasProperties = !0), (trimmed[key] = options[key]));
|
|
393
417
|
return hasProperties ? trimmed : null;
|
|
394
418
|
}
|
|
419
|
+
function getChildFormatContext(parentContext, type, props) {
|
|
420
|
+
switch (type) {
|
|
421
|
+
case "img":
|
|
422
|
+
type = props.src;
|
|
423
|
+
var srcSet = props.srcSet;
|
|
424
|
+
if (
|
|
425
|
+
!(
|
|
426
|
+
"lazy" === props.loading ||
|
|
427
|
+
(!type && !srcSet) ||
|
|
428
|
+
("string" !== typeof type && null != type) ||
|
|
429
|
+
("string" !== typeof srcSet && null != srcSet) ||
|
|
430
|
+
"low" === props.fetchPriority ||
|
|
431
|
+
parentContext & 3
|
|
432
|
+
) &&
|
|
433
|
+
("string" !== typeof type ||
|
|
434
|
+
":" !== type[4] ||
|
|
435
|
+
("d" !== type[0] && "D" !== type[0]) ||
|
|
436
|
+
("a" !== type[1] && "A" !== type[1]) ||
|
|
437
|
+
("t" !== type[2] && "T" !== type[2]) ||
|
|
438
|
+
("a" !== type[3] && "A" !== type[3])) &&
|
|
439
|
+
("string" !== typeof srcSet ||
|
|
440
|
+
":" !== srcSet[4] ||
|
|
441
|
+
("d" !== srcSet[0] && "D" !== srcSet[0]) ||
|
|
442
|
+
("a" !== srcSet[1] && "A" !== srcSet[1]) ||
|
|
443
|
+
("t" !== srcSet[2] && "T" !== srcSet[2]) ||
|
|
444
|
+
("a" !== srcSet[3] && "A" !== srcSet[3]))
|
|
445
|
+
) {
|
|
446
|
+
var sizes = "string" === typeof props.sizes ? props.sizes : void 0;
|
|
447
|
+
var input = props.crossOrigin;
|
|
448
|
+
preload(type || "", "image", {
|
|
449
|
+
imageSrcSet: srcSet,
|
|
450
|
+
imageSizes: sizes,
|
|
451
|
+
crossOrigin:
|
|
452
|
+
"string" === typeof input
|
|
453
|
+
? "use-credentials" === input
|
|
454
|
+
? input
|
|
455
|
+
: ""
|
|
456
|
+
: void 0,
|
|
457
|
+
integrity: props.integrity,
|
|
458
|
+
type: props.type,
|
|
459
|
+
fetchPriority: props.fetchPriority,
|
|
460
|
+
referrerPolicy: props.referrerPolicy
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return parentContext;
|
|
464
|
+
case "link":
|
|
465
|
+
type = props.rel;
|
|
466
|
+
srcSet = props.href;
|
|
467
|
+
if (
|
|
468
|
+
!(
|
|
469
|
+
parentContext & 1 ||
|
|
470
|
+
null != props.itemProp ||
|
|
471
|
+
"string" !== typeof type ||
|
|
472
|
+
"string" !== typeof srcSet ||
|
|
473
|
+
"" === srcSet
|
|
474
|
+
)
|
|
475
|
+
)
|
|
476
|
+
switch (type) {
|
|
477
|
+
case "preload":
|
|
478
|
+
preload(srcSet, props.as, {
|
|
479
|
+
crossOrigin: props.crossOrigin,
|
|
480
|
+
integrity: props.integrity,
|
|
481
|
+
nonce: props.nonce,
|
|
482
|
+
type: props.type,
|
|
483
|
+
fetchPriority: props.fetchPriority,
|
|
484
|
+
referrerPolicy: props.referrerPolicy,
|
|
485
|
+
imageSrcSet: props.imageSrcSet,
|
|
486
|
+
imageSizes: props.imageSizes,
|
|
487
|
+
media: props.media
|
|
488
|
+
});
|
|
489
|
+
break;
|
|
490
|
+
case "modulepreload":
|
|
491
|
+
preloadModule$1(srcSet, {
|
|
492
|
+
as: props.as,
|
|
493
|
+
crossOrigin: props.crossOrigin,
|
|
494
|
+
integrity: props.integrity,
|
|
495
|
+
nonce: props.nonce
|
|
496
|
+
});
|
|
497
|
+
break;
|
|
498
|
+
case "stylesheet":
|
|
499
|
+
preload(srcSet, "stylesheet", {
|
|
500
|
+
crossOrigin: props.crossOrigin,
|
|
501
|
+
integrity: props.integrity,
|
|
502
|
+
nonce: props.nonce,
|
|
503
|
+
type: props.type,
|
|
504
|
+
fetchPriority: props.fetchPriority,
|
|
505
|
+
referrerPolicy: props.referrerPolicy,
|
|
506
|
+
media: props.media
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
return parentContext;
|
|
510
|
+
case "picture":
|
|
511
|
+
return parentContext | 2;
|
|
512
|
+
case "noscript":
|
|
513
|
+
return parentContext | 1;
|
|
514
|
+
default:
|
|
515
|
+
return parentContext;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
395
518
|
var requestStorage = new async_hooks.AsyncLocalStorage(),
|
|
396
519
|
TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
397
520
|
proxyHandlers = {
|
|
@@ -405,6 +528,8 @@ var requestStorage = new async_hooks.AsyncLocalStorage(),
|
|
|
405
528
|
return;
|
|
406
529
|
case "defaultProps":
|
|
407
530
|
return;
|
|
531
|
+
case "_debugInfo":
|
|
532
|
+
return;
|
|
408
533
|
case "toJSON":
|
|
409
534
|
return;
|
|
410
535
|
case Symbol.toPrimitive:
|
|
@@ -415,6 +540,8 @@ var requestStorage = new async_hooks.AsyncLocalStorage(),
|
|
|
415
540
|
throw Error(
|
|
416
541
|
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
|
417
542
|
);
|
|
543
|
+
case "then":
|
|
544
|
+
return;
|
|
418
545
|
}
|
|
419
546
|
throw Error(
|
|
420
547
|
"Cannot access " +
|
|
@@ -441,35 +568,15 @@ function createTemporaryReference(temporaryReferences, id) {
|
|
|
441
568
|
temporaryReferences.set(reference, id);
|
|
442
569
|
return reference;
|
|
443
570
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
449
|
-
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
450
|
-
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
451
|
-
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
452
|
-
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
453
|
-
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
454
|
-
Symbol.for("react.postpone");
|
|
455
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
456
|
-
function getIteratorFn(maybeIterable) {
|
|
457
|
-
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
458
|
-
maybeIterable =
|
|
459
|
-
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|
460
|
-
maybeIterable["@@iterator"];
|
|
461
|
-
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
462
|
-
}
|
|
463
|
-
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
|
464
|
-
SuspenseException = Error(
|
|
465
|
-
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
|
|
466
|
-
);
|
|
467
|
-
function noop$1() {}
|
|
571
|
+
function noop() {}
|
|
572
|
+
var SuspenseException = Error(
|
|
573
|
+
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
|
|
574
|
+
);
|
|
468
575
|
function trackUsedThenable(thenableState, thenable, index) {
|
|
469
576
|
index = thenableState[index];
|
|
470
577
|
void 0 === index
|
|
471
578
|
? thenableState.push(thenable)
|
|
472
|
-
: index !== thenable && (thenable.then(noop
|
|
579
|
+
: index !== thenable && (thenable.then(noop, noop), (thenable = index));
|
|
473
580
|
switch (thenable.status) {
|
|
474
581
|
case "fulfilled":
|
|
475
582
|
return thenable.value;
|
|
@@ -477,7 +584,7 @@ function trackUsedThenable(thenableState, thenable, index) {
|
|
|
477
584
|
throw thenable.reason;
|
|
478
585
|
default:
|
|
479
586
|
"string" === typeof thenable.status
|
|
480
|
-
? thenable.then(noop
|
|
587
|
+
? thenable.then(noop, noop)
|
|
481
588
|
: ((thenableState = thenable),
|
|
482
589
|
(thenableState.status = "pending"),
|
|
483
590
|
thenableState.then(
|
|
@@ -559,6 +666,7 @@ var HooksDispatcher = {
|
|
|
559
666
|
return unsupportedRefresh;
|
|
560
667
|
}
|
|
561
668
|
};
|
|
669
|
+
HooksDispatcher.useEffectEvent = unsupportedHook;
|
|
562
670
|
function unsupportedHook() {
|
|
563
671
|
throw Error("This Hook is not supported in Server Components.");
|
|
564
672
|
}
|
|
@@ -572,7 +680,7 @@ function useId() {
|
|
|
572
680
|
if (null === currentRequest$1)
|
|
573
681
|
throw Error("useId can only be used while React is rendering");
|
|
574
682
|
var id = currentRequest$1.identifierCount++;
|
|
575
|
-
return "
|
|
683
|
+
return "_" + currentRequest$1.identifierPrefix + "S_" + id.toString(32) + "_";
|
|
576
684
|
}
|
|
577
685
|
function use(usable) {
|
|
578
686
|
if (
|
|
@@ -605,6 +713,10 @@ var DefaultAsyncDispatcher = {
|
|
|
605
713
|
((entry = resourceType()),
|
|
606
714
|
JSCompiler_inline_result.set(resourceType, entry));
|
|
607
715
|
return entry;
|
|
716
|
+
},
|
|
717
|
+
cacheSignal: function () {
|
|
718
|
+
var request = resolveRequest();
|
|
719
|
+
return request ? request.cacheController.signal : null;
|
|
608
720
|
}
|
|
609
721
|
},
|
|
610
722
|
ReactSharedInternalsServer =
|
|
@@ -616,11 +728,8 @@ if (!ReactSharedInternalsServer)
|
|
|
616
728
|
var isArrayImpl = Array.isArray,
|
|
617
729
|
getPrototypeOf = Object.getPrototypeOf;
|
|
618
730
|
function objectName(object) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
.replace(/^\[object (.*)\]$/, function (m, p0) {
|
|
622
|
-
return p0;
|
|
623
|
-
});
|
|
731
|
+
object = Object.prototype.toString.call(object);
|
|
732
|
+
return object.slice(8, object.length - 1);
|
|
624
733
|
}
|
|
625
734
|
function describeValueForErrorMessage(value) {
|
|
626
735
|
switch (typeof value) {
|
|
@@ -724,24 +833,22 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
|
724
833
|
"\n " + str + "\n " + objectOrArray)
|
|
725
834
|
: "\n " + str;
|
|
726
835
|
}
|
|
727
|
-
var
|
|
836
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
837
|
+
ObjectPrototype = Object.prototype,
|
|
728
838
|
stringify = JSON.stringify;
|
|
729
839
|
function defaultErrorHandler(error) {
|
|
730
840
|
console.error(error);
|
|
731
841
|
}
|
|
732
|
-
function defaultPostponeHandler() {}
|
|
733
842
|
function RequestInstance(
|
|
734
843
|
type,
|
|
735
844
|
model,
|
|
736
845
|
bundlerConfig,
|
|
737
846
|
onError,
|
|
738
|
-
identifierPrefix,
|
|
739
847
|
onPostpone,
|
|
740
|
-
temporaryReferences,
|
|
741
|
-
environmentName,
|
|
742
|
-
filterStackFrame,
|
|
743
848
|
onAllReady,
|
|
744
|
-
onFatalError
|
|
849
|
+
onFatalError,
|
|
850
|
+
identifierPrefix,
|
|
851
|
+
temporaryReferences
|
|
745
852
|
) {
|
|
746
853
|
if (
|
|
747
854
|
null !== ReactSharedInternalsServer.A &&
|
|
@@ -749,20 +856,20 @@ function RequestInstance(
|
|
|
749
856
|
)
|
|
750
857
|
throw Error("Currently React only supports one RSC renderer at a time.");
|
|
751
858
|
ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
859
|
+
var abortSet = new Set(),
|
|
860
|
+
pingedTasks = [],
|
|
861
|
+
hints = new Set();
|
|
755
862
|
this.type = type;
|
|
756
863
|
this.status = 10;
|
|
757
864
|
this.flushScheduled = !1;
|
|
758
865
|
this.destination = this.fatalError = null;
|
|
759
866
|
this.bundlerConfig = bundlerConfig;
|
|
760
867
|
this.cache = new Map();
|
|
868
|
+
this.cacheController = new AbortController();
|
|
761
869
|
this.pendingChunks = this.nextChunkId = 0;
|
|
762
870
|
this.hints = hints;
|
|
763
|
-
this.
|
|
764
|
-
this.
|
|
765
|
-
this.pingedTasks = environmentName;
|
|
871
|
+
this.abortableTasks = abortSet;
|
|
872
|
+
this.pingedTasks = pingedTasks;
|
|
766
873
|
this.completedImportChunks = [];
|
|
767
874
|
this.completedHintChunks = [];
|
|
768
875
|
this.completedRegularChunks = [];
|
|
@@ -776,13 +883,12 @@ function RequestInstance(
|
|
|
776
883
|
this.identifierCount = 1;
|
|
777
884
|
this.taintCleanupQueue = [];
|
|
778
885
|
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
|
779
|
-
this.onPostpone = void 0 === onPostpone ?
|
|
886
|
+
this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
|
|
780
887
|
this.onAllReady = onAllReady;
|
|
781
888
|
this.onFatalError = onFatalError;
|
|
782
|
-
type = createTask(this, model, null, !1,
|
|
783
|
-
|
|
889
|
+
type = createTask(this, model, null, !1, 0, abortSet);
|
|
890
|
+
pingedTasks.push(type);
|
|
784
891
|
}
|
|
785
|
-
function noop() {}
|
|
786
892
|
var currentRequest = null;
|
|
787
893
|
function resolveRequest() {
|
|
788
894
|
if (currentRequest) return currentRequest;
|
|
@@ -792,9 +898,10 @@ function resolveRequest() {
|
|
|
792
898
|
function serializeThenable(request, task, thenable) {
|
|
793
899
|
var newTask = createTask(
|
|
794
900
|
request,
|
|
795
|
-
|
|
901
|
+
thenable,
|
|
796
902
|
task.keyPath,
|
|
797
903
|
task.implicitSlot,
|
|
904
|
+
task.formatContext,
|
|
798
905
|
request.abortableTasks
|
|
799
906
|
);
|
|
800
907
|
switch (thenable.status) {
|
|
@@ -808,9 +915,11 @@ function serializeThenable(request, task, thenable) {
|
|
|
808
915
|
if (12 === request.status)
|
|
809
916
|
return (
|
|
810
917
|
request.abortableTasks.delete(newTask),
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
918
|
+
21 === request.type
|
|
919
|
+
? (haltTask(newTask), finishHaltedTask(newTask, request))
|
|
920
|
+
: ((task = request.fatalError),
|
|
921
|
+
abortTask(newTask),
|
|
922
|
+
finishAbortedTask(newTask, request, task)),
|
|
814
923
|
newTask.id
|
|
815
924
|
);
|
|
816
925
|
"string" !== typeof thenable.status &&
|
|
@@ -841,39 +950,48 @@ function serializeThenable(request, task, thenable) {
|
|
|
841
950
|
}
|
|
842
951
|
function serializeReadableStream(request, task, stream) {
|
|
843
952
|
function progress(entry) {
|
|
844
|
-
if (
|
|
953
|
+
if (0 === streamTask.status)
|
|
845
954
|
if (entry.done)
|
|
846
|
-
|
|
955
|
+
(streamTask.status = 1),
|
|
847
956
|
(entry = streamTask.id.toString(16) + ":C\n"),
|
|
848
957
|
request.completedRegularChunks.push(entry),
|
|
958
|
+
request.abortableTasks.delete(streamTask),
|
|
959
|
+
request.cacheController.signal.removeEventListener(
|
|
960
|
+
"abort",
|
|
961
|
+
abortStream
|
|
962
|
+
),
|
|
849
963
|
enqueueFlush(request),
|
|
850
|
-
(
|
|
964
|
+
callOnAllReadyIfReady(request);
|
|
851
965
|
else
|
|
852
966
|
try {
|
|
853
967
|
(streamTask.model = entry.value),
|
|
854
968
|
request.pendingChunks++,
|
|
855
|
-
|
|
969
|
+
tryStreamTask(request, streamTask),
|
|
856
970
|
enqueueFlush(request),
|
|
857
971
|
reader.read().then(progress, error);
|
|
858
|
-
} catch (x$
|
|
859
|
-
error(x$
|
|
972
|
+
} catch (x$8) {
|
|
973
|
+
error(x$8);
|
|
860
974
|
}
|
|
861
975
|
}
|
|
862
976
|
function error(reason) {
|
|
863
|
-
|
|
864
|
-
((
|
|
865
|
-
request.abortListeners.delete(abortStream),
|
|
977
|
+
0 === streamTask.status &&
|
|
978
|
+
(request.cacheController.signal.removeEventListener("abort", abortStream),
|
|
866
979
|
erroredTask(request, streamTask, reason),
|
|
867
980
|
enqueueFlush(request),
|
|
868
981
|
reader.cancel(reason).then(error, error));
|
|
869
982
|
}
|
|
870
|
-
function abortStream(
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
983
|
+
function abortStream() {
|
|
984
|
+
if (0 === streamTask.status) {
|
|
985
|
+
var signal = request.cacheController.signal;
|
|
986
|
+
signal.removeEventListener("abort", abortStream);
|
|
987
|
+
signal = signal.reason;
|
|
988
|
+
21 === request.type
|
|
989
|
+
? (request.abortableTasks.delete(streamTask),
|
|
990
|
+
haltTask(streamTask),
|
|
991
|
+
finishHaltedTask(streamTask, request))
|
|
992
|
+
: (erroredTask(request, streamTask, signal), enqueueFlush(request));
|
|
993
|
+
reader.cancel(signal).then(error, error);
|
|
994
|
+
}
|
|
877
995
|
}
|
|
878
996
|
var supportsBYOB = stream.supportsBYOB;
|
|
879
997
|
if (void 0 === supportsBYOB)
|
|
@@ -888,27 +1006,30 @@ function serializeReadableStream(request, task, stream) {
|
|
|
888
1006
|
task.model,
|
|
889
1007
|
task.keyPath,
|
|
890
1008
|
task.implicitSlot,
|
|
1009
|
+
task.formatContext,
|
|
891
1010
|
request.abortableTasks
|
|
892
1011
|
);
|
|
893
|
-
request.abortableTasks.delete(streamTask);
|
|
894
1012
|
request.pendingChunks++;
|
|
895
1013
|
task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
|
|
896
1014
|
request.completedRegularChunks.push(task);
|
|
897
|
-
|
|
898
|
-
request.abortListeners.add(abortStream);
|
|
1015
|
+
request.cacheController.signal.addEventListener("abort", abortStream);
|
|
899
1016
|
reader.read().then(progress, error);
|
|
900
1017
|
return serializeByValueID(streamTask.id);
|
|
901
1018
|
}
|
|
902
1019
|
function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
903
1020
|
function progress(entry) {
|
|
904
|
-
if (
|
|
1021
|
+
if (0 === streamTask.status)
|
|
905
1022
|
if (entry.done) {
|
|
906
|
-
|
|
1023
|
+
streamTask.status = 1;
|
|
907
1024
|
if (void 0 === entry.value)
|
|
908
1025
|
var endStreamRow = streamTask.id.toString(16) + ":C\n";
|
|
909
1026
|
else
|
|
910
1027
|
try {
|
|
911
|
-
var chunkId =
|
|
1028
|
+
var chunkId = outlineModelWithFormatContext(
|
|
1029
|
+
request,
|
|
1030
|
+
entry.value,
|
|
1031
|
+
0
|
|
1032
|
+
);
|
|
912
1033
|
endStreamRow =
|
|
913
1034
|
streamTask.id.toString(16) +
|
|
914
1035
|
":C" +
|
|
@@ -919,36 +1040,49 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
919
1040
|
return;
|
|
920
1041
|
}
|
|
921
1042
|
request.completedRegularChunks.push(endStreamRow);
|
|
1043
|
+
request.abortableTasks.delete(streamTask);
|
|
1044
|
+
request.cacheController.signal.removeEventListener(
|
|
1045
|
+
"abort",
|
|
1046
|
+
abortIterable
|
|
1047
|
+
);
|
|
922
1048
|
enqueueFlush(request);
|
|
923
|
-
|
|
1049
|
+
callOnAllReadyIfReady(request);
|
|
924
1050
|
} else
|
|
925
1051
|
try {
|
|
926
1052
|
(streamTask.model = entry.value),
|
|
927
1053
|
request.pendingChunks++,
|
|
928
|
-
|
|
1054
|
+
tryStreamTask(request, streamTask),
|
|
929
1055
|
enqueueFlush(request),
|
|
930
1056
|
iterator.next().then(progress, error);
|
|
931
|
-
} catch (x$
|
|
932
|
-
error(x$
|
|
1057
|
+
} catch (x$9) {
|
|
1058
|
+
error(x$9);
|
|
933
1059
|
}
|
|
934
1060
|
}
|
|
935
1061
|
function error(reason) {
|
|
936
|
-
|
|
937
|
-
((
|
|
938
|
-
|
|
1062
|
+
0 === streamTask.status &&
|
|
1063
|
+
(request.cacheController.signal.removeEventListener(
|
|
1064
|
+
"abort",
|
|
1065
|
+
abortIterable
|
|
1066
|
+
),
|
|
939
1067
|
erroredTask(request, streamTask, reason),
|
|
940
1068
|
enqueueFlush(request),
|
|
941
1069
|
"function" === typeof iterator.throw &&
|
|
942
1070
|
iterator.throw(reason).then(error, error));
|
|
943
1071
|
}
|
|
944
|
-
function abortIterable(
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1072
|
+
function abortIterable() {
|
|
1073
|
+
if (0 === streamTask.status) {
|
|
1074
|
+
var signal = request.cacheController.signal;
|
|
1075
|
+
signal.removeEventListener("abort", abortIterable);
|
|
1076
|
+
var reason = signal.reason;
|
|
1077
|
+
21 === request.type
|
|
1078
|
+
? (request.abortableTasks.delete(streamTask),
|
|
1079
|
+
haltTask(streamTask),
|
|
1080
|
+
finishHaltedTask(streamTask, request))
|
|
1081
|
+
: (erroredTask(request, streamTask, signal.reason),
|
|
1082
|
+
enqueueFlush(request));
|
|
950
1083
|
"function" === typeof iterator.throw &&
|
|
951
|
-
iterator.throw(reason).then(error, error)
|
|
1084
|
+
iterator.throw(reason).then(error, error);
|
|
1085
|
+
}
|
|
952
1086
|
}
|
|
953
1087
|
iterable = iterable === iterator;
|
|
954
1088
|
var streamTask = createTask(
|
|
@@ -956,14 +1090,13 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
956
1090
|
task.model,
|
|
957
1091
|
task.keyPath,
|
|
958
1092
|
task.implicitSlot,
|
|
1093
|
+
task.formatContext,
|
|
959
1094
|
request.abortableTasks
|
|
960
1095
|
);
|
|
961
|
-
request.abortableTasks.delete(streamTask);
|
|
962
1096
|
request.pendingChunks++;
|
|
963
1097
|
task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
|
|
964
1098
|
request.completedRegularChunks.push(task);
|
|
965
|
-
|
|
966
|
-
request.abortListeners.add(abortIterable);
|
|
1099
|
+
request.cacheController.signal.addEventListener("abort", abortIterable);
|
|
967
1100
|
iterator.next().then(progress, error);
|
|
968
1101
|
return serializeByValueID(streamTask.id);
|
|
969
1102
|
}
|
|
@@ -977,9 +1110,10 @@ function readThenable(thenable) {
|
|
|
977
1110
|
if ("rejected" === thenable.status) throw thenable.reason;
|
|
978
1111
|
throw thenable;
|
|
979
1112
|
}
|
|
980
|
-
function createLazyWrapperAroundWakeable(wakeable) {
|
|
1113
|
+
function createLazyWrapperAroundWakeable(request, task, wakeable) {
|
|
981
1114
|
switch (wakeable.status) {
|
|
982
1115
|
case "fulfilled":
|
|
1116
|
+
return wakeable.value;
|
|
983
1117
|
case "rejected":
|
|
984
1118
|
break;
|
|
985
1119
|
default:
|
|
@@ -1008,9 +1142,7 @@ function processServerComponentReturnValue(request, task, Component, result) {
|
|
|
1008
1142
|
)
|
|
1009
1143
|
return result;
|
|
1010
1144
|
if ("function" === typeof result.then)
|
|
1011
|
-
return
|
|
1012
|
-
? result.value
|
|
1013
|
-
: createLazyWrapperAroundWakeable(result);
|
|
1145
|
+
return createLazyWrapperAroundWakeable(request, task, result);
|
|
1014
1146
|
var iteratorFn = getIteratorFn(result);
|
|
1015
1147
|
return iteratorFn
|
|
1016
1148
|
? ((request = {}),
|
|
@@ -1065,6 +1197,19 @@ function renderFragment(request, task, children) {
|
|
|
1065
1197
|
task.implicitSlot ? [request] : request)
|
|
1066
1198
|
: children;
|
|
1067
1199
|
}
|
|
1200
|
+
var serializedSize = 0;
|
|
1201
|
+
function deferTask(request, task) {
|
|
1202
|
+
task = createTask(
|
|
1203
|
+
request,
|
|
1204
|
+
task.model,
|
|
1205
|
+
task.keyPath,
|
|
1206
|
+
task.implicitSlot,
|
|
1207
|
+
task.formatContext,
|
|
1208
|
+
request.abortableTasks
|
|
1209
|
+
);
|
|
1210
|
+
pingTask(request, task);
|
|
1211
|
+
return serializeLazyID(task.id);
|
|
1212
|
+
}
|
|
1068
1213
|
function renderElement(request, task, type, key, ref, props) {
|
|
1069
1214
|
if (null !== ref && void 0 !== ref)
|
|
1070
1215
|
throw Error(
|
|
@@ -1106,6 +1251,13 @@ function renderElement(request, task, type, key, ref, props) {
|
|
|
1106
1251
|
case REACT_MEMO_TYPE:
|
|
1107
1252
|
return renderElement(request, task, type.type, key, ref, props);
|
|
1108
1253
|
}
|
|
1254
|
+
else
|
|
1255
|
+
"string" === typeof type &&
|
|
1256
|
+
((ref = task.formatContext),
|
|
1257
|
+
(init = getChildFormatContext(ref, type, props)),
|
|
1258
|
+
ref !== init &&
|
|
1259
|
+
null != props.children &&
|
|
1260
|
+
outlineModelWithFormatContext(request, props.children, init));
|
|
1109
1261
|
request = key;
|
|
1110
1262
|
key = task.keyPath;
|
|
1111
1263
|
null === request
|
|
@@ -1128,7 +1280,14 @@ function pingTask(request, task) {
|
|
|
1128
1280
|
return performWork(request);
|
|
1129
1281
|
}));
|
|
1130
1282
|
}
|
|
1131
|
-
function createTask(
|
|
1283
|
+
function createTask(
|
|
1284
|
+
request,
|
|
1285
|
+
model,
|
|
1286
|
+
keyPath,
|
|
1287
|
+
implicitSlot,
|
|
1288
|
+
formatContext,
|
|
1289
|
+
abortSet
|
|
1290
|
+
) {
|
|
1132
1291
|
request.pendingChunks++;
|
|
1133
1292
|
var id = request.nextChunkId++;
|
|
1134
1293
|
"object" !== typeof model ||
|
|
@@ -1142,10 +1301,12 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1142
1301
|
model: model,
|
|
1143
1302
|
keyPath: keyPath,
|
|
1144
1303
|
implicitSlot: implicitSlot,
|
|
1304
|
+
formatContext: formatContext,
|
|
1145
1305
|
ping: function () {
|
|
1146
1306
|
return pingTask(request, task);
|
|
1147
1307
|
},
|
|
1148
1308
|
toJSON: function (parentPropertyName, value) {
|
|
1309
|
+
serializedSize += parentPropertyName.length;
|
|
1149
1310
|
var prevKeyPath = task.keyPath,
|
|
1150
1311
|
prevImplicitSlot = task.implicitSlot;
|
|
1151
1312
|
try {
|
|
@@ -1167,10 +1328,16 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1167
1328
|
12 === request.status)
|
|
1168
1329
|
)
|
|
1169
1330
|
(task.status = 3),
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1331
|
+
21 === request.type
|
|
1332
|
+
? ((prevKeyPath = request.nextChunkId++),
|
|
1333
|
+
(prevKeyPath = parentPropertyName
|
|
1334
|
+
? serializeLazyID(prevKeyPath)
|
|
1335
|
+
: serializeByValueID(prevKeyPath)),
|
|
1336
|
+
(JSCompiler_inline_result = prevKeyPath))
|
|
1337
|
+
: ((prevKeyPath = request.fatalError),
|
|
1338
|
+
(JSCompiler_inline_result = parentPropertyName
|
|
1339
|
+
? serializeLazyID(prevKeyPath)
|
|
1340
|
+
: serializeByValueID(prevKeyPath)));
|
|
1174
1341
|
else if (
|
|
1175
1342
|
((value =
|
|
1176
1343
|
thrownValue === SuspenseException
|
|
@@ -1185,6 +1352,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1185
1352
|
task.model,
|
|
1186
1353
|
task.keyPath,
|
|
1187
1354
|
task.implicitSlot,
|
|
1355
|
+
task.formatContext,
|
|
1188
1356
|
request.abortableTasks
|
|
1189
1357
|
);
|
|
1190
1358
|
var ping = JSCompiler_inline_result.ping;
|
|
@@ -1194,7 +1362,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1194
1362
|
task.keyPath = prevKeyPath;
|
|
1195
1363
|
task.implicitSlot = prevImplicitSlot;
|
|
1196
1364
|
JSCompiler_inline_result = parentPropertyName
|
|
1197
|
-
?
|
|
1365
|
+
? serializeLazyID(JSCompiler_inline_result.id)
|
|
1198
1366
|
: serializeByValueID(JSCompiler_inline_result.id);
|
|
1199
1367
|
} else
|
|
1200
1368
|
(task.keyPath = prevKeyPath),
|
|
@@ -1204,7 +1372,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1204
1372
|
(prevImplicitSlot = logRecoverableError(request, value, task)),
|
|
1205
1373
|
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
|
1206
1374
|
(JSCompiler_inline_result = parentPropertyName
|
|
1207
|
-
?
|
|
1375
|
+
? serializeLazyID(prevKeyPath)
|
|
1208
1376
|
: serializeByValueID(prevKeyPath));
|
|
1209
1377
|
}
|
|
1210
1378
|
return JSCompiler_inline_result;
|
|
@@ -1217,6 +1385,9 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
|
1217
1385
|
function serializeByValueID(id) {
|
|
1218
1386
|
return "$" + id.toString(16);
|
|
1219
1387
|
}
|
|
1388
|
+
function serializeLazyID(id) {
|
|
1389
|
+
return "$L" + id.toString(16);
|
|
1390
|
+
}
|
|
1220
1391
|
function encodeReferenceChunk(request, id, reference) {
|
|
1221
1392
|
request = stringify(reference);
|
|
1222
1393
|
return id.toString(16) + ":" + request + "\n";
|
|
@@ -1234,7 +1405,7 @@ function serializeClientReference(
|
|
|
1234
1405
|
existingId = writtenClientReferences.get(clientReferenceKey);
|
|
1235
1406
|
if (void 0 !== existingId)
|
|
1236
1407
|
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
|
1237
|
-
?
|
|
1408
|
+
? serializeLazyID(existingId)
|
|
1238
1409
|
: serializeByValueID(existingId);
|
|
1239
1410
|
try {
|
|
1240
1411
|
var config = request.bundlerConfig,
|
|
@@ -1271,7 +1442,7 @@ function serializeClientReference(
|
|
|
1271
1442
|
request.completedImportChunks.push(processedChunk);
|
|
1272
1443
|
writtenClientReferences.set(clientReferenceKey, importId);
|
|
1273
1444
|
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
|
1274
|
-
?
|
|
1445
|
+
? serializeLazyID(importId)
|
|
1275
1446
|
: serializeByValueID(importId);
|
|
1276
1447
|
} catch (x) {
|
|
1277
1448
|
return (
|
|
@@ -1283,23 +1454,29 @@ function serializeClientReference(
|
|
|
1283
1454
|
);
|
|
1284
1455
|
}
|
|
1285
1456
|
}
|
|
1286
|
-
function
|
|
1287
|
-
value = createTask(
|
|
1457
|
+
function outlineModelWithFormatContext(request, value, formatContext) {
|
|
1458
|
+
value = createTask(
|
|
1459
|
+
request,
|
|
1460
|
+
value,
|
|
1461
|
+
null,
|
|
1462
|
+
!1,
|
|
1463
|
+
formatContext,
|
|
1464
|
+
request.abortableTasks
|
|
1465
|
+
);
|
|
1288
1466
|
retryTask(request, value);
|
|
1289
1467
|
return value.id;
|
|
1290
1468
|
}
|
|
1291
1469
|
function serializeTypedArray(request, tag, typedArray) {
|
|
1292
1470
|
request.pendingChunks++;
|
|
1293
1471
|
var bufferId = request.nextChunkId++;
|
|
1294
|
-
emitTypedArrayChunk(request, bufferId, tag, typedArray);
|
|
1472
|
+
emitTypedArrayChunk(request, bufferId, tag, typedArray, !1);
|
|
1295
1473
|
return serializeByValueID(bufferId);
|
|
1296
1474
|
}
|
|
1297
1475
|
function serializeBlob(request, blob) {
|
|
1298
1476
|
function progress(entry) {
|
|
1299
|
-
if (
|
|
1477
|
+
if (0 === newTask.status)
|
|
1300
1478
|
if (entry.done)
|
|
1301
|
-
request.
|
|
1302
|
-
(aborted = !0),
|
|
1479
|
+
request.cacheController.signal.removeEventListener("abort", abortBlob),
|
|
1303
1480
|
pingTask(request, newTask);
|
|
1304
1481
|
else
|
|
1305
1482
|
return (
|
|
@@ -1307,26 +1484,29 @@ function serializeBlob(request, blob) {
|
|
|
1307
1484
|
);
|
|
1308
1485
|
}
|
|
1309
1486
|
function error(reason) {
|
|
1310
|
-
|
|
1311
|
-
((
|
|
1312
|
-
request.abortListeners.delete(abortBlob),
|
|
1487
|
+
0 === newTask.status &&
|
|
1488
|
+
(request.cacheController.signal.removeEventListener("abort", abortBlob),
|
|
1313
1489
|
erroredTask(request, newTask, reason),
|
|
1314
1490
|
enqueueFlush(request),
|
|
1315
1491
|
reader.cancel(reason).then(error, error));
|
|
1316
1492
|
}
|
|
1317
|
-
function abortBlob(
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1493
|
+
function abortBlob() {
|
|
1494
|
+
if (0 === newTask.status) {
|
|
1495
|
+
var signal = request.cacheController.signal;
|
|
1496
|
+
signal.removeEventListener("abort", abortBlob);
|
|
1497
|
+
signal = signal.reason;
|
|
1498
|
+
21 === request.type
|
|
1499
|
+
? (request.abortableTasks.delete(newTask),
|
|
1500
|
+
haltTask(newTask),
|
|
1501
|
+
finishHaltedTask(newTask, request))
|
|
1502
|
+
: (erroredTask(request, newTask, signal), enqueueFlush(request));
|
|
1503
|
+
reader.cancel(signal).then(error, error);
|
|
1504
|
+
}
|
|
1324
1505
|
}
|
|
1325
1506
|
var model = [blob.type],
|
|
1326
|
-
newTask = createTask(request, model, null, !1, request.abortableTasks),
|
|
1327
|
-
reader = blob.stream().getReader()
|
|
1328
|
-
|
|
1329
|
-
request.abortListeners.add(abortBlob);
|
|
1507
|
+
newTask = createTask(request, model, null, !1, 0, request.abortableTasks),
|
|
1508
|
+
reader = blob.stream().getReader();
|
|
1509
|
+
request.cacheController.signal.addEventListener("abort", abortBlob);
|
|
1330
1510
|
reader.read().then(progress).catch(error);
|
|
1331
1511
|
return "$B" + newTask.id.toString(16);
|
|
1332
1512
|
}
|
|
@@ -1358,6 +1538,7 @@ function renderModelDestructive(
|
|
|
1358
1538
|
((elementReference = parent + ":" + parentPropertyName),
|
|
1359
1539
|
writtenObjects.set(value, elementReference)));
|
|
1360
1540
|
}
|
|
1541
|
+
if (3200 < serializedSize) return deferTask(request, task);
|
|
1361
1542
|
parentPropertyName = value.props;
|
|
1362
1543
|
parent = parentPropertyName.ref;
|
|
1363
1544
|
request = renderElement(
|
|
@@ -1375,6 +1556,7 @@ function renderModelDestructive(
|
|
|
1375
1556
|
writtenObjects.set(request, elementReference));
|
|
1376
1557
|
return request;
|
|
1377
1558
|
case REACT_LAZY_TYPE:
|
|
1559
|
+
if (3200 < serializedSize) return deferTask(request, task);
|
|
1378
1560
|
task.thenableState = null;
|
|
1379
1561
|
parentPropertyName = value._init;
|
|
1380
1562
|
value = parentPropertyName(value._payload);
|
|
@@ -1412,8 +1594,11 @@ function renderModelDestructive(
|
|
|
1412
1594
|
return request;
|
|
1413
1595
|
}
|
|
1414
1596
|
if (void 0 !== writtenObjects)
|
|
1415
|
-
if (modelRoot === value)
|
|
1416
|
-
|
|
1597
|
+
if (modelRoot === value) {
|
|
1598
|
+
if (writtenObjects !== serializeByValueID(task.id))
|
|
1599
|
+
return writtenObjects;
|
|
1600
|
+
modelRoot = null;
|
|
1601
|
+
} else return writtenObjects;
|
|
1417
1602
|
else if (
|
|
1418
1603
|
-1 === parentPropertyName.indexOf(":") &&
|
|
1419
1604
|
((writtenObjects = elementReference.get(parent)),
|
|
@@ -1440,17 +1625,17 @@ function renderModelDestructive(
|
|
|
1440
1625
|
if (value instanceof Map)
|
|
1441
1626
|
return (
|
|
1442
1627
|
(value = Array.from(value)),
|
|
1443
|
-
"$Q" +
|
|
1628
|
+
"$Q" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1444
1629
|
);
|
|
1445
1630
|
if (value instanceof Set)
|
|
1446
1631
|
return (
|
|
1447
1632
|
(value = Array.from(value)),
|
|
1448
|
-
"$W" +
|
|
1633
|
+
"$W" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1449
1634
|
);
|
|
1450
1635
|
if ("function" === typeof FormData && value instanceof FormData)
|
|
1451
1636
|
return (
|
|
1452
1637
|
(value = Array.from(value.entries())),
|
|
1453
|
-
"$K" +
|
|
1638
|
+
"$K" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1454
1639
|
);
|
|
1455
1640
|
if (value instanceof Error) return "$Z";
|
|
1456
1641
|
if (value instanceof ArrayBuffer)
|
|
@@ -1485,8 +1670,9 @@ function renderModelDestructive(
|
|
|
1485
1670
|
return (
|
|
1486
1671
|
(parentPropertyName = elementReference.call(value)),
|
|
1487
1672
|
parentPropertyName === value
|
|
1488
|
-
?
|
|
1489
|
-
|
|
1673
|
+
? ((value = Array.from(parentPropertyName)),
|
|
1674
|
+
"$i" +
|
|
1675
|
+
outlineModelWithFormatContext(request, value, 0).toString(16))
|
|
1490
1676
|
: renderFragment(request, task, Array.from(parentPropertyName))
|
|
1491
1677
|
);
|
|
1492
1678
|
if ("function" === typeof ReadableStream && value instanceof ReadableStream)
|
|
@@ -1524,6 +1710,7 @@ function renderModelDestructive(
|
|
|
1524
1710
|
return value;
|
|
1525
1711
|
}
|
|
1526
1712
|
if ("string" === typeof value) {
|
|
1713
|
+
serializedSize += value.length;
|
|
1527
1714
|
if (
|
|
1528
1715
|
"Z" === value[value.length - 1] &&
|
|
1529
1716
|
parent[parentPropertyName] instanceof Date
|
|
@@ -1533,7 +1720,7 @@ function renderModelDestructive(
|
|
|
1533
1720
|
return (
|
|
1534
1721
|
request.pendingChunks++,
|
|
1535
1722
|
(task = request.nextChunkId++),
|
|
1536
|
-
emitTextChunk(request, task, value),
|
|
1723
|
+
emitTextChunk(request, task, value, !1),
|
|
1537
1724
|
serializeByValueID(task)
|
|
1538
1725
|
);
|
|
1539
1726
|
request = "$" === value[0] ? "$" + value : value;
|
|
@@ -1570,10 +1757,11 @@ function renderModelDestructive(
|
|
|
1570
1757
|
null === parentPropertyName
|
|
1571
1758
|
? null
|
|
1572
1759
|
: Promise.resolve(parentPropertyName)),
|
|
1573
|
-
(request =
|
|
1574
|
-
|
|
1575
|
-
bound: parentPropertyName
|
|
1576
|
-
|
|
1760
|
+
(request = outlineModelWithFormatContext(
|
|
1761
|
+
request,
|
|
1762
|
+
{ id: value.$$id, bound: parentPropertyName },
|
|
1763
|
+
0
|
|
1764
|
+
)),
|
|
1577
1765
|
task.set(value, request),
|
|
1578
1766
|
(request = "$F" + request.toString(16))),
|
|
1579
1767
|
request
|
|
@@ -1651,80 +1839,83 @@ function fatalError(request, error) {
|
|
|
1651
1839
|
null !== request.destination
|
|
1652
1840
|
? ((request.status = 14), request.destination.destroy(error))
|
|
1653
1841
|
: ((request.status = 13), (request.fatalError = error));
|
|
1842
|
+
request.cacheController.abort(
|
|
1843
|
+
Error("The render was aborted due to a fatal error.", { cause: error })
|
|
1844
|
+
);
|
|
1654
1845
|
}
|
|
1655
1846
|
function emitErrorChunk(request, id, digest) {
|
|
1656
1847
|
digest = { digest: digest };
|
|
1657
1848
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
|
1658
1849
|
request.completedErrorChunks.push(id);
|
|
1659
1850
|
}
|
|
1660
|
-
function
|
|
1661
|
-
|
|
1662
|
-
request.completedRegularChunks.push(id);
|
|
1663
|
-
}
|
|
1664
|
-
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
|
1665
|
-
request.pendingChunks++;
|
|
1851
|
+
function emitTypedArrayChunk(request, id, tag, typedArray, debug) {
|
|
1852
|
+
debug ? request.pendingDebugChunks++ : request.pendingChunks++;
|
|
1666
1853
|
typedArray = new Uint8Array(
|
|
1667
1854
|
typedArray.buffer,
|
|
1668
1855
|
typedArray.byteOffset,
|
|
1669
1856
|
typedArray.byteLength
|
|
1670
1857
|
);
|
|
1671
|
-
|
|
1672
|
-
id = id.toString(16) + ":" + tag +
|
|
1858
|
+
debug = typedArray.byteLength;
|
|
1859
|
+
id = id.toString(16) + ":" + tag + debug.toString(16) + ",";
|
|
1673
1860
|
request.completedRegularChunks.push(id, typedArray);
|
|
1674
1861
|
}
|
|
1675
|
-
function emitTextChunk(request, id, text) {
|
|
1862
|
+
function emitTextChunk(request, id, text, debug) {
|
|
1676
1863
|
if (null === byteLengthOfChunk)
|
|
1677
1864
|
throw Error(
|
|
1678
1865
|
"Existence of byteLengthOfChunk should have already been checked. This is a bug in React."
|
|
1679
1866
|
);
|
|
1680
|
-
request.pendingChunks++;
|
|
1681
|
-
|
|
1682
|
-
id = id.toString(16) + ":T" +
|
|
1867
|
+
debug ? request.pendingDebugChunks++ : request.pendingChunks++;
|
|
1868
|
+
debug = byteLengthOfChunk(text);
|
|
1869
|
+
id = id.toString(16) + ":T" + debug.toString(16) + ",";
|
|
1683
1870
|
request.completedRegularChunks.push(id, text);
|
|
1684
1871
|
}
|
|
1685
1872
|
function emitChunk(request, task, value) {
|
|
1686
1873
|
var id = task.id;
|
|
1687
1874
|
"string" === typeof value && null !== byteLengthOfChunk
|
|
1688
|
-
? emitTextChunk(request, id, value)
|
|
1875
|
+
? emitTextChunk(request, id, value, !1)
|
|
1689
1876
|
: value instanceof ArrayBuffer
|
|
1690
|
-
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
|
|
1877
|
+
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value), !1)
|
|
1691
1878
|
: value instanceof Int8Array
|
|
1692
|
-
? emitTypedArrayChunk(request, id, "O", value)
|
|
1879
|
+
? emitTypedArrayChunk(request, id, "O", value, !1)
|
|
1693
1880
|
: value instanceof Uint8Array
|
|
1694
|
-
? emitTypedArrayChunk(request, id, "o", value)
|
|
1881
|
+
? emitTypedArrayChunk(request, id, "o", value, !1)
|
|
1695
1882
|
: value instanceof Uint8ClampedArray
|
|
1696
|
-
? emitTypedArrayChunk(request, id, "U", value)
|
|
1883
|
+
? emitTypedArrayChunk(request, id, "U", value, !1)
|
|
1697
1884
|
: value instanceof Int16Array
|
|
1698
|
-
? emitTypedArrayChunk(request, id, "S", value)
|
|
1885
|
+
? emitTypedArrayChunk(request, id, "S", value, !1)
|
|
1699
1886
|
: value instanceof Uint16Array
|
|
1700
|
-
? emitTypedArrayChunk(request, id, "s", value)
|
|
1887
|
+
? emitTypedArrayChunk(request, id, "s", value, !1)
|
|
1701
1888
|
: value instanceof Int32Array
|
|
1702
|
-
? emitTypedArrayChunk(request, id, "L", value)
|
|
1889
|
+
? emitTypedArrayChunk(request, id, "L", value, !1)
|
|
1703
1890
|
: value instanceof Uint32Array
|
|
1704
|
-
? emitTypedArrayChunk(request, id, "l", value)
|
|
1891
|
+
? emitTypedArrayChunk(request, id, "l", value, !1)
|
|
1705
1892
|
: value instanceof Float32Array
|
|
1706
|
-
? emitTypedArrayChunk(request, id, "G", value)
|
|
1893
|
+
? emitTypedArrayChunk(request, id, "G", value, !1)
|
|
1707
1894
|
: value instanceof Float64Array
|
|
1708
|
-
? emitTypedArrayChunk(request, id, "g", value)
|
|
1895
|
+
? emitTypedArrayChunk(request, id, "g", value, !1)
|
|
1709
1896
|
: value instanceof BigInt64Array
|
|
1710
|
-
? emitTypedArrayChunk(request, id, "M", value)
|
|
1897
|
+
? emitTypedArrayChunk(request, id, "M", value, !1)
|
|
1711
1898
|
: value instanceof BigUint64Array
|
|
1712
|
-
? emitTypedArrayChunk(request, id, "m", value)
|
|
1899
|
+
? emitTypedArrayChunk(request, id, "m", value, !1)
|
|
1713
1900
|
: value instanceof DataView
|
|
1714
|
-
? emitTypedArrayChunk(request, id, "V", value)
|
|
1901
|
+
? emitTypedArrayChunk(request, id, "V", value, !1)
|
|
1715
1902
|
: ((value = stringify(value, task.toJSON)),
|
|
1716
|
-
|
|
1903
|
+
(task =
|
|
1904
|
+
task.id.toString(16) + ":" + value + "\n"),
|
|
1905
|
+
request.completedRegularChunks.push(task));
|
|
1717
1906
|
}
|
|
1718
1907
|
function erroredTask(request, task, error) {
|
|
1719
|
-
request.abortableTasks.delete(task);
|
|
1720
1908
|
task.status = 4;
|
|
1721
1909
|
error = logRecoverableError(request, error, task);
|
|
1722
1910
|
emitErrorChunk(request, task.id, error);
|
|
1911
|
+
request.abortableTasks.delete(task);
|
|
1912
|
+
callOnAllReadyIfReady(request);
|
|
1723
1913
|
}
|
|
1724
1914
|
var emptyRoot = {};
|
|
1725
1915
|
function retryTask(request, task) {
|
|
1726
1916
|
if (0 === task.status) {
|
|
1727
1917
|
task.status = 5;
|
|
1918
|
+
var parentSerializedSize = serializedSize;
|
|
1728
1919
|
try {
|
|
1729
1920
|
modelRoot = task.model;
|
|
1730
1921
|
var resolvedModel = renderModelDestructive(
|
|
@@ -1741,18 +1932,27 @@ function retryTask(request, task) {
|
|
|
1741
1932
|
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
|
1742
1933
|
emitChunk(request, task, resolvedModel);
|
|
1743
1934
|
else {
|
|
1744
|
-
var json = stringify(resolvedModel)
|
|
1745
|
-
|
|
1935
|
+
var json = stringify(resolvedModel),
|
|
1936
|
+
processedChunk = task.id.toString(16) + ":" + json + "\n";
|
|
1937
|
+
request.completedRegularChunks.push(processedChunk);
|
|
1746
1938
|
}
|
|
1747
|
-
request.abortableTasks.delete(task);
|
|
1748
1939
|
task.status = 1;
|
|
1940
|
+
request.abortableTasks.delete(task);
|
|
1941
|
+
callOnAllReadyIfReady(request);
|
|
1749
1942
|
} catch (thrownValue) {
|
|
1750
|
-
if (12 === request.status)
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1943
|
+
if (12 === request.status)
|
|
1944
|
+
if (
|
|
1945
|
+
(request.abortableTasks.delete(task),
|
|
1946
|
+
(task.status = 0),
|
|
1947
|
+
21 === request.type)
|
|
1948
|
+
)
|
|
1949
|
+
haltTask(task), finishHaltedTask(task, request);
|
|
1950
|
+
else {
|
|
1951
|
+
var errorId = request.fatalError;
|
|
1952
|
+
abortTask(task);
|
|
1953
|
+
finishAbortedTask(task, request, errorId);
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1756
1956
|
var x =
|
|
1757
1957
|
thrownValue === SuspenseException
|
|
1758
1958
|
? getSuspendedThenable()
|
|
@@ -1769,26 +1969,29 @@ function retryTask(request, task) {
|
|
|
1769
1969
|
} else erroredTask(request, task, x);
|
|
1770
1970
|
}
|
|
1771
1971
|
} finally {
|
|
1972
|
+
serializedSize = parentSerializedSize;
|
|
1772
1973
|
}
|
|
1773
1974
|
}
|
|
1774
1975
|
}
|
|
1976
|
+
function tryStreamTask(request, task) {
|
|
1977
|
+
var parentSerializedSize = serializedSize;
|
|
1978
|
+
try {
|
|
1979
|
+
emitChunk(request, task, task.model);
|
|
1980
|
+
} finally {
|
|
1981
|
+
serializedSize = parentSerializedSize;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1775
1984
|
function performWork(request) {
|
|
1776
1985
|
var prevDispatcher = ReactSharedInternalsServer.H;
|
|
1777
1986
|
ReactSharedInternalsServer.H = HooksDispatcher;
|
|
1778
1987
|
var prevRequest = currentRequest;
|
|
1779
1988
|
currentRequest$1 = currentRequest = request;
|
|
1780
|
-
var hadAbortableTasks = 0 < request.abortableTasks.size;
|
|
1781
1989
|
try {
|
|
1782
1990
|
var pingedTasks = request.pingedTasks;
|
|
1783
1991
|
request.pingedTasks = [];
|
|
1784
1992
|
for (var i = 0; i < pingedTasks.length; i++)
|
|
1785
1993
|
retryTask(request, pingedTasks[i]);
|
|
1786
|
-
|
|
1787
|
-
flushCompletedChunks(request, request.destination);
|
|
1788
|
-
if (hadAbortableTasks && 0 === request.abortableTasks.size) {
|
|
1789
|
-
var onAllReady = request.onAllReady;
|
|
1790
|
-
onAllReady();
|
|
1791
|
-
}
|
|
1994
|
+
flushCompletedChunks(request);
|
|
1792
1995
|
} catch (error) {
|
|
1793
1996
|
logRecoverableError(request, error, null), fatalError(request, error);
|
|
1794
1997
|
} finally {
|
|
@@ -1797,67 +2000,94 @@ function performWork(request) {
|
|
|
1797
2000
|
(currentRequest = prevRequest);
|
|
1798
2001
|
}
|
|
1799
2002
|
}
|
|
1800
|
-
function
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
i
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
)
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
(
|
|
1855
|
-
|
|
1856
|
-
(
|
|
2003
|
+
function abortTask(task) {
|
|
2004
|
+
0 === task.status && (task.status = 3);
|
|
2005
|
+
}
|
|
2006
|
+
function finishAbortedTask(task, request, errorId) {
|
|
2007
|
+
3 === task.status &&
|
|
2008
|
+
((errorId = serializeByValueID(errorId)),
|
|
2009
|
+
(task = encodeReferenceChunk(request, task.id, errorId)),
|
|
2010
|
+
request.completedErrorChunks.push(task));
|
|
2011
|
+
}
|
|
2012
|
+
function haltTask(task) {
|
|
2013
|
+
0 === task.status && (task.status = 3);
|
|
2014
|
+
}
|
|
2015
|
+
function finishHaltedTask(task, request) {
|
|
2016
|
+
3 === task.status && request.pendingChunks--;
|
|
2017
|
+
}
|
|
2018
|
+
function flushCompletedChunks(request) {
|
|
2019
|
+
var destination = request.destination;
|
|
2020
|
+
if (null !== destination) {
|
|
2021
|
+
currentView = new Uint8Array(2048);
|
|
2022
|
+
writtenBytes = 0;
|
|
2023
|
+
destinationHasCapacity = !0;
|
|
2024
|
+
try {
|
|
2025
|
+
for (
|
|
2026
|
+
var importsChunks = request.completedImportChunks, i = 0;
|
|
2027
|
+
i < importsChunks.length;
|
|
2028
|
+
i++
|
|
2029
|
+
)
|
|
2030
|
+
if (
|
|
2031
|
+
(request.pendingChunks--,
|
|
2032
|
+
!writeChunkAndReturn(destination, importsChunks[i]))
|
|
2033
|
+
) {
|
|
2034
|
+
request.destination = null;
|
|
2035
|
+
i++;
|
|
2036
|
+
break;
|
|
2037
|
+
}
|
|
2038
|
+
importsChunks.splice(0, i);
|
|
2039
|
+
var hintChunks = request.completedHintChunks;
|
|
2040
|
+
for (i = 0; i < hintChunks.length; i++)
|
|
2041
|
+
if (!writeChunkAndReturn(destination, hintChunks[i])) {
|
|
2042
|
+
request.destination = null;
|
|
2043
|
+
i++;
|
|
2044
|
+
break;
|
|
2045
|
+
}
|
|
2046
|
+
hintChunks.splice(0, i);
|
|
2047
|
+
var regularChunks = request.completedRegularChunks;
|
|
2048
|
+
for (i = 0; i < regularChunks.length; i++)
|
|
2049
|
+
if (
|
|
2050
|
+
(request.pendingChunks--,
|
|
2051
|
+
!writeChunkAndReturn(destination, regularChunks[i]))
|
|
2052
|
+
) {
|
|
2053
|
+
request.destination = null;
|
|
2054
|
+
i++;
|
|
2055
|
+
break;
|
|
2056
|
+
}
|
|
2057
|
+
regularChunks.splice(0, i);
|
|
2058
|
+
var errorChunks = request.completedErrorChunks;
|
|
2059
|
+
for (i = 0; i < errorChunks.length; i++)
|
|
2060
|
+
if (
|
|
2061
|
+
(request.pendingChunks--,
|
|
2062
|
+
!writeChunkAndReturn(destination, errorChunks[i]))
|
|
2063
|
+
) {
|
|
2064
|
+
request.destination = null;
|
|
2065
|
+
i++;
|
|
2066
|
+
break;
|
|
2067
|
+
}
|
|
2068
|
+
errorChunks.splice(0, i);
|
|
2069
|
+
} finally {
|
|
2070
|
+
(request.flushScheduled = !1),
|
|
2071
|
+
currentView &&
|
|
2072
|
+
0 < writtenBytes &&
|
|
2073
|
+
destination.write(currentView.subarray(0, writtenBytes)),
|
|
2074
|
+
(currentView = null),
|
|
2075
|
+
(writtenBytes = 0),
|
|
2076
|
+
(destinationHasCapacity = !0);
|
|
2077
|
+
}
|
|
2078
|
+
"function" === typeof destination.flush && destination.flush();
|
|
1857
2079
|
}
|
|
1858
|
-
"function" === typeof destination.flush && destination.flush();
|
|
1859
2080
|
0 === request.pendingChunks &&
|
|
1860
|
-
(
|
|
2081
|
+
(12 > request.status &&
|
|
2082
|
+
request.cacheController.abort(
|
|
2083
|
+
Error(
|
|
2084
|
+
"This render completed successfully. All cacheSignals are now aborted to allow clean up of any unused resources."
|
|
2085
|
+
)
|
|
2086
|
+
),
|
|
2087
|
+
null !== request.destination &&
|
|
2088
|
+
((request.status = 14),
|
|
2089
|
+
request.destination.end(),
|
|
2090
|
+
(request.destination = null)));
|
|
1861
2091
|
}
|
|
1862
2092
|
function startWork(request) {
|
|
1863
2093
|
request.flushScheduled = null !== request.destination;
|
|
@@ -1875,72 +2105,97 @@ function enqueueFlush(request) {
|
|
|
1875
2105
|
((request.flushScheduled = !0),
|
|
1876
2106
|
setImmediate(function () {
|
|
1877
2107
|
request.flushScheduled = !1;
|
|
1878
|
-
|
|
1879
|
-
destination && flushCompletedChunks(request, destination);
|
|
2108
|
+
flushCompletedChunks(request);
|
|
1880
2109
|
}));
|
|
1881
2110
|
}
|
|
2111
|
+
function callOnAllReadyIfReady(request) {
|
|
2112
|
+
0 === request.abortableTasks.size &&
|
|
2113
|
+
((request = request.onAllReady), request());
|
|
2114
|
+
}
|
|
1882
2115
|
function startFlowing(request, destination) {
|
|
1883
2116
|
if (13 === request.status)
|
|
1884
2117
|
(request.status = 14), destination.destroy(request.fatalError);
|
|
1885
2118
|
else if (14 !== request.status && null === request.destination) {
|
|
1886
2119
|
request.destination = destination;
|
|
1887
2120
|
try {
|
|
1888
|
-
flushCompletedChunks(request
|
|
2121
|
+
flushCompletedChunks(request);
|
|
1889
2122
|
} catch (error) {
|
|
1890
2123
|
logRecoverableError(request, error, null), fatalError(request, error);
|
|
1891
2124
|
}
|
|
1892
2125
|
}
|
|
1893
2126
|
}
|
|
1894
|
-
function
|
|
2127
|
+
function finishHalt(request, abortedTasks) {
|
|
2128
|
+
try {
|
|
2129
|
+
abortedTasks.forEach(function (task) {
|
|
2130
|
+
return finishHaltedTask(task, request);
|
|
2131
|
+
});
|
|
2132
|
+
var onAllReady = request.onAllReady;
|
|
2133
|
+
onAllReady();
|
|
2134
|
+
flushCompletedChunks(request);
|
|
2135
|
+
} catch (error) {
|
|
2136
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
function finishAbort(request, abortedTasks, errorId) {
|
|
1895
2140
|
try {
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
request.
|
|
1910
|
-
request.
|
|
1911
|
-
|
|
1912
|
-
abortableTasks.
|
|
1913
|
-
if (
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
2141
|
+
abortedTasks.forEach(function (task) {
|
|
2142
|
+
return finishAbortedTask(task, request, errorId);
|
|
2143
|
+
});
|
|
2144
|
+
var onAllReady = request.onAllReady;
|
|
2145
|
+
onAllReady();
|
|
2146
|
+
flushCompletedChunks(request);
|
|
2147
|
+
} catch (error) {
|
|
2148
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
function abort(request, reason) {
|
|
2152
|
+
if (!(11 < request.status))
|
|
2153
|
+
try {
|
|
2154
|
+
request.status = 12;
|
|
2155
|
+
request.cacheController.abort(reason);
|
|
2156
|
+
var abortableTasks = request.abortableTasks;
|
|
2157
|
+
if (0 < abortableTasks.size)
|
|
2158
|
+
if (21 === request.type)
|
|
2159
|
+
abortableTasks.forEach(function (task) {
|
|
2160
|
+
return haltTask(task, request);
|
|
2161
|
+
}),
|
|
2162
|
+
setImmediate(function () {
|
|
2163
|
+
return finishHalt(request, abortableTasks);
|
|
2164
|
+
});
|
|
2165
|
+
else {
|
|
2166
|
+
var error =
|
|
2167
|
+
void 0 === reason
|
|
2168
|
+
? Error(
|
|
2169
|
+
"The render was aborted by the server without a reason."
|
|
2170
|
+
)
|
|
2171
|
+
: "object" === typeof reason &&
|
|
2172
|
+
null !== reason &&
|
|
2173
|
+
"function" === typeof reason.then
|
|
2174
|
+
? Error(
|
|
2175
|
+
"The render was aborted by the server with a promise."
|
|
2176
|
+
)
|
|
2177
|
+
: reason,
|
|
2178
|
+
digest = logRecoverableError(request, error, null),
|
|
2179
|
+
errorId = request.nextChunkId++;
|
|
2180
|
+
request.fatalError = errorId;
|
|
2181
|
+
request.pendingChunks++;
|
|
2182
|
+
emitErrorChunk(request, errorId, digest, error, !1, null);
|
|
2183
|
+
abortableTasks.forEach(function (task) {
|
|
2184
|
+
return abortTask(task, request, errorId);
|
|
2185
|
+
});
|
|
2186
|
+
setImmediate(function () {
|
|
2187
|
+
return finishAbort(request, abortableTasks, errorId);
|
|
2188
|
+
});
|
|
1918
2189
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
void 0 === reason
|
|
1928
|
-
? Error("The render was aborted by the server without a reason.")
|
|
1929
|
-
: "object" === typeof reason &&
|
|
1930
|
-
null !== reason &&
|
|
1931
|
-
"function" === typeof reason.then
|
|
1932
|
-
? Error("The render was aborted by the server with a promise.")
|
|
1933
|
-
: reason;
|
|
1934
|
-
abortListeners.forEach(function (callback) {
|
|
1935
|
-
return callback(error$22);
|
|
1936
|
-
});
|
|
1937
|
-
abortListeners.clear();
|
|
2190
|
+
else {
|
|
2191
|
+
var onAllReady = request.onAllReady;
|
|
2192
|
+
onAllReady();
|
|
2193
|
+
flushCompletedChunks(request);
|
|
2194
|
+
}
|
|
2195
|
+
} catch (error$23) {
|
|
2196
|
+
logRecoverableError(request, error$23, null),
|
|
2197
|
+
fatalError(request, error$23);
|
|
1938
2198
|
}
|
|
1939
|
-
null !== request.destination &&
|
|
1940
|
-
flushCompletedChunks(request, request.destination);
|
|
1941
|
-
} catch (error$23) {
|
|
1942
|
-
logRecoverableError(request, error$23, null), fatalError(request, error$23);
|
|
1943
|
-
}
|
|
1944
2199
|
}
|
|
1945
2200
|
function resolveServerReference(bundlerConfig, id) {
|
|
1946
2201
|
var name = "",
|
|
@@ -2017,7 +2272,6 @@ function requireModule(metadata) {
|
|
|
2017
2272
|
: moduleExports
|
|
2018
2273
|
: moduleExports[metadata[2]];
|
|
2019
2274
|
}
|
|
2020
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2021
2275
|
function Chunk(status, value, reason, response) {
|
|
2022
2276
|
this.status = status;
|
|
2023
2277
|
this.value = value;
|
|
@@ -2679,7 +2933,24 @@ function createCancelHandler(request, reason) {
|
|
|
2679
2933
|
abort(request, Error(reason));
|
|
2680
2934
|
};
|
|
2681
2935
|
}
|
|
2682
|
-
function
|
|
2936
|
+
function createFakeWritableFromReadableStreamController(controller) {
|
|
2937
|
+
return {
|
|
2938
|
+
write: function (chunk) {
|
|
2939
|
+
"string" === typeof chunk && (chunk = textEncoder.encode(chunk));
|
|
2940
|
+
controller.enqueue(chunk);
|
|
2941
|
+
return !0;
|
|
2942
|
+
},
|
|
2943
|
+
end: function () {
|
|
2944
|
+
controller.close();
|
|
2945
|
+
},
|
|
2946
|
+
destroy: function (error) {
|
|
2947
|
+
"function" === typeof controller.error
|
|
2948
|
+
? controller.error(error)
|
|
2949
|
+
: controller.close();
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
}
|
|
2953
|
+
function createFakeWritableFromNodeReadable(readable) {
|
|
2683
2954
|
return {
|
|
2684
2955
|
write: function (chunk) {
|
|
2685
2956
|
return readable.push(chunk);
|
|
@@ -2752,6 +3023,37 @@ exports.decodeReply = function (body, webpackMap, options) {
|
|
|
2752
3023
|
close(body);
|
|
2753
3024
|
return webpackMap;
|
|
2754
3025
|
};
|
|
3026
|
+
exports.decodeReplyFromAsyncIterable = function (
|
|
3027
|
+
iterable,
|
|
3028
|
+
webpackMap,
|
|
3029
|
+
options
|
|
3030
|
+
) {
|
|
3031
|
+
function progress(entry) {
|
|
3032
|
+
if (entry.done) close(response);
|
|
3033
|
+
else {
|
|
3034
|
+
var _entry$value = entry.value;
|
|
3035
|
+
entry = _entry$value[0];
|
|
3036
|
+
_entry$value = _entry$value[1];
|
|
3037
|
+
"string" === typeof _entry$value
|
|
3038
|
+
? resolveField(response, entry, _entry$value)
|
|
3039
|
+
: response._formData.append(entry, _entry$value);
|
|
3040
|
+
iterator.next().then(progress, error);
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
function error(reason) {
|
|
3044
|
+
reportGlobalError(response, reason);
|
|
3045
|
+
"function" === typeof iterator.throw &&
|
|
3046
|
+
iterator.throw(reason).then(error, error);
|
|
3047
|
+
}
|
|
3048
|
+
var iterator = iterable[ASYNC_ITERATOR](),
|
|
3049
|
+
response = createResponse(
|
|
3050
|
+
webpackMap,
|
|
3051
|
+
"",
|
|
3052
|
+
options ? options.temporaryReferences : void 0
|
|
3053
|
+
);
|
|
3054
|
+
iterator.next().then(progress, error);
|
|
3055
|
+
return getChunk(response, 0);
|
|
3056
|
+
};
|
|
2755
3057
|
exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
2756
3058
|
var response = createResponse(
|
|
2757
3059
|
webpackMap,
|
|
@@ -2765,20 +3067,20 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
|
2765
3067
|
? queuedFields.push(name, value)
|
|
2766
3068
|
: resolveField(response, name, value);
|
|
2767
3069
|
});
|
|
2768
|
-
busboyStream.on("file", function (name, value,
|
|
2769
|
-
var filename =
|
|
2770
|
-
mimeType =
|
|
2771
|
-
if ("base64" ===
|
|
3070
|
+
busboyStream.on("file", function (name, value, _ref2) {
|
|
3071
|
+
var filename = _ref2.filename,
|
|
3072
|
+
mimeType = _ref2.mimeType;
|
|
3073
|
+
if ("base64" === _ref2.encoding.toLowerCase())
|
|
2772
3074
|
throw Error(
|
|
2773
3075
|
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
|
|
2774
3076
|
);
|
|
2775
3077
|
pendingFiles++;
|
|
2776
|
-
var
|
|
3078
|
+
var JSCompiler_object_inline_chunks_274 = [];
|
|
2777
3079
|
value.on("data", function (chunk) {
|
|
2778
|
-
|
|
3080
|
+
JSCompiler_object_inline_chunks_274.push(chunk);
|
|
2779
3081
|
});
|
|
2780
3082
|
value.on("end", function () {
|
|
2781
|
-
var blob = new Blob(
|
|
3083
|
+
var blob = new Blob(JSCompiler_object_inline_chunks_274, {
|
|
2782
3084
|
type: mimeType
|
|
2783
3085
|
});
|
|
2784
3086
|
response._formData.append(name, blob, filename);
|
|
@@ -2798,6 +3100,88 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
|
2798
3100
|
});
|
|
2799
3101
|
return getChunk(response, 0);
|
|
2800
3102
|
};
|
|
3103
|
+
exports.prerender = function (model, webpackMap, options) {
|
|
3104
|
+
return new Promise(function (resolve, reject) {
|
|
3105
|
+
var request = new RequestInstance(
|
|
3106
|
+
21,
|
|
3107
|
+
model,
|
|
3108
|
+
webpackMap,
|
|
3109
|
+
options ? options.onError : void 0,
|
|
3110
|
+
options ? options.onPostpone : void 0,
|
|
3111
|
+
function () {
|
|
3112
|
+
var writable,
|
|
3113
|
+
stream = new ReadableStream(
|
|
3114
|
+
{
|
|
3115
|
+
type: "bytes",
|
|
3116
|
+
start: function (controller) {
|
|
3117
|
+
writable =
|
|
3118
|
+
createFakeWritableFromReadableStreamController(controller);
|
|
3119
|
+
},
|
|
3120
|
+
pull: function () {
|
|
3121
|
+
startFlowing(request, writable);
|
|
3122
|
+
},
|
|
3123
|
+
cancel: function (reason) {
|
|
3124
|
+
request.destination = null;
|
|
3125
|
+
abort(request, reason);
|
|
3126
|
+
}
|
|
3127
|
+
},
|
|
3128
|
+
{ highWaterMark: 0 }
|
|
3129
|
+
);
|
|
3130
|
+
resolve({ prelude: stream });
|
|
3131
|
+
},
|
|
3132
|
+
reject,
|
|
3133
|
+
options ? options.identifierPrefix : void 0,
|
|
3134
|
+
options ? options.temporaryReferences : void 0
|
|
3135
|
+
);
|
|
3136
|
+
if (options && options.signal) {
|
|
3137
|
+
var signal = options.signal;
|
|
3138
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3139
|
+
else {
|
|
3140
|
+
var listener = function () {
|
|
3141
|
+
abort(request, signal.reason);
|
|
3142
|
+
signal.removeEventListener("abort", listener);
|
|
3143
|
+
};
|
|
3144
|
+
signal.addEventListener("abort", listener);
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
startWork(request);
|
|
3148
|
+
});
|
|
3149
|
+
};
|
|
3150
|
+
exports.prerenderToNodeStream = function (model, webpackMap, options) {
|
|
3151
|
+
return new Promise(function (resolve, reject) {
|
|
3152
|
+
var request = new RequestInstance(
|
|
3153
|
+
21,
|
|
3154
|
+
model,
|
|
3155
|
+
webpackMap,
|
|
3156
|
+
options ? options.onError : void 0,
|
|
3157
|
+
options ? options.onPostpone : void 0,
|
|
3158
|
+
function () {
|
|
3159
|
+
var readable = new stream.Readable({
|
|
3160
|
+
read: function () {
|
|
3161
|
+
startFlowing(request, writable);
|
|
3162
|
+
}
|
|
3163
|
+
}),
|
|
3164
|
+
writable = createFakeWritableFromNodeReadable(readable);
|
|
3165
|
+
resolve({ prelude: readable });
|
|
3166
|
+
},
|
|
3167
|
+
reject,
|
|
3168
|
+
options ? options.identifierPrefix : void 0,
|
|
3169
|
+
options ? options.temporaryReferences : void 0
|
|
3170
|
+
);
|
|
3171
|
+
if (options && options.signal) {
|
|
3172
|
+
var signal = options.signal;
|
|
3173
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3174
|
+
else {
|
|
3175
|
+
var listener = function () {
|
|
3176
|
+
abort(request, signal.reason);
|
|
3177
|
+
signal.removeEventListener("abort", listener);
|
|
3178
|
+
};
|
|
3179
|
+
signal.addEventListener("abort", listener);
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
startWork(request);
|
|
3183
|
+
});
|
|
3184
|
+
};
|
|
2801
3185
|
exports.registerClientReference = function (
|
|
2802
3186
|
proxyImplementation,
|
|
2803
3187
|
id,
|
|
@@ -2826,13 +3210,11 @@ exports.renderToPipeableStream = function (model, webpackMap, options) {
|
|
|
2826
3210
|
model,
|
|
2827
3211
|
webpackMap,
|
|
2828
3212
|
options ? options.onError : void 0,
|
|
2829
|
-
options ? options.identifierPrefix : void 0,
|
|
2830
3213
|
options ? options.onPostpone : void 0,
|
|
2831
|
-
options ? options.temporaryReferences : void 0,
|
|
2832
|
-
void 0,
|
|
2833
|
-
void 0,
|
|
2834
3214
|
noop,
|
|
2835
|
-
noop
|
|
3215
|
+
noop,
|
|
3216
|
+
options ? options.identifierPrefix : void 0,
|
|
3217
|
+
options ? options.temporaryReferences : void 0
|
|
2836
3218
|
),
|
|
2837
3219
|
hasStartedFlowing = !1;
|
|
2838
3220
|
startWork(request);
|
|
@@ -2863,40 +3245,45 @@ exports.renderToPipeableStream = function (model, webpackMap, options) {
|
|
|
2863
3245
|
}
|
|
2864
3246
|
};
|
|
2865
3247
|
};
|
|
2866
|
-
exports.
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
3248
|
+
exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
3249
|
+
var request = new RequestInstance(
|
|
3250
|
+
20,
|
|
3251
|
+
model,
|
|
3252
|
+
webpackMap,
|
|
3253
|
+
options ? options.onError : void 0,
|
|
3254
|
+
options ? options.onPostpone : void 0,
|
|
3255
|
+
noop,
|
|
3256
|
+
noop,
|
|
3257
|
+
options ? options.identifierPrefix : void 0,
|
|
3258
|
+
options ? options.temporaryReferences : void 0
|
|
3259
|
+
);
|
|
3260
|
+
if (options && options.signal) {
|
|
3261
|
+
var signal = options.signal;
|
|
3262
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3263
|
+
else {
|
|
3264
|
+
var listener = function () {
|
|
3265
|
+
abort(request, signal.reason);
|
|
3266
|
+
signal.removeEventListener("abort", listener);
|
|
3267
|
+
};
|
|
3268
|
+
signal.addEventListener("abort", listener);
|
|
3269
|
+
}
|
|
3270
|
+
}
|
|
3271
|
+
var writable;
|
|
3272
|
+
return new ReadableStream(
|
|
3273
|
+
{
|
|
3274
|
+
type: "bytes",
|
|
3275
|
+
start: function (controller) {
|
|
3276
|
+
writable = createFakeWritableFromReadableStreamController(controller);
|
|
3277
|
+
startWork(request);
|
|
2886
3278
|
},
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
var listener = function () {
|
|
2894
|
-
abort(request, signal.reason);
|
|
2895
|
-
signal.removeEventListener("abort", listener);
|
|
2896
|
-
};
|
|
2897
|
-
signal.addEventListener("abort", listener);
|
|
3279
|
+
pull: function () {
|
|
3280
|
+
startFlowing(request, writable);
|
|
3281
|
+
},
|
|
3282
|
+
cancel: function (reason) {
|
|
3283
|
+
request.destination = null;
|
|
3284
|
+
abort(request, reason);
|
|
2898
3285
|
}
|
|
2899
|
-
}
|
|
2900
|
-
|
|
2901
|
-
|
|
3286
|
+
},
|
|
3287
|
+
{ highWaterMark: 0 }
|
|
3288
|
+
);
|
|
2902
3289
|
};
|