@vitejs/plugin-rsc 0.5.34 → 0.5.36
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/README.md +15 -0
- package/dist/browser.d.ts +1 -1
- package/dist/{cjs-AWVWfddx.js → cjs-DhDj_zQT.js} +2 -2
- package/dist/client-Dq3oGLRS.d.ts +8 -0
- package/dist/{client-reference-DEZtXTv1.d.ts → client-reference-Bk5pzNGN.d.ts} +1 -1
- package/dist/client.node-BEQT2PT-.d.ts +9 -0
- package/dist/client.shared-D1HxyClg.js +10 -0
- package/dist/client.shared-VT232QCM.d.ts +16 -0
- package/dist/core/browser.js +1 -1
- package/dist/core/plugin.d.ts +2 -3
- package/dist/core/rsc.d.ts +1 -1
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +1 -7
- package/dist/core/ssr.js +1 -1
- package/dist/{index-C5IY2S-e.d.ts → index-CROaL0MT.d.ts} +34 -8
- package/dist/index.js +1 -1
- package/dist/{picocolors-391UXIDd.js → picocolors-DibqjEBF.js} +1 -1
- package/dist/{plugin-Cbs9j6lP.js → plugin-Bqv0ikDW.js} +55 -37
- package/dist/plugin.js +1 -1
- package/dist/plugins/cjs.d.ts +2 -3
- package/dist/plugins/cjs.js +1 -1
- package/dist/react/browser.d.ts +10 -10
- package/dist/react/rsc/client.d.ts +1 -1
- package/dist/react/rsc/client.js +2 -5
- package/dist/react/rsc/client.node.d.ts +2 -0
- package/dist/react/rsc/client.node.js +16 -0
- package/dist/react/rsc/server.d.ts +2 -2
- package/dist/react/rsc/server.node.d.ts +3 -0
- package/dist/react/rsc/server.node.js +24 -0
- package/dist/react/rsc/static.d.ts +4 -5
- package/dist/react/rsc/static.node.d.ts +6 -0
- package/dist/react/rsc/static.node.js +11 -0
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/ssr.d.ts +9 -9
- package/dist/react/ssr.node.d.ts +12 -0
- package/dist/react/ssr.node.js +21 -0
- package/dist/rsc/client.d.ts +1 -1
- package/dist/rsc/client.node.d.ts +2 -0
- package/dist/rsc/client.node.js +3 -0
- package/dist/rsc/server.d.ts +5 -5
- package/dist/rsc/server.node.d.ts +19 -0
- package/dist/rsc/server.node.js +13 -0
- package/dist/rsc/static.d.ts +4 -5
- package/dist/rsc/static.node.d.ts +16 -0
- package/dist/rsc/static.node.js +12 -0
- package/dist/{rsc-C3UdJLOW.d.ts → rsc-D8UlANI2.d.ts} +1 -1
- package/dist/rsc.d.ts +3 -3
- package/dist/rsc.node.d.ts +6 -0
- package/dist/rsc.node.js +7 -0
- package/dist/{scope-Bdx33sQv.js → scope-Ck0n25my.js} +2 -4
- package/dist/{server-ZBjqNTqU.d.ts → server-YwgjVtsE.d.ts} +2 -2
- package/dist/server.node-DU77AeKU.d.ts +15 -0
- package/dist/shared-BWJvctW6.js +34 -0
- package/dist/shared-DH8gaClP.js +90 -0
- package/dist/shared-DJBuYpZL.d.ts +20 -0
- package/dist/ssr-C-U7jY5S.d.ts +8 -0
- package/dist/ssr.d.ts +3 -21
- package/dist/ssr.js +1 -87
- package/dist/ssr.node.d.ts +5 -0
- package/dist/ssr.node.js +4 -0
- package/dist/transforms/index.js +67 -60
- package/dist/utils/encryption-runtime.d.ts +3 -4
- package/dist/utils/encryption-runtime.js +4 -2
- package/dist/utils/rpc.d.ts +3 -4
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +909 -495
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +399 -265
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +901 -477
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +380 -219
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +925 -484
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +385 -221
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +726 -388
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +566 -397
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +734 -397
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +477 -238
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +1029 -620
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +481 -261
- package/dist/vendor/react-server-dom/esm/react-server-dom-webpack-node-loader.production.js +2 -2
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/package.json +16 -16
- package/dist/client-Bhch3O41.d.ts +0 -19
- package/dist/dist-uqdtSkzK.js +0 -64
|
@@ -21,9 +21,9 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
|
|
21
21
|
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
22
22
|
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
23
23
|
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
24
|
-
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel")
|
|
25
|
-
Symbol.for("react.
|
|
26
|
-
|
|
24
|
+
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
|
|
25
|
+
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
|
|
26
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
27
27
|
function getIteratorFn(maybeIterable) {
|
|
28
28
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
29
29
|
maybeIterable =
|
|
@@ -31,7 +31,8 @@ function getIteratorFn(maybeIterable) {
|
|
|
31
31
|
maybeIterable["@@iterator"];
|
|
32
32
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
33
33
|
}
|
|
34
|
-
var ASYNC_ITERATOR = Symbol.asyncIterator
|
|
34
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
|
35
|
+
REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key");
|
|
35
36
|
function handleErrorInNextTick(error) {
|
|
36
37
|
setTimeout(function () {
|
|
37
38
|
throw error;
|
|
@@ -48,14 +49,14 @@ var LocalPromise = Promise,
|
|
|
48
49
|
},
|
|
49
50
|
currentView = null,
|
|
50
51
|
writtenBytes = 0;
|
|
51
|
-
function
|
|
52
|
+
function writeChunk(destination, chunk) {
|
|
52
53
|
if (0 !== chunk.byteLength)
|
|
53
|
-
if (
|
|
54
|
+
if (4096 < chunk.byteLength)
|
|
54
55
|
0 < writtenBytes &&
|
|
55
56
|
(destination.enqueue(
|
|
56
57
|
new Uint8Array(currentView.buffer, 0, writtenBytes)
|
|
57
58
|
),
|
|
58
|
-
(currentView = new Uint8Array(
|
|
59
|
+
(currentView = new Uint8Array(4096)),
|
|
59
60
|
(writtenBytes = 0)),
|
|
60
61
|
destination.enqueue(chunk);
|
|
61
62
|
else {
|
|
@@ -66,11 +67,14 @@ function writeChunkAndReturn(destination, chunk) {
|
|
|
66
67
|
: (currentView.set(chunk.subarray(0, allowableBytes), writtenBytes),
|
|
67
68
|
destination.enqueue(currentView),
|
|
68
69
|
(chunk = chunk.subarray(allowableBytes))),
|
|
69
|
-
(currentView = new Uint8Array(
|
|
70
|
+
(currentView = new Uint8Array(4096)),
|
|
70
71
|
(writtenBytes = 0));
|
|
71
72
|
currentView.set(chunk, writtenBytes);
|
|
72
73
|
writtenBytes += chunk.byteLength;
|
|
73
74
|
}
|
|
75
|
+
}
|
|
76
|
+
function writeChunkAndReturn(destination, chunk) {
|
|
77
|
+
writeChunk(destination, chunk);
|
|
74
78
|
return !0;
|
|
75
79
|
}
|
|
76
80
|
var textEncoder = new TextEncoder();
|
|
@@ -121,7 +125,7 @@ var serverReferenceToString = {
|
|
|
121
125
|
},
|
|
122
126
|
PROMISE_PROTOTYPE = Promise.prototype,
|
|
123
127
|
deepProxyHandlers = {
|
|
124
|
-
get: function (target, name) {
|
|
128
|
+
get: function (target, name, receiver) {
|
|
125
129
|
switch (name) {
|
|
126
130
|
case "$$typeof":
|
|
127
131
|
return target.$$typeof;
|
|
@@ -144,9 +148,7 @@ var serverReferenceToString = {
|
|
|
144
148
|
case Symbol.toStringTag:
|
|
145
149
|
return Object.prototype[Symbol.toStringTag];
|
|
146
150
|
case "Provider":
|
|
147
|
-
|
|
148
|
-
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
|
149
|
-
);
|
|
151
|
+
return receiver;
|
|
150
152
|
case "then":
|
|
151
153
|
throw Error(
|
|
152
154
|
"Cannot await or return from a thenable. You cannot await a client module from a server component."
|
|
@@ -477,7 +479,7 @@ function getChildFormatContext(parentContext, type, props) {
|
|
|
477
479
|
});
|
|
478
480
|
break;
|
|
479
481
|
case "stylesheet":
|
|
480
|
-
preload(srcSet, "
|
|
482
|
+
preload(srcSet, "style", {
|
|
481
483
|
crossOrigin: props.crossOrigin,
|
|
482
484
|
integrity: props.integrity,
|
|
483
485
|
nonce: props.nonce,
|
|
@@ -500,7 +502,7 @@ var supportsRequestStorage = "function" === typeof AsyncLocalStorage,
|
|
|
500
502
|
requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null,
|
|
501
503
|
TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
502
504
|
proxyHandlers = {
|
|
503
|
-
get: function (target, name) {
|
|
505
|
+
get: function (target, name, receiver) {
|
|
504
506
|
switch (name) {
|
|
505
507
|
case "$$typeof":
|
|
506
508
|
return target.$$typeof;
|
|
@@ -519,9 +521,7 @@ var supportsRequestStorage = "function" === typeof AsyncLocalStorage,
|
|
|
519
521
|
case Symbol.toStringTag:
|
|
520
522
|
return Object.prototype[Symbol.toStringTag];
|
|
521
523
|
case "Provider":
|
|
522
|
-
|
|
523
|
-
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
|
524
|
-
);
|
|
524
|
+
return receiver;
|
|
525
525
|
case "then":
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
@@ -562,7 +562,12 @@ function trackUsedThenable(thenableState, thenable, index) {
|
|
|
562
562
|
case "fulfilled":
|
|
563
563
|
return thenable.value;
|
|
564
564
|
case "rejected":
|
|
565
|
-
|
|
565
|
+
thenableState = thenable.reason;
|
|
566
|
+
if (void 0 === thenableState && !("reason" in thenable))
|
|
567
|
+
throw Error(
|
|
568
|
+
"A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`."
|
|
569
|
+
);
|
|
570
|
+
throw thenableState;
|
|
566
571
|
default:
|
|
567
572
|
"string" === typeof thenable.status
|
|
568
573
|
? thenable.then(noop, noop)
|
|
@@ -645,9 +650,9 @@ var HooksDispatcher = {
|
|
|
645
650
|
},
|
|
646
651
|
useCacheRefresh: function () {
|
|
647
652
|
return unsupportedRefresh;
|
|
648
|
-
}
|
|
653
|
+
},
|
|
654
|
+
useEffectEvent: unsupportedHook
|
|
649
655
|
};
|
|
650
|
-
HooksDispatcher.useEffectEvent = unsupportedHook;
|
|
651
656
|
function unsupportedHook() {
|
|
652
657
|
throw Error("This Hook is not supported in Server Components.");
|
|
653
658
|
}
|
|
@@ -741,6 +746,8 @@ function describeElementType(type) {
|
|
|
741
746
|
return "Suspense";
|
|
742
747
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
743
748
|
return "SuspenseList";
|
|
749
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
750
|
+
return "ViewTransition";
|
|
744
751
|
}
|
|
745
752
|
if ("object" === typeof type)
|
|
746
753
|
switch (type.$$typeof) {
|
|
@@ -816,7 +823,8 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
|
816
823
|
}
|
|
817
824
|
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
818
825
|
ObjectPrototype$1 = Object.prototype,
|
|
819
|
-
stringify = JSON.stringify
|
|
826
|
+
stringify = JSON.stringify,
|
|
827
|
+
NEXT_TWO_CHUNKS_ARE_ATOMIC = Symbol();
|
|
820
828
|
function defaultErrorHandler(error) {
|
|
821
829
|
console.error(error);
|
|
822
830
|
}
|
|
@@ -825,7 +833,6 @@ function RequestInstance(
|
|
|
825
833
|
model,
|
|
826
834
|
bundlerConfig,
|
|
827
835
|
onError,
|
|
828
|
-
onPostpone,
|
|
829
836
|
onAllReady,
|
|
830
837
|
onFatalError,
|
|
831
838
|
identifierPrefix,
|
|
@@ -859,12 +866,13 @@ function RequestInstance(
|
|
|
859
866
|
this.writtenClientReferences = new Map();
|
|
860
867
|
this.writtenServerReferences = new Map();
|
|
861
868
|
this.writtenObjects = new WeakMap();
|
|
869
|
+
this.writtenImportStrings = new Map();
|
|
870
|
+
this.writtenImportStringsSize = 0;
|
|
862
871
|
this.temporaryReferences = temporaryReferences;
|
|
863
872
|
this.identifierPrefix = identifierPrefix || "";
|
|
864
873
|
this.identifierCount = 1;
|
|
865
874
|
this.taintCleanupQueue = [];
|
|
866
875
|
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
|
867
|
-
this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
|
|
868
876
|
this.onAllReady = onAllReady;
|
|
869
877
|
this.onFatalError = onFatalError;
|
|
870
878
|
type = createTask(this, model, null, !1, 0, abortSet);
|
|
@@ -880,31 +888,52 @@ function resolveRequest() {
|
|
|
880
888
|
return null;
|
|
881
889
|
}
|
|
882
890
|
function serializeThenable(request, task, thenable) {
|
|
883
|
-
var newTask = createTask(
|
|
884
|
-
request,
|
|
885
|
-
thenable,
|
|
886
|
-
task.keyPath,
|
|
887
|
-
task.implicitSlot,
|
|
888
|
-
task.formatContext,
|
|
889
|
-
request.abortableTasks
|
|
890
|
-
);
|
|
891
891
|
switch (thenable.status) {
|
|
892
892
|
case "fulfilled":
|
|
893
893
|
return (
|
|
894
|
-
(
|
|
894
|
+
(task = createTask(
|
|
895
|
+
request,
|
|
896
|
+
thenable,
|
|
897
|
+
task.keyPath,
|
|
898
|
+
task.implicitSlot,
|
|
899
|
+
task.formatContext,
|
|
900
|
+
request.abortableTasks
|
|
901
|
+
)),
|
|
902
|
+
(task.model = thenable.value),
|
|
903
|
+
pingTask(request, task),
|
|
904
|
+
task.id
|
|
895
905
|
);
|
|
896
906
|
case "rejected":
|
|
897
|
-
return
|
|
907
|
+
return (
|
|
908
|
+
(task = createTask(
|
|
909
|
+
request,
|
|
910
|
+
thenable,
|
|
911
|
+
task.keyPath,
|
|
912
|
+
task.implicitSlot,
|
|
913
|
+
task.formatContext,
|
|
914
|
+
request.abortableTasks
|
|
915
|
+
)),
|
|
916
|
+
erroredTask(request, task, thenable.reason),
|
|
917
|
+
task.id
|
|
918
|
+
);
|
|
898
919
|
default:
|
|
920
|
+
var newTask$12 = createTask(
|
|
921
|
+
request,
|
|
922
|
+
thenable,
|
|
923
|
+
task.keyPath,
|
|
924
|
+
task.implicitSlot,
|
|
925
|
+
task.formatContext,
|
|
926
|
+
request.abortableTasks
|
|
927
|
+
);
|
|
899
928
|
if (12 === request.status)
|
|
900
929
|
return (
|
|
901
|
-
request.abortableTasks.delete(newTask),
|
|
930
|
+
request.abortableTasks.delete(newTask$12),
|
|
902
931
|
21 === request.type
|
|
903
|
-
? (haltTask(newTask), finishHaltedTask(newTask, request))
|
|
932
|
+
? (haltTask(newTask$12), finishHaltedTask(newTask$12, request))
|
|
904
933
|
: ((task = request.fatalError),
|
|
905
|
-
abortTask(newTask),
|
|
906
|
-
finishAbortedTask(newTask, request, task)),
|
|
907
|
-
newTask.id
|
|
934
|
+
abortTask(newTask$12),
|
|
935
|
+
finishAbortedTask(newTask$12, request, task)),
|
|
936
|
+
newTask$12.id
|
|
908
937
|
);
|
|
909
938
|
"string" !== typeof thenable.status &&
|
|
910
939
|
((thenable.status = "pending"),
|
|
@@ -919,18 +948,18 @@ function serializeThenable(request, task, thenable) {
|
|
|
919
948
|
((thenable.status = "rejected"), (thenable.reason = error));
|
|
920
949
|
}
|
|
921
950
|
));
|
|
951
|
+
thenable.then(
|
|
952
|
+
function (value) {
|
|
953
|
+
newTask$12.model = value;
|
|
954
|
+
pingTask(request, newTask$12);
|
|
955
|
+
},
|
|
956
|
+
function (reason) {
|
|
957
|
+
0 === newTask$12.status &&
|
|
958
|
+
(erroredTask(request, newTask$12, reason), enqueueFlush(request));
|
|
959
|
+
}
|
|
960
|
+
);
|
|
961
|
+
return newTask$12.id;
|
|
922
962
|
}
|
|
923
|
-
thenable.then(
|
|
924
|
-
function (value) {
|
|
925
|
-
newTask.model = value;
|
|
926
|
-
pingTask(request, newTask);
|
|
927
|
-
},
|
|
928
|
-
function (reason) {
|
|
929
|
-
0 === newTask.status &&
|
|
930
|
-
(erroredTask(request, newTask, reason), enqueueFlush(request));
|
|
931
|
-
}
|
|
932
|
-
);
|
|
933
|
-
return newTask.id;
|
|
934
963
|
}
|
|
935
964
|
function serializeReadableStream(request, task, stream) {
|
|
936
965
|
function progress(entry) {
|
|
@@ -948,13 +977,21 @@ function serializeReadableStream(request, task, stream) {
|
|
|
948
977
|
callOnAllReadyIfReady(request);
|
|
949
978
|
else
|
|
950
979
|
try {
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
980
|
+
request.pendingChunks++,
|
|
981
|
+
(streamTask.model = entry.value),
|
|
982
|
+
isByteStream
|
|
983
|
+
? emitTypedArrayChunk(
|
|
984
|
+
request,
|
|
985
|
+
streamTask.id,
|
|
986
|
+
"b",
|
|
987
|
+
streamTask.model,
|
|
988
|
+
!1
|
|
989
|
+
)
|
|
990
|
+
: tryStreamTask(request, streamTask),
|
|
954
991
|
enqueueFlush(request),
|
|
955
992
|
reader.read().then(progress, error);
|
|
956
|
-
} catch (x$
|
|
957
|
-
error(x$
|
|
993
|
+
} catch (x$13) {
|
|
994
|
+
error(x$13);
|
|
958
995
|
}
|
|
959
996
|
}
|
|
960
997
|
function error(reason) {
|
|
@@ -984,7 +1021,8 @@ function serializeReadableStream(request, task, stream) {
|
|
|
984
1021
|
} catch (x) {
|
|
985
1022
|
supportsBYOB = !1;
|
|
986
1023
|
}
|
|
987
|
-
var
|
|
1024
|
+
var isByteStream = supportsBYOB,
|
|
1025
|
+
reader = stream.getReader(),
|
|
988
1026
|
streamTask = createTask(
|
|
989
1027
|
request,
|
|
990
1028
|
task.model,
|
|
@@ -994,7 +1032,7 @@ function serializeReadableStream(request, task, stream) {
|
|
|
994
1032
|
request.abortableTasks
|
|
995
1033
|
);
|
|
996
1034
|
request.pendingChunks++;
|
|
997
|
-
task = streamTask.id.toString(16) + ":" + (
|
|
1035
|
+
task = streamTask.id.toString(16) + ":" + (isByteStream ? "r" : "R") + "\n";
|
|
998
1036
|
request.completedRegularChunks.push(stringToChunk(task));
|
|
999
1037
|
request.cacheController.signal.addEventListener("abort", abortStream);
|
|
1000
1038
|
reader.read().then(progress, error);
|
|
@@ -1038,8 +1076,8 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
|
1038
1076
|
tryStreamTask(request, streamTask),
|
|
1039
1077
|
enqueueFlush(request),
|
|
1040
1078
|
iterator.next().then(progress, error);
|
|
1041
|
-
} catch (x$
|
|
1042
|
-
error(x$
|
|
1079
|
+
} catch (x$14) {
|
|
1080
|
+
error(x$14);
|
|
1043
1081
|
}
|
|
1044
1082
|
}
|
|
1045
1083
|
function error(reason) {
|
|
@@ -1164,7 +1202,12 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
|
1164
1202
|
Component = task.keyPath;
|
|
1165
1203
|
prevThenableState = task.implicitSlot;
|
|
1166
1204
|
null !== key
|
|
1167
|
-
? (task.keyPath =
|
|
1205
|
+
? (task.keyPath =
|
|
1206
|
+
key === REACT_OPTIMISTIC_KEY || Component === REACT_OPTIMISTIC_KEY
|
|
1207
|
+
? REACT_OPTIMISTIC_KEY
|
|
1208
|
+
: null === Component
|
|
1209
|
+
? key
|
|
1210
|
+
: Component + "," + key)
|
|
1168
1211
|
: null === Component && (task.implicitSlot = !0);
|
|
1169
1212
|
request = renderModelDestructive(request, task, emptyRoot, "", props);
|
|
1170
1213
|
task.keyPath = Component;
|
|
@@ -1247,7 +1290,11 @@ function renderElement(request, task, type, key, ref, props) {
|
|
|
1247
1290
|
key = task.keyPath;
|
|
1248
1291
|
null === request
|
|
1249
1292
|
? (request = key)
|
|
1250
|
-
: null !== key &&
|
|
1293
|
+
: null !== key &&
|
|
1294
|
+
(request =
|
|
1295
|
+
key === REACT_OPTIMISTIC_KEY || request === REACT_OPTIMISTIC_KEY
|
|
1296
|
+
? REACT_OPTIMISTIC_KEY
|
|
1297
|
+
: key + "," + request);
|
|
1251
1298
|
props = [REACT_ELEMENT_TYPE, type, request, props];
|
|
1252
1299
|
task = task.implicitSlot && null !== request ? [props] : props;
|
|
1253
1300
|
return task;
|
|
@@ -1272,9 +1319,27 @@ function createTask(
|
|
|
1272
1319
|
implicitSlot,
|
|
1273
1320
|
formatContext,
|
|
1274
1321
|
abortSet
|
|
1322
|
+
) {
|
|
1323
|
+
return createTaskWithID(
|
|
1324
|
+
request,
|
|
1325
|
+
request.nextChunkId++,
|
|
1326
|
+
model,
|
|
1327
|
+
keyPath,
|
|
1328
|
+
implicitSlot,
|
|
1329
|
+
formatContext,
|
|
1330
|
+
abortSet
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
function createTaskWithID(
|
|
1334
|
+
request,
|
|
1335
|
+
id,
|
|
1336
|
+
model,
|
|
1337
|
+
keyPath,
|
|
1338
|
+
implicitSlot,
|
|
1339
|
+
formatContext,
|
|
1340
|
+
abortSet
|
|
1275
1341
|
) {
|
|
1276
1342
|
request.pendingChunks++;
|
|
1277
|
-
var id = request.nextChunkId++;
|
|
1278
1343
|
"object" !== typeof model ||
|
|
1279
1344
|
null === model ||
|
|
1280
1345
|
null !== keyPath ||
|
|
@@ -1290,83 +1355,125 @@ function createTask(
|
|
|
1290
1355
|
ping: function () {
|
|
1291
1356
|
return pingTask(request, task);
|
|
1292
1357
|
},
|
|
1293
|
-
toJSON: function (parentPropertyName, value) {
|
|
1294
|
-
serializedSize += parentPropertyName.length;
|
|
1295
|
-
var prevKeyPath = task.keyPath,
|
|
1296
|
-
prevImplicitSlot = task.implicitSlot;
|
|
1297
|
-
try {
|
|
1298
|
-
var JSCompiler_inline_result = renderModelDestructive(
|
|
1299
|
-
request,
|
|
1300
|
-
task,
|
|
1301
|
-
this,
|
|
1302
|
-
parentPropertyName,
|
|
1303
|
-
value
|
|
1304
|
-
);
|
|
1305
|
-
} catch (thrownValue) {
|
|
1306
|
-
if (
|
|
1307
|
-
((parentPropertyName = task.model),
|
|
1308
|
-
(parentPropertyName =
|
|
1309
|
-
"object" === typeof parentPropertyName &&
|
|
1310
|
-
null !== parentPropertyName &&
|
|
1311
|
-
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
|
1312
|
-
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
|
1313
|
-
12 === request.status)
|
|
1314
|
-
)
|
|
1315
|
-
(task.status = 3),
|
|
1316
|
-
21 === request.type
|
|
1317
|
-
? ((prevKeyPath = request.nextChunkId++),
|
|
1318
|
-
(prevKeyPath = parentPropertyName
|
|
1319
|
-
? serializeLazyID(prevKeyPath)
|
|
1320
|
-
: serializeByValueID(prevKeyPath)),
|
|
1321
|
-
(JSCompiler_inline_result = prevKeyPath))
|
|
1322
|
-
: ((prevKeyPath = request.fatalError),
|
|
1323
|
-
(JSCompiler_inline_result = parentPropertyName
|
|
1324
|
-
? serializeLazyID(prevKeyPath)
|
|
1325
|
-
: serializeByValueID(prevKeyPath)));
|
|
1326
|
-
else if (
|
|
1327
|
-
((value =
|
|
1328
|
-
thrownValue === SuspenseException
|
|
1329
|
-
? getSuspendedThenable()
|
|
1330
|
-
: thrownValue),
|
|
1331
|
-
"object" === typeof value &&
|
|
1332
|
-
null !== value &&
|
|
1333
|
-
"function" === typeof value.then)
|
|
1334
|
-
) {
|
|
1335
|
-
JSCompiler_inline_result = createTask(
|
|
1336
|
-
request,
|
|
1337
|
-
task.model,
|
|
1338
|
-
task.keyPath,
|
|
1339
|
-
task.implicitSlot,
|
|
1340
|
-
task.formatContext,
|
|
1341
|
-
request.abortableTasks
|
|
1342
|
-
);
|
|
1343
|
-
var ping = JSCompiler_inline_result.ping;
|
|
1344
|
-
value.then(ping, ping);
|
|
1345
|
-
JSCompiler_inline_result.thenableState =
|
|
1346
|
-
getThenableStateAfterSuspending();
|
|
1347
|
-
task.keyPath = prevKeyPath;
|
|
1348
|
-
task.implicitSlot = prevImplicitSlot;
|
|
1349
|
-
JSCompiler_inline_result = parentPropertyName
|
|
1350
|
-
? serializeLazyID(JSCompiler_inline_result.id)
|
|
1351
|
-
: serializeByValueID(JSCompiler_inline_result.id);
|
|
1352
|
-
} else
|
|
1353
|
-
(task.keyPath = prevKeyPath),
|
|
1354
|
-
(task.implicitSlot = prevImplicitSlot),
|
|
1355
|
-
request.pendingChunks++,
|
|
1356
|
-
(prevKeyPath = request.nextChunkId++),
|
|
1357
|
-
(prevImplicitSlot = logRecoverableError(request, value, task)),
|
|
1358
|
-
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
|
1359
|
-
(JSCompiler_inline_result = parentPropertyName
|
|
1360
|
-
? serializeLazyID(prevKeyPath)
|
|
1361
|
-
: serializeByValueID(prevKeyPath));
|
|
1362
|
-
}
|
|
1363
|
-
return JSCompiler_inline_result;
|
|
1364
|
-
},
|
|
1365
1358
|
thenableState: null
|
|
1366
1359
|
};
|
|
1367
1360
|
abortSet.add(task);
|
|
1368
1361
|
return task;
|
|
1369
1362
|
}
|
|
1363
|
+
function resolveModel(request, task, parent, parentPropertyName, value) {
|
|
1364
|
+
var jsonValue = value;
|
|
1365
|
+
null !== value &&
|
|
1366
|
+
"object" === typeof value &&
|
|
1367
|
+
"function" === typeof value.toJSON &&
|
|
1368
|
+
(jsonValue = value.toJSON(parentPropertyName));
|
|
1369
|
+
serializedSize += parentPropertyName.length;
|
|
1370
|
+
value = task.keyPath;
|
|
1371
|
+
var prevImplicitSlot = task.implicitSlot;
|
|
1372
|
+
try {
|
|
1373
|
+
var JSCompiler_inline_result = renderModelDestructive(
|
|
1374
|
+
request,
|
|
1375
|
+
task,
|
|
1376
|
+
parent,
|
|
1377
|
+
parentPropertyName,
|
|
1378
|
+
jsonValue
|
|
1379
|
+
);
|
|
1380
|
+
} catch (thrownValue) {
|
|
1381
|
+
(parent = task.model),
|
|
1382
|
+
(parent =
|
|
1383
|
+
"object" === typeof parent &&
|
|
1384
|
+
null !== parent &&
|
|
1385
|
+
(parent.$$typeof === REACT_ELEMENT_TYPE ||
|
|
1386
|
+
parent.$$typeof === REACT_LAZY_TYPE)),
|
|
1387
|
+
12 === request.status
|
|
1388
|
+
? ((task.status = 3),
|
|
1389
|
+
21 === request.type
|
|
1390
|
+
? ((value = request.nextChunkId++),
|
|
1391
|
+
(value = parent
|
|
1392
|
+
? serializeLazyID(value)
|
|
1393
|
+
: serializeByValueID(value)),
|
|
1394
|
+
(JSCompiler_inline_result = value))
|
|
1395
|
+
: ((value = request.fatalError),
|
|
1396
|
+
(JSCompiler_inline_result = parent
|
|
1397
|
+
? serializeLazyID(value)
|
|
1398
|
+
: serializeByValueID(value))))
|
|
1399
|
+
: ((parentPropertyName =
|
|
1400
|
+
thrownValue === SuspenseException
|
|
1401
|
+
? getSuspendedThenable()
|
|
1402
|
+
: thrownValue),
|
|
1403
|
+
"object" === typeof parentPropertyName &&
|
|
1404
|
+
null !== parentPropertyName &&
|
|
1405
|
+
"function" === typeof parentPropertyName.then
|
|
1406
|
+
? ((jsonValue = createTask(
|
|
1407
|
+
request,
|
|
1408
|
+
task.model,
|
|
1409
|
+
task.keyPath,
|
|
1410
|
+
task.implicitSlot,
|
|
1411
|
+
task.formatContext,
|
|
1412
|
+
request.abortableTasks
|
|
1413
|
+
)),
|
|
1414
|
+
(JSCompiler_inline_result = jsonValue.ping),
|
|
1415
|
+
parentPropertyName.then(
|
|
1416
|
+
JSCompiler_inline_result,
|
|
1417
|
+
JSCompiler_inline_result
|
|
1418
|
+
),
|
|
1419
|
+
(jsonValue.thenableState = getThenableStateAfterSuspending()),
|
|
1420
|
+
(task.keyPath = value),
|
|
1421
|
+
(task.implicitSlot = prevImplicitSlot),
|
|
1422
|
+
(JSCompiler_inline_result = parent
|
|
1423
|
+
? serializeLazyID(jsonValue.id)
|
|
1424
|
+
: serializeByValueID(jsonValue.id)))
|
|
1425
|
+
: ((task.keyPath = value),
|
|
1426
|
+
(task.implicitSlot = prevImplicitSlot),
|
|
1427
|
+
request.pendingChunks++,
|
|
1428
|
+
(value = request.nextChunkId++),
|
|
1429
|
+
(prevImplicitSlot = logRecoverableError(
|
|
1430
|
+
request,
|
|
1431
|
+
parentPropertyName,
|
|
1432
|
+
task
|
|
1433
|
+
)),
|
|
1434
|
+
emitErrorChunk(request, value, prevImplicitSlot),
|
|
1435
|
+
(JSCompiler_inline_result = parent
|
|
1436
|
+
? serializeLazyID(value)
|
|
1437
|
+
: serializeByValueID(value))));
|
|
1438
|
+
}
|
|
1439
|
+
value = JSCompiler_inline_result;
|
|
1440
|
+
if (null === value || "object" !== typeof value) return value;
|
|
1441
|
+
if (isArrayImpl(value)) {
|
|
1442
|
+
var resolved$16 = [];
|
|
1443
|
+
for (
|
|
1444
|
+
prevImplicitSlot = 0;
|
|
1445
|
+
prevImplicitSlot < value.length;
|
|
1446
|
+
prevImplicitSlot++
|
|
1447
|
+
)
|
|
1448
|
+
resolved$16[prevImplicitSlot] = resolveModel(
|
|
1449
|
+
request,
|
|
1450
|
+
task,
|
|
1451
|
+
value,
|
|
1452
|
+
"" + prevImplicitSlot,
|
|
1453
|
+
value[prevImplicitSlot]
|
|
1454
|
+
);
|
|
1455
|
+
return resolved$16;
|
|
1456
|
+
}
|
|
1457
|
+
prevImplicitSlot = {};
|
|
1458
|
+
for (resolved$16 in value)
|
|
1459
|
+
hasOwnProperty.call(value, resolved$16) &&
|
|
1460
|
+
((parent = resolveModel(
|
|
1461
|
+
request,
|
|
1462
|
+
task,
|
|
1463
|
+
value,
|
|
1464
|
+
resolved$16,
|
|
1465
|
+
value[resolved$16]
|
|
1466
|
+
)),
|
|
1467
|
+
"__proto__" === resolved$16
|
|
1468
|
+
? Object.defineProperty(prevImplicitSlot, resolved$16, {
|
|
1469
|
+
value: parent,
|
|
1470
|
+
enumerable: !0,
|
|
1471
|
+
writable: !0,
|
|
1472
|
+
configurable: !0
|
|
1473
|
+
})
|
|
1474
|
+
: (prevImplicitSlot[resolved$16] = parent));
|
|
1475
|
+
return prevImplicitSlot;
|
|
1476
|
+
}
|
|
1370
1477
|
function serializeByValueID(id) {
|
|
1371
1478
|
return "$" + id.toString(16);
|
|
1372
1479
|
}
|
|
@@ -1421,10 +1528,29 @@ function serializeClientReference(
|
|
|
1421
1528
|
!0 === resolvedModuleData.async || !0 === clientReference.$$async
|
|
1422
1529
|
? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
|
|
1423
1530
|
: [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
|
|
1531
|
+
var copy = transformImportMetadata(request, JSCompiler_inline_result, 0);
|
|
1532
|
+
if (copy !== NOT_PLAIN_IMPORT_METADATA)
|
|
1533
|
+
var JSCompiler_temp = stringify(copy);
|
|
1534
|
+
else
|
|
1535
|
+
b: {
|
|
1536
|
+
clientReference = importStringRequest;
|
|
1537
|
+
importStringRequest = request;
|
|
1538
|
+
try {
|
|
1539
|
+
JSCompiler_temp = stringify(
|
|
1540
|
+
JSCompiler_inline_result,
|
|
1541
|
+
importMetadataReplacer
|
|
1542
|
+
);
|
|
1543
|
+
break b;
|
|
1544
|
+
} finally {
|
|
1545
|
+
importStringRequest = clientReference;
|
|
1546
|
+
}
|
|
1547
|
+
JSCompiler_temp = void 0;
|
|
1548
|
+
}
|
|
1549
|
+
var JSCompiler_inline_result$jscomp$0 = JSCompiler_temp;
|
|
1424
1550
|
request.pendingChunks++;
|
|
1425
1551
|
var importId = request.nextChunkId++,
|
|
1426
|
-
|
|
1427
|
-
|
|
1552
|
+
row =
|
|
1553
|
+
importId.toString(16) + ":I" + JSCompiler_inline_result$jscomp$0 + "\n",
|
|
1428
1554
|
processedChunk = stringToChunk(row);
|
|
1429
1555
|
request.completedImportChunks.push(processedChunk);
|
|
1430
1556
|
writtenClientReferences.set(clientReferenceKey, importId);
|
|
@@ -1497,6 +1623,27 @@ function serializeBlob(request, blob) {
|
|
|
1497
1623
|
reader.read().then(progress).catch(error);
|
|
1498
1624
|
return "$B" + newTask.id.toString(16);
|
|
1499
1625
|
}
|
|
1626
|
+
function escapeStringValue(value) {
|
|
1627
|
+
return "$" === value[0] ? "$" + value : value;
|
|
1628
|
+
}
|
|
1629
|
+
function serializeImportString(request, value) {
|
|
1630
|
+
if (16 > value.length) return escapeStringValue(value);
|
|
1631
|
+
var writtenStrings = request.writtenImportStrings,
|
|
1632
|
+
existing = writtenStrings.get(value);
|
|
1633
|
+
if (void 0 !== existing) return existing;
|
|
1634
|
+
existing = request.writtenImportStringsSize + value.length;
|
|
1635
|
+
if (32768 < existing) return escapeStringValue(value);
|
|
1636
|
+
request.writtenImportStringsSize = existing;
|
|
1637
|
+
request.pendingChunks++;
|
|
1638
|
+
existing = request.nextChunkId++;
|
|
1639
|
+
var json = stringify(escapeStringValue(value));
|
|
1640
|
+
request.completedImportChunks.push(
|
|
1641
|
+
stringToChunk(existing.toString(16) + ":" + json + "\n")
|
|
1642
|
+
);
|
|
1643
|
+
request = serializeByValueID(existing);
|
|
1644
|
+
writtenStrings.set(value, request);
|
|
1645
|
+
return request;
|
|
1646
|
+
}
|
|
1500
1647
|
var modelRoot = !1;
|
|
1501
1648
|
function renderModelDestructive(
|
|
1502
1649
|
request,
|
|
@@ -1545,10 +1692,16 @@ function renderModelDestructive(
|
|
|
1545
1692
|
case REACT_LAZY_TYPE:
|
|
1546
1693
|
if (3200 < serializedSize) return deferTask(request, task);
|
|
1547
1694
|
task.thenableState = null;
|
|
1548
|
-
|
|
1549
|
-
value =
|
|
1695
|
+
elementReference = value._init;
|
|
1696
|
+
value = elementReference(value._payload);
|
|
1550
1697
|
if (12 === request.status) throw null;
|
|
1551
|
-
return renderModelDestructive(
|
|
1698
|
+
return renderModelDestructive(
|
|
1699
|
+
request,
|
|
1700
|
+
task,
|
|
1701
|
+
parent,
|
|
1702
|
+
parentPropertyName,
|
|
1703
|
+
value
|
|
1704
|
+
);
|
|
1552
1705
|
case REACT_LEGACY_ELEMENT_TYPE:
|
|
1553
1706
|
throw Error(
|
|
1554
1707
|
'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
|
|
@@ -1696,23 +1849,19 @@ function renderModelDestructive(
|
|
|
1696
1849
|
);
|
|
1697
1850
|
return value;
|
|
1698
1851
|
}
|
|
1699
|
-
if ("string" === typeof value)
|
|
1700
|
-
|
|
1701
|
-
|
|
1852
|
+
if ("string" === typeof value)
|
|
1853
|
+
return (
|
|
1854
|
+
(serializedSize += value.length),
|
|
1702
1855
|
"Z" === value[value.length - 1] &&
|
|
1703
1856
|
parent[parentPropertyName] instanceof Date
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
);
|
|
1713
|
-
request = "$" === value[0] ? "$" + value : value;
|
|
1714
|
-
return request;
|
|
1715
|
-
}
|
|
1857
|
+
? "$D" + value
|
|
1858
|
+
: 1024 <= value.length && null !== byteLengthOfChunk
|
|
1859
|
+
? (request.pendingChunks++,
|
|
1860
|
+
(task = request.nextChunkId++),
|
|
1861
|
+
emitTextChunk(request, task, value, !1),
|
|
1862
|
+
serializeByValueID(task))
|
|
1863
|
+
: escapeStringValue(value)
|
|
1864
|
+
);
|
|
1716
1865
|
if ("boolean" === typeof value) return value;
|
|
1717
1866
|
if ("number" === typeof value)
|
|
1718
1867
|
return Number.isFinite(value)
|
|
@@ -1839,6 +1988,69 @@ function emitErrorChunk(request, id, digest) {
|
|
|
1839
1988
|
id = stringToChunk(id);
|
|
1840
1989
|
request.completedErrorChunks.push(id);
|
|
1841
1990
|
}
|
|
1991
|
+
var importStringRequest = null;
|
|
1992
|
+
function importMetadataReplacer(key, value) {
|
|
1993
|
+
return "string" === typeof value
|
|
1994
|
+
? ((key = importStringRequest),
|
|
1995
|
+
null === key
|
|
1996
|
+
? escapeStringValue(value)
|
|
1997
|
+
: serializeImportString(key, value))
|
|
1998
|
+
: value;
|
|
1999
|
+
}
|
|
2000
|
+
var NOT_PLAIN_IMPORT_METADATA = {};
|
|
2001
|
+
function transformImportMetadata(request, value, depth) {
|
|
2002
|
+
switch (typeof value) {
|
|
2003
|
+
case "string":
|
|
2004
|
+
return serializeImportString(request, value);
|
|
2005
|
+
case "number":
|
|
2006
|
+
case "boolean":
|
|
2007
|
+
case "undefined":
|
|
2008
|
+
return value;
|
|
2009
|
+
case "object":
|
|
2010
|
+
if (null === value) return null;
|
|
2011
|
+
if (16 < depth || "function" === typeof value.toJSON)
|
|
2012
|
+
return NOT_PLAIN_IMPORT_METADATA;
|
|
2013
|
+
if (isArrayImpl(value)) {
|
|
2014
|
+
for (
|
|
2015
|
+
var length = value.length, copy = Array(length), i = 0;
|
|
2016
|
+
i < length;
|
|
2017
|
+
i++
|
|
2018
|
+
) {
|
|
2019
|
+
var element = value[i];
|
|
2020
|
+
if ("string" === typeof element)
|
|
2021
|
+
copy[i] = serializeImportString(request, element);
|
|
2022
|
+
else {
|
|
2023
|
+
element = transformImportMetadata(request, element, depth + 1);
|
|
2024
|
+
if (element === NOT_PLAIN_IMPORT_METADATA)
|
|
2025
|
+
return NOT_PLAIN_IMPORT_METADATA;
|
|
2026
|
+
copy[i] = element;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
return copy;
|
|
2030
|
+
}
|
|
2031
|
+
length = getPrototypeOf(value);
|
|
2032
|
+
if (length !== ObjectPrototype$1 && null !== length)
|
|
2033
|
+
return NOT_PLAIN_IMPORT_METADATA;
|
|
2034
|
+
length = Object.keys(value);
|
|
2035
|
+
copy = {};
|
|
2036
|
+
for (i = 0; i < length.length; i++) {
|
|
2037
|
+
element = length[i];
|
|
2038
|
+
if (element in ObjectPrototype$1) return NOT_PLAIN_IMPORT_METADATA;
|
|
2039
|
+
var element$25 = value[element];
|
|
2040
|
+
if ("string" === typeof element$25)
|
|
2041
|
+
copy[element] = serializeImportString(request, element$25);
|
|
2042
|
+
else {
|
|
2043
|
+
element$25 = transformImportMetadata(request, element$25, depth + 1);
|
|
2044
|
+
if (element$25 === NOT_PLAIN_IMPORT_METADATA)
|
|
2045
|
+
return NOT_PLAIN_IMPORT_METADATA;
|
|
2046
|
+
copy[element] = element$25;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
return copy;
|
|
2050
|
+
default:
|
|
2051
|
+
return NOT_PLAIN_IMPORT_METADATA;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
1842
2054
|
function emitModelChunk(request, id, json) {
|
|
1843
2055
|
id = id.toString(16) + ":" + json + "\n";
|
|
1844
2056
|
id = stringToChunk(id);
|
|
@@ -1846,16 +2058,19 @@ function emitModelChunk(request, id, json) {
|
|
|
1846
2058
|
}
|
|
1847
2059
|
function emitTypedArrayChunk(request, id, tag, typedArray, debug) {
|
|
1848
2060
|
debug ? request.pendingDebugChunks++ : request.pendingChunks++;
|
|
1849
|
-
|
|
2061
|
+
typedArray = new Uint8Array(
|
|
1850
2062
|
typedArray.buffer,
|
|
1851
2063
|
typedArray.byteOffset,
|
|
1852
2064
|
typedArray.byteLength
|
|
1853
2065
|
);
|
|
1854
|
-
typedArray = 2048 < typedArray.byteLength ? debug.slice() : debug;
|
|
1855
2066
|
debug = typedArray.byteLength;
|
|
1856
2067
|
id = id.toString(16) + ":" + tag + debug.toString(16) + ",";
|
|
1857
2068
|
id = stringToChunk(id);
|
|
1858
|
-
request.completedRegularChunks.push(
|
|
2069
|
+
request.completedRegularChunks.push(
|
|
2070
|
+
NEXT_TWO_CHUNKS_ARE_ATOMIC,
|
|
2071
|
+
id,
|
|
2072
|
+
typedArray
|
|
2073
|
+
);
|
|
1859
2074
|
}
|
|
1860
2075
|
function emitTextChunk(request, id, text, debug) {
|
|
1861
2076
|
if (null === byteLengthOfChunk)
|
|
@@ -1867,7 +2082,7 @@ function emitTextChunk(request, id, text, debug) {
|
|
|
1867
2082
|
debug = text.byteLength;
|
|
1868
2083
|
id = id.toString(16) + ":T" + debug.toString(16) + ",";
|
|
1869
2084
|
id = stringToChunk(id);
|
|
1870
|
-
request.completedRegularChunks.push(id, text);
|
|
2085
|
+
request.completedRegularChunks.push(NEXT_TWO_CHUNKS_ARE_ATOMIC, id, text);
|
|
1871
2086
|
}
|
|
1872
2087
|
function emitChunk(request, task, value) {
|
|
1873
2088
|
var id = task.id;
|
|
@@ -1899,7 +2114,14 @@ function emitChunk(request, task, value) {
|
|
|
1899
2114
|
? emitTypedArrayChunk(request, id, "m", value, !1)
|
|
1900
2115
|
: value instanceof DataView
|
|
1901
2116
|
? emitTypedArrayChunk(request, id, "V", value, !1)
|
|
1902
|
-
: ((value =
|
|
2117
|
+
: ((value = resolveModel(
|
|
2118
|
+
request,
|
|
2119
|
+
task,
|
|
2120
|
+
{ "": value },
|
|
2121
|
+
"",
|
|
2122
|
+
value
|
|
2123
|
+
)),
|
|
2124
|
+
(value = stringify(value)),
|
|
1903
2125
|
emitModelChunk(request, task.id, value));
|
|
1904
2126
|
}
|
|
1905
2127
|
function erroredTask(request, task, error) {
|
|
@@ -2015,7 +2237,7 @@ function finishHaltedTask(task, request) {
|
|
|
2015
2237
|
function flushCompletedChunks(request) {
|
|
2016
2238
|
var destination = request.destination;
|
|
2017
2239
|
if (null !== destination) {
|
|
2018
|
-
currentView = new Uint8Array(
|
|
2240
|
+
currentView = new Uint8Array(4096);
|
|
2019
2241
|
writtenBytes = 0;
|
|
2020
2242
|
try {
|
|
2021
2243
|
for (
|
|
@@ -2031,9 +2253,28 @@ function flushCompletedChunks(request) {
|
|
|
2031
2253
|
writeChunkAndReturn(destination, hintChunks[i]);
|
|
2032
2254
|
hintChunks.splice(0, i);
|
|
2033
2255
|
var regularChunks = request.completedRegularChunks;
|
|
2034
|
-
for (i = 0; i < regularChunks.length; i++)
|
|
2035
|
-
|
|
2036
|
-
|
|
2256
|
+
for (i = 0; i < regularChunks.length; i++) {
|
|
2257
|
+
var item = regularChunks[i];
|
|
2258
|
+
importsChunks = void 0;
|
|
2259
|
+
if (item === NEXT_TWO_CHUNKS_ARE_ATOMIC) {
|
|
2260
|
+
if (i + 2 >= regularChunks.length)
|
|
2261
|
+
throw Error("A chunk pair is incomplete. This is a bug in React.");
|
|
2262
|
+
request.pendingChunks -= 2;
|
|
2263
|
+
writeChunk(destination, regularChunks[i + 1]);
|
|
2264
|
+
importsChunks = writeChunkAndReturn(
|
|
2265
|
+
destination,
|
|
2266
|
+
regularChunks[i + 2]
|
|
2267
|
+
);
|
|
2268
|
+
i += 2;
|
|
2269
|
+
} else
|
|
2270
|
+
request.pendingChunks--,
|
|
2271
|
+
(importsChunks = writeChunkAndReturn(destination, item));
|
|
2272
|
+
if (!importsChunks) {
|
|
2273
|
+
request.destination = null;
|
|
2274
|
+
i++;
|
|
2275
|
+
break;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2037
2278
|
regularChunks.splice(0, i);
|
|
2038
2279
|
var errorChunks = request.completedErrorChunks;
|
|
2039
2280
|
for (i = 0; i < errorChunks.length; i++)
|
|
@@ -2126,6 +2367,17 @@ function finishAbort(request, abortedTasks, errorId) {
|
|
|
2126
2367
|
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2127
2368
|
}
|
|
2128
2369
|
}
|
|
2370
|
+
function attachAbortSignal(request, signal) {
|
|
2371
|
+
signal.aborted
|
|
2372
|
+
? abort(request, signal.reason)
|
|
2373
|
+
: signal.addEventListener(
|
|
2374
|
+
"abort",
|
|
2375
|
+
function () {
|
|
2376
|
+
abort(request, signal.reason);
|
|
2377
|
+
},
|
|
2378
|
+
{ signal: request.cacheController.signal }
|
|
2379
|
+
);
|
|
2380
|
+
}
|
|
2129
2381
|
function abort(request, reason) {
|
|
2130
2382
|
if (!(11 < request.status))
|
|
2131
2383
|
try {
|
|
@@ -2170,9 +2422,9 @@ function abort(request, reason) {
|
|
|
2170
2422
|
onAllReady();
|
|
2171
2423
|
flushCompletedChunks(request);
|
|
2172
2424
|
}
|
|
2173
|
-
} catch (error$
|
|
2174
|
-
logRecoverableError(request, error$
|
|
2175
|
-
fatalError(request, error$
|
|
2425
|
+
} catch (error$32) {
|
|
2426
|
+
logRecoverableError(request, error$32, null),
|
|
2427
|
+
fatalError(request, error$32);
|
|
2176
2428
|
}
|
|
2177
2429
|
}
|
|
2178
2430
|
function resolveServerReference(bundlerConfig, id) {
|
|
@@ -2263,50 +2515,56 @@ function ReactPromise(status, value, reason) {
|
|
|
2263
2515
|
this.reason = reason;
|
|
2264
2516
|
}
|
|
2265
2517
|
ReactPromise.prototype = Object.create(Promise.prototype);
|
|
2266
|
-
ReactPromise.prototype
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2518
|
+
Object.defineProperty(ReactPromise.prototype, "then", {
|
|
2519
|
+
writable: !0,
|
|
2520
|
+
enumerable: !0,
|
|
2521
|
+
configurable: !0,
|
|
2522
|
+
value: function (resolve, reject) {
|
|
2523
|
+
switch (this.status) {
|
|
2524
|
+
case "resolved_model":
|
|
2525
|
+
initializeModelChunk(this);
|
|
2526
|
+
}
|
|
2527
|
+
switch (this.status) {
|
|
2528
|
+
case "fulfilled":
|
|
2529
|
+
if ("function" === typeof resolve) {
|
|
2530
|
+
for (
|
|
2531
|
+
var inspectedValue = this.value,
|
|
2532
|
+
cycleProtection = 0,
|
|
2533
|
+
visited = new Set();
|
|
2534
|
+
inspectedValue instanceof ReactPromise;
|
|
2279
2535
|
|
|
2280
|
-
) {
|
|
2281
|
-
cycleProtection++;
|
|
2282
|
-
if (
|
|
2283
|
-
inspectedValue === this ||
|
|
2284
|
-
visited.has(inspectedValue) ||
|
|
2285
|
-
1e3 < cycleProtection
|
|
2286
2536
|
) {
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2537
|
+
cycleProtection++;
|
|
2538
|
+
if (
|
|
2539
|
+
inspectedValue === this ||
|
|
2540
|
+
visited.has(inspectedValue) ||
|
|
2541
|
+
1e3 < cycleProtection
|
|
2542
|
+
) {
|
|
2543
|
+
"function" === typeof reject &&
|
|
2544
|
+
reject(Error("Cannot have cyclic thenables."));
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
visited.add(inspectedValue);
|
|
2548
|
+
if ("fulfilled" === inspectedValue.status)
|
|
2549
|
+
inspectedValue = inspectedValue.value;
|
|
2550
|
+
else break;
|
|
2290
2551
|
}
|
|
2291
|
-
|
|
2292
|
-
if ("fulfilled" === inspectedValue.status)
|
|
2293
|
-
inspectedValue = inspectedValue.value;
|
|
2294
|
-
else break;
|
|
2552
|
+
resolve(this.value);
|
|
2295
2553
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2554
|
+
break;
|
|
2555
|
+
case "pending":
|
|
2556
|
+
case "blocked":
|
|
2557
|
+
"function" === typeof resolve &&
|
|
2558
|
+
(null === this.value && (this.value = []), this.value.push(resolve));
|
|
2559
|
+
"function" === typeof reject &&
|
|
2560
|
+
(null === this.reason && (this.reason = []),
|
|
2561
|
+
this.reason.push(reject));
|
|
2562
|
+
break;
|
|
2563
|
+
default:
|
|
2564
|
+
"function" === typeof reject && reject(this.reason);
|
|
2565
|
+
}
|
|
2308
2566
|
}
|
|
2309
|
-
};
|
|
2567
|
+
});
|
|
2310
2568
|
var ObjectPrototype = Object.prototype,
|
|
2311
2569
|
ArrayPrototype = Array.prototype;
|
|
2312
2570
|
function wakeChunk(response, listeners, value, chunk) {
|
|
@@ -2447,7 +2705,9 @@ function loadServerReference$1(response, metaData, parentObject, key) {
|
|
|
2447
2705
|
(cachedPromise = requireModule(serverReference)),
|
|
2448
2706
|
(id = blockedPromise),
|
|
2449
2707
|
(id.status = "fulfilled"),
|
|
2450
|
-
(id.value = cachedPromise)
|
|
2708
|
+
(id.value = cachedPromise),
|
|
2709
|
+
(id.reason = null),
|
|
2710
|
+
cachedPromise
|
|
2451
2711
|
);
|
|
2452
2712
|
if (initializingHandler) {
|
|
2453
2713
|
var handler = initializingHandler;
|
|
@@ -2947,12 +3207,12 @@ function parseReadableStream(response, reference, type) {
|
|
|
2947
3207
|
(previousBlockedChunk = chunk));
|
|
2948
3208
|
} else {
|
|
2949
3209
|
chunk = previousBlockedChunk;
|
|
2950
|
-
var chunk$
|
|
2951
|
-
chunk$
|
|
2952
|
-
previousBlockedChunk = chunk$
|
|
3210
|
+
var chunk$37 = new ReactPromise("pending", null, null);
|
|
3211
|
+
chunk$37.then(enqueue, flightController.error);
|
|
3212
|
+
previousBlockedChunk = chunk$37;
|
|
2953
3213
|
chunk.then(function () {
|
|
2954
|
-
previousBlockedChunk === chunk$
|
|
2955
|
-
resolveModelChunk(response, chunk$
|
|
3214
|
+
previousBlockedChunk === chunk$37 && (previousBlockedChunk = null);
|
|
3215
|
+
resolveModelChunk(response, chunk$37, json, -1);
|
|
2956
3216
|
});
|
|
2957
3217
|
}
|
|
2958
3218
|
},
|
|
@@ -3306,10 +3566,11 @@ function parseModelString(response, obj, key, value, reference, arrayRoot) {
|
|
|
3306
3566
|
arrayRoot
|
|
3307
3567
|
);
|
|
3308
3568
|
case "B":
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3569
|
+
obj = parseInt(value.slice(2), 16);
|
|
3570
|
+
response = response._formData.data.get(response._prefix + obj);
|
|
3571
|
+
if (!(response instanceof Blob))
|
|
3572
|
+
throw Error("Referenced Blob is not a Blob.");
|
|
3573
|
+
return response;
|
|
3313
3574
|
case "R":
|
|
3314
3575
|
return parseReadableStream(response, value, void 0);
|
|
3315
3576
|
case "r":
|
|
@@ -3504,7 +3765,6 @@ exports.prerender = function (model, webpackMap, options) {
|
|
|
3504
3765
|
model,
|
|
3505
3766
|
webpackMap,
|
|
3506
3767
|
options ? options.onError : void 0,
|
|
3507
|
-
options ? options.onPostpone : void 0,
|
|
3508
3768
|
function () {
|
|
3509
3769
|
var stream = new ReadableStream(
|
|
3510
3770
|
{
|
|
@@ -3525,17 +3785,7 @@ exports.prerender = function (model, webpackMap, options) {
|
|
|
3525
3785
|
options ? options.identifierPrefix : void 0,
|
|
3526
3786
|
options ? options.temporaryReferences : void 0
|
|
3527
3787
|
);
|
|
3528
|
-
|
|
3529
|
-
var signal = options.signal;
|
|
3530
|
-
if (signal.aborted) abort(request, signal.reason);
|
|
3531
|
-
else {
|
|
3532
|
-
var listener = function () {
|
|
3533
|
-
abort(request, signal.reason);
|
|
3534
|
-
signal.removeEventListener("abort", listener);
|
|
3535
|
-
};
|
|
3536
|
-
signal.addEventListener("abort", listener);
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3788
|
+
options && options.signal && attachAbortSignal(request, options.signal);
|
|
3539
3789
|
startWork(request);
|
|
3540
3790
|
});
|
|
3541
3791
|
};
|
|
@@ -3568,23 +3818,12 @@ exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
|
3568
3818
|
model,
|
|
3569
3819
|
webpackMap,
|
|
3570
3820
|
options ? options.onError : void 0,
|
|
3571
|
-
options ? options.onPostpone : void 0,
|
|
3572
3821
|
noop,
|
|
3573
3822
|
noop,
|
|
3574
3823
|
options ? options.identifierPrefix : void 0,
|
|
3575
3824
|
options ? options.temporaryReferences : void 0
|
|
3576
3825
|
);
|
|
3577
|
-
|
|
3578
|
-
var signal = options.signal;
|
|
3579
|
-
if (signal.aborted) abort(request, signal.reason);
|
|
3580
|
-
else {
|
|
3581
|
-
var listener = function () {
|
|
3582
|
-
abort(request, signal.reason);
|
|
3583
|
-
signal.removeEventListener("abort", listener);
|
|
3584
|
-
};
|
|
3585
|
-
signal.addEventListener("abort", listener);
|
|
3586
|
-
}
|
|
3587
|
-
}
|
|
3826
|
+
options && options.signal && attachAbortSignal(request, options.signal);
|
|
3588
3827
|
return new ReadableStream(
|
|
3589
3828
|
{
|
|
3590
3829
|
type: "bytes",
|