react-server-dom-webpack 19.0.0-canary-cf5ab8b8b2-20240425 → 19.0.0-rc-915b914b3a-20240515
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-server-dom-webpack-client.browser.development.js +941 -73
- package/cjs/react-server-dom-webpack-client.browser.production.js +722 -229
- package/cjs/react-server-dom-webpack-client.edge.development.js +941 -73
- package/cjs/react-server-dom-webpack-client.edge.production.js +722 -229
- package/cjs/react-server-dom-webpack-client.node.development.js +940 -72
- package/cjs/react-server-dom-webpack-client.node.production.js +707 -219
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +940 -72
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +707 -219
- package/cjs/react-server-dom-webpack-server.browser.development.js +1335 -235
- package/cjs/react-server-dom-webpack-server.browser.production.js +865 -202
- package/cjs/react-server-dom-webpack-server.edge.development.js +1341 -233
- package/cjs/react-server-dom-webpack-server.edge.production.js +865 -202
- package/cjs/react-server-dom-webpack-server.node.development.js +1294 -237
- package/cjs/react-server-dom-webpack-server.node.production.js +860 -223
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +1294 -237
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +860 -223
- package/package.json +3 -3
@@ -39,6 +39,9 @@ function writeChunkAndReturn(destination, chunk) {
|
|
39
39
|
return !0;
|
40
40
|
}
|
41
41
|
var textEncoder = new TextEncoder();
|
42
|
+
function stringToChunk(content) {
|
43
|
+
return textEncoder.encode(content);
|
44
|
+
}
|
42
45
|
function closeWithError(destination, error) {
|
43
46
|
"function" === typeof destination.error
|
44
47
|
? destination.error(error)
|
@@ -344,10 +347,6 @@ var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
344
347
|
switch (name) {
|
345
348
|
case "$$typeof":
|
346
349
|
return target.$$typeof;
|
347
|
-
case "$$id":
|
348
|
-
return target.$$id;
|
349
|
-
case "$$async":
|
350
|
-
return target.$$async;
|
351
350
|
case "name":
|
352
351
|
return;
|
353
352
|
case "displayName":
|
@@ -377,18 +376,21 @@ var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
377
376
|
);
|
378
377
|
}
|
379
378
|
};
|
380
|
-
function createTemporaryReference(id) {
|
381
|
-
|
379
|
+
function createTemporaryReference(temporaryReferences, id) {
|
380
|
+
var reference = Object.defineProperties(
|
382
381
|
function () {
|
383
382
|
throw Error(
|
384
383
|
"Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
|
385
384
|
);
|
386
385
|
},
|
387
|
-
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG }
|
386
|
+
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
|
388
387
|
);
|
389
|
-
|
388
|
+
reference = new Proxy(reference, proxyHandlers);
|
389
|
+
temporaryReferences.set(reference, id);
|
390
|
+
return reference;
|
390
391
|
}
|
391
|
-
var
|
392
|
+
var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
393
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
392
394
|
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
393
395
|
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
394
396
|
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
@@ -406,9 +408,10 @@ function getIteratorFn(maybeIterable) {
|
|
406
408
|
maybeIterable["@@iterator"];
|
407
409
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
408
410
|
}
|
409
|
-
var
|
410
|
-
|
411
|
-
|
411
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
412
|
+
SuspenseException = Error(
|
413
|
+
"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`"
|
414
|
+
);
|
412
415
|
function noop() {}
|
413
416
|
function trackUsedThenable(thenableState, thenable, index) {
|
414
417
|
index = thenableState[index];
|
@@ -535,7 +538,7 @@ function use(usable) {
|
|
535
538
|
}
|
536
539
|
throw Error("An unsupported type was passed to use(): " + String(usable));
|
537
540
|
}
|
538
|
-
var
|
541
|
+
var DefaultAsyncDispatcher = {
|
539
542
|
getCacheForType: function (resourceType) {
|
540
543
|
var JSCompiler_inline_result = (JSCompiler_inline_result = currentRequest
|
541
544
|
? currentRequest
|
@@ -677,17 +680,19 @@ function createRequest(
|
|
677
680
|
bundlerConfig,
|
678
681
|
onError,
|
679
682
|
identifierPrefix,
|
680
|
-
onPostpone
|
683
|
+
onPostpone,
|
684
|
+
environmentName,
|
685
|
+
temporaryReferences
|
681
686
|
) {
|
682
687
|
if (
|
683
|
-
null !== ReactSharedInternalsServer.
|
684
|
-
ReactSharedInternalsServer.
|
688
|
+
null !== ReactSharedInternalsServer.A &&
|
689
|
+
ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
|
685
690
|
)
|
686
691
|
throw Error("Currently React only supports one RSC renderer at a time.");
|
687
|
-
ReactSharedInternalsServer.
|
688
|
-
var abortSet = new Set()
|
689
|
-
|
690
|
-
|
692
|
+
ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
|
693
|
+
var abortSet = new Set();
|
694
|
+
environmentName = [];
|
695
|
+
var hints = new Set();
|
691
696
|
bundlerConfig = {
|
692
697
|
status: 0,
|
693
698
|
flushScheduled: !1,
|
@@ -700,7 +705,7 @@ function createRequest(
|
|
700
705
|
hints: hints,
|
701
706
|
abortListeners: new Set(),
|
702
707
|
abortableTasks: abortSet,
|
703
|
-
pingedTasks:
|
708
|
+
pingedTasks: environmentName,
|
704
709
|
completedImportChunks: [],
|
705
710
|
completedHintChunks: [],
|
706
711
|
completedRegularChunks: [],
|
@@ -709,6 +714,7 @@ function createRequest(
|
|
709
714
|
writtenClientReferences: new Map(),
|
710
715
|
writtenServerReferences: new Map(),
|
711
716
|
writtenObjects: new WeakMap(),
|
717
|
+
temporaryReferences: temporaryReferences,
|
712
718
|
identifierPrefix: identifierPrefix || "",
|
713
719
|
identifierCount: 1,
|
714
720
|
taintCleanupQueue: [],
|
@@ -716,7 +722,7 @@ function createRequest(
|
|
716
722
|
onPostpone: void 0 === onPostpone ? defaultPostponeHandler : onPostpone
|
717
723
|
};
|
718
724
|
model = createTask(bundlerConfig, model, null, !1, abortSet);
|
719
|
-
|
725
|
+
environmentName.push(model);
|
720
726
|
return bundlerConfig;
|
721
727
|
}
|
722
728
|
var currentRequest = null;
|
@@ -769,12 +775,127 @@ function serializeThenable(request, task, thenable) {
|
|
769
775
|
);
|
770
776
|
return newTask.id;
|
771
777
|
}
|
778
|
+
function serializeReadableStream(request, task, stream) {
|
779
|
+
function progress(entry) {
|
780
|
+
if (!aborted)
|
781
|
+
if (entry.done)
|
782
|
+
request.abortListeners.delete(error),
|
783
|
+
(entry = streamTask.id.toString(16) + ":C\n"),
|
784
|
+
request.completedRegularChunks.push(stringToChunk(entry)),
|
785
|
+
enqueueFlush(request),
|
786
|
+
(aborted = !0);
|
787
|
+
else
|
788
|
+
try {
|
789
|
+
(streamTask.model = entry.value),
|
790
|
+
request.pendingChunks++,
|
791
|
+
emitChunk(request, streamTask, streamTask.model),
|
792
|
+
enqueueFlush(request),
|
793
|
+
reader.read().then(progress, error);
|
794
|
+
} catch (x$8) {
|
795
|
+
error(x$8);
|
796
|
+
}
|
797
|
+
}
|
798
|
+
function error(reason) {
|
799
|
+
if (!aborted) {
|
800
|
+
aborted = !0;
|
801
|
+
request.abortListeners.delete(error);
|
802
|
+
var digest = logRecoverableError(request, reason);
|
803
|
+
emitErrorChunk(request, streamTask.id, digest);
|
804
|
+
enqueueFlush(request);
|
805
|
+
reader.cancel(reason).then(error, error);
|
806
|
+
}
|
807
|
+
}
|
808
|
+
var supportsBYOB = stream.supportsBYOB;
|
809
|
+
if (void 0 === supportsBYOB)
|
810
|
+
try {
|
811
|
+
stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
|
812
|
+
} catch (x) {
|
813
|
+
supportsBYOB = !1;
|
814
|
+
}
|
815
|
+
var reader = stream.getReader(),
|
816
|
+
streamTask = createTask(
|
817
|
+
request,
|
818
|
+
task.model,
|
819
|
+
task.keyPath,
|
820
|
+
task.implicitSlot,
|
821
|
+
request.abortableTasks
|
822
|
+
);
|
823
|
+
request.abortableTasks.delete(streamTask);
|
824
|
+
request.pendingChunks++;
|
825
|
+
task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
|
826
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
827
|
+
var aborted = !1;
|
828
|
+
request.abortListeners.add(error);
|
829
|
+
reader.read().then(progress, error);
|
830
|
+
return serializeByValueID(streamTask.id);
|
831
|
+
}
|
832
|
+
function serializeAsyncIterable(request, task, iterable, iterator) {
|
833
|
+
function progress(entry) {
|
834
|
+
if (!aborted)
|
835
|
+
if (entry.done) {
|
836
|
+
request.abortListeners.delete(error);
|
837
|
+
if (void 0 === entry.value)
|
838
|
+
var endStreamRow = streamTask.id.toString(16) + ":C\n";
|
839
|
+
else
|
840
|
+
try {
|
841
|
+
var chunkId = outlineModel(request, entry.value);
|
842
|
+
endStreamRow =
|
843
|
+
streamTask.id.toString(16) +
|
844
|
+
":C" +
|
845
|
+
stringify(serializeByValueID(chunkId)) +
|
846
|
+
"\n";
|
847
|
+
} catch (x) {
|
848
|
+
error(x);
|
849
|
+
return;
|
850
|
+
}
|
851
|
+
request.completedRegularChunks.push(stringToChunk(endStreamRow));
|
852
|
+
enqueueFlush(request);
|
853
|
+
aborted = !0;
|
854
|
+
} else
|
855
|
+
try {
|
856
|
+
(streamTask.model = entry.value),
|
857
|
+
request.pendingChunks++,
|
858
|
+
emitChunk(request, streamTask, streamTask.model),
|
859
|
+
enqueueFlush(request),
|
860
|
+
iterator.next().then(progress, error);
|
861
|
+
} catch (x$9) {
|
862
|
+
error(x$9);
|
863
|
+
}
|
864
|
+
}
|
865
|
+
function error(reason) {
|
866
|
+
if (!aborted) {
|
867
|
+
aborted = !0;
|
868
|
+
request.abortListeners.delete(error);
|
869
|
+
var digest = logRecoverableError(request, reason);
|
870
|
+
emitErrorChunk(request, streamTask.id, digest);
|
871
|
+
enqueueFlush(request);
|
872
|
+
"function" === typeof iterator.throw &&
|
873
|
+
iterator.throw(reason).then(error, error);
|
874
|
+
}
|
875
|
+
}
|
876
|
+
iterable = iterable === iterator;
|
877
|
+
var streamTask = createTask(
|
878
|
+
request,
|
879
|
+
task.model,
|
880
|
+
task.keyPath,
|
881
|
+
task.implicitSlot,
|
882
|
+
request.abortableTasks
|
883
|
+
);
|
884
|
+
request.abortableTasks.delete(streamTask);
|
885
|
+
request.pendingChunks++;
|
886
|
+
task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
|
887
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
888
|
+
var aborted = !1;
|
889
|
+
request.abortListeners.add(error);
|
890
|
+
iterator.next().then(progress, error);
|
891
|
+
return serializeByValueID(streamTask.id);
|
892
|
+
}
|
772
893
|
function emitHint(request, code, model) {
|
773
894
|
model = stringify(model);
|
774
895
|
var id = request.nextChunkId++;
|
775
896
|
code = "H" + code;
|
776
897
|
code = id.toString(16) + ":" + code;
|
777
|
-
model =
|
898
|
+
model = stringToChunk(code + model + "\n");
|
778
899
|
request.completedHintChunks.push(model);
|
779
900
|
enqueueFlush(request);
|
780
901
|
}
|
@@ -826,6 +947,20 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
826
947
|
return iteratorFn.call(iterableChild);
|
827
948
|
}),
|
828
949
|
Component);
|
950
|
+
} else if (
|
951
|
+
!(
|
952
|
+
"function" !== typeof Component[ASYNC_ITERATOR] ||
|
953
|
+
("function" === typeof ReadableStream &&
|
954
|
+
Component instanceof ReadableStream)
|
955
|
+
)
|
956
|
+
) {
|
957
|
+
var iterableChild$10 = Component;
|
958
|
+
Component = {};
|
959
|
+
Component =
|
960
|
+
((Component[ASYNC_ITERATOR] = function () {
|
961
|
+
return iterableChild$10[ASYNC_ITERATOR]();
|
962
|
+
}),
|
963
|
+
Component);
|
829
964
|
}
|
830
965
|
}
|
831
966
|
props = task.keyPath;
|
@@ -915,7 +1050,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
915
1050
|
null === model ||
|
916
1051
|
null !== keyPath ||
|
917
1052
|
implicitSlot ||
|
918
|
-
request.writtenObjects.set(model, id);
|
1053
|
+
request.writtenObjects.set(model, serializeByValueID(id));
|
919
1054
|
var task = {
|
920
1055
|
id: id,
|
921
1056
|
status: 0,
|
@@ -996,7 +1131,7 @@ function serializeByValueID(id) {
|
|
996
1131
|
function encodeReferenceChunk(request, id, reference) {
|
997
1132
|
request = stringify(reference);
|
998
1133
|
id = id.toString(16) + ":" + request + "\n";
|
999
|
-
return
|
1134
|
+
return stringToChunk(id);
|
1000
1135
|
}
|
1001
1136
|
function serializeClientReference(
|
1002
1137
|
request,
|
@@ -1039,7 +1174,7 @@ function serializeClientReference(
|
|
1039
1174
|
var importId = request.nextChunkId++,
|
1040
1175
|
json = stringify(JSCompiler_inline_result),
|
1041
1176
|
row = importId.toString(16) + ":I" + json + "\n",
|
1042
|
-
processedChunk =
|
1177
|
+
processedChunk = stringToChunk(row);
|
1043
1178
|
request.completedImportChunks.push(processedChunk);
|
1044
1179
|
writtenClientReferences.set(clientReferenceKey, importId);
|
1045
1180
|
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
@@ -1060,6 +1195,43 @@ function outlineModel(request, value) {
|
|
1060
1195
|
retryTask(request, value);
|
1061
1196
|
return value.id;
|
1062
1197
|
}
|
1198
|
+
function serializeTypedArray(request, tag, typedArray) {
|
1199
|
+
request.pendingChunks++;
|
1200
|
+
var bufferId = request.nextChunkId++;
|
1201
|
+
emitTypedArrayChunk(request, bufferId, tag, typedArray);
|
1202
|
+
return serializeByValueID(bufferId);
|
1203
|
+
}
|
1204
|
+
function serializeBlob(request, blob) {
|
1205
|
+
function progress(entry) {
|
1206
|
+
if (!aborted)
|
1207
|
+
if (entry.done)
|
1208
|
+
request.abortListeners.delete(error),
|
1209
|
+
(aborted = !0),
|
1210
|
+
pingTask(request, newTask);
|
1211
|
+
else
|
1212
|
+
return (
|
1213
|
+
model.push(entry.value), reader.read().then(progress).catch(error)
|
1214
|
+
);
|
1215
|
+
}
|
1216
|
+
function error(reason) {
|
1217
|
+
if (!aborted) {
|
1218
|
+
aborted = !0;
|
1219
|
+
request.abortListeners.delete(error);
|
1220
|
+
var digest = logRecoverableError(request, reason);
|
1221
|
+
emitErrorChunk(request, newTask.id, digest);
|
1222
|
+
request.abortableTasks.delete(newTask);
|
1223
|
+
enqueueFlush(request);
|
1224
|
+
reader.cancel(reason).then(error, error);
|
1225
|
+
}
|
1226
|
+
}
|
1227
|
+
var model = [blob.type],
|
1228
|
+
newTask = createTask(request, model, null, !1, request.abortableTasks),
|
1229
|
+
reader = blob.stream().getReader(),
|
1230
|
+
aborted = !1;
|
1231
|
+
request.abortListeners.add(error);
|
1232
|
+
reader.read().then(progress).catch(error);
|
1233
|
+
return "$B" + newTask.id.toString(16);
|
1234
|
+
}
|
1063
1235
|
var modelRoot = !1;
|
1064
1236
|
function renderModelDestructive(
|
1065
1237
|
request,
|
@@ -1074,34 +1246,39 @@ function renderModelDestructive(
|
|
1074
1246
|
if ("object" === typeof value) {
|
1075
1247
|
switch (value.$$typeof) {
|
1076
1248
|
case REACT_ELEMENT_TYPE:
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
if (
|
1249
|
+
var writtenObjects = request.writtenObjects;
|
1250
|
+
if (null === task.keyPath && !task.implicitSlot) {
|
1251
|
+
var existingReference = writtenObjects.get(value);
|
1252
|
+
if (void 0 !== existingReference)
|
1081
1253
|
if (modelRoot === value) modelRoot = null;
|
1082
|
-
else
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
parentPropertyName =
|
1254
|
+
else return existingReference;
|
1255
|
+
else
|
1256
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1257
|
+
((parent = writtenObjects.get(parent)),
|
1258
|
+
void 0 !== parent &&
|
1259
|
+
writtenObjects.set(value, parent + ":" + parentPropertyName));
|
1260
|
+
}
|
1261
|
+
parentPropertyName = value.props;
|
1262
|
+
parent = parentPropertyName.ref;
|
1090
1263
|
return renderElement(
|
1091
1264
|
request,
|
1092
1265
|
task,
|
1093
1266
|
value.type,
|
1094
1267
|
value.key,
|
1095
|
-
void 0 !==
|
1096
|
-
|
1268
|
+
void 0 !== parent ? parent : null,
|
1269
|
+
parentPropertyName
|
1097
1270
|
);
|
1098
1271
|
case REACT_LAZY_TYPE:
|
1099
1272
|
return (
|
1100
1273
|
(task.thenableState = null),
|
1101
|
-
(
|
1102
|
-
(value =
|
1274
|
+
(parentPropertyName = value._init),
|
1275
|
+
(value = parentPropertyName(value._payload)),
|
1103
1276
|
renderModelDestructive(request, task, emptyRoot, "", value)
|
1104
1277
|
);
|
1278
|
+
case REACT_LEGACY_ELEMENT_TYPE:
|
1279
|
+
throw Error(
|
1280
|
+
'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.'
|
1281
|
+
);
|
1105
1282
|
}
|
1106
1283
|
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
1107
1284
|
return serializeClientReference(
|
@@ -1110,65 +1287,120 @@ function renderModelDestructive(
|
|
1110
1287
|
parentPropertyName,
|
1111
1288
|
value
|
1112
1289
|
);
|
1113
|
-
|
1114
|
-
|
1290
|
+
if (
|
1291
|
+
void 0 !== request.temporaryReferences &&
|
1292
|
+
((writtenObjects = request.temporaryReferences.get(value)),
|
1293
|
+
void 0 !== writtenObjects)
|
1294
|
+
)
|
1295
|
+
return "$T" + writtenObjects;
|
1296
|
+
writtenObjects = request.writtenObjects;
|
1297
|
+
existingReference = writtenObjects.get(value);
|
1115
1298
|
if ("function" === typeof value.then) {
|
1116
|
-
if (void 0 !==
|
1299
|
+
if (void 0 !== existingReference) {
|
1117
1300
|
if (null !== task.keyPath || task.implicitSlot)
|
1118
1301
|
return "$@" + serializeThenable(request, task, value).toString(16);
|
1119
1302
|
if (modelRoot === value) modelRoot = null;
|
1120
|
-
else return
|
1303
|
+
else return existingReference;
|
1121
1304
|
}
|
1122
|
-
request = serializeThenable(request, task, value);
|
1123
|
-
|
1124
|
-
return
|
1305
|
+
request = "$@" + serializeThenable(request, task, value).toString(16);
|
1306
|
+
writtenObjects.set(value, request);
|
1307
|
+
return request;
|
1125
1308
|
}
|
1126
|
-
if (void 0 !==
|
1309
|
+
if (void 0 !== existingReference)
|
1127
1310
|
if (modelRoot === value) modelRoot = null;
|
1128
|
-
else
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
"
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
parentPropertyName.set(parent, -1));
|
1148
|
-
return "$Q" + outlineModel(request, value).toString(16);
|
1149
|
-
}
|
1150
|
-
if (value instanceof Set) {
|
1151
|
-
value = Array.from(value);
|
1152
|
-
for (task = 0; task < value.length; task++)
|
1153
|
-
(parent = value[task]),
|
1154
|
-
"object" === typeof parent &&
|
1155
|
-
null !== parent &&
|
1156
|
-
((parentPropertyName = request.writtenObjects),
|
1157
|
-
void 0 === parentPropertyName.get(parent) &&
|
1158
|
-
parentPropertyName.set(parent, -1));
|
1159
|
-
return "$W" + outlineModel(request, value).toString(16);
|
1311
|
+
else return existingReference;
|
1312
|
+
else if (
|
1313
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1314
|
+
((existingReference = writtenObjects.get(parent)),
|
1315
|
+
void 0 !== existingReference)
|
1316
|
+
) {
|
1317
|
+
var propertyName = parentPropertyName;
|
1318
|
+
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
1319
|
+
switch (parentPropertyName) {
|
1320
|
+
case "1":
|
1321
|
+
propertyName = "type";
|
1322
|
+
break;
|
1323
|
+
case "2":
|
1324
|
+
propertyName = "key";
|
1325
|
+
break;
|
1326
|
+
case "3":
|
1327
|
+
propertyName = "props";
|
1328
|
+
}
|
1329
|
+
writtenObjects.set(value, existingReference + ":" + propertyName);
|
1160
1330
|
}
|
1331
|
+
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
1332
|
+
if (value instanceof Map)
|
1333
|
+
return (
|
1334
|
+
(value = Array.from(value)),
|
1335
|
+
"$Q" + outlineModel(request, value).toString(16)
|
1336
|
+
);
|
1337
|
+
if (value instanceof Set)
|
1338
|
+
return (
|
1339
|
+
(value = Array.from(value)),
|
1340
|
+
"$W" + outlineModel(request, value).toString(16)
|
1341
|
+
);
|
1161
1342
|
if ("function" === typeof FormData && value instanceof FormData)
|
1162
1343
|
return (
|
1163
1344
|
(value = Array.from(value.entries())),
|
1164
1345
|
"$K" + outlineModel(request, value).toString(16)
|
1165
1346
|
);
|
1166
|
-
if (
|
1347
|
+
if (value instanceof ArrayBuffer)
|
1348
|
+
return serializeTypedArray(request, "A", new Uint8Array(value));
|
1349
|
+
if (value instanceof Int8Array)
|
1350
|
+
return serializeTypedArray(request, "O", value);
|
1351
|
+
if (value instanceof Uint8Array)
|
1352
|
+
return serializeTypedArray(request, "o", value);
|
1353
|
+
if (value instanceof Uint8ClampedArray)
|
1354
|
+
return serializeTypedArray(request, "U", value);
|
1355
|
+
if (value instanceof Int16Array)
|
1356
|
+
return serializeTypedArray(request, "S", value);
|
1357
|
+
if (value instanceof Uint16Array)
|
1358
|
+
return serializeTypedArray(request, "s", value);
|
1359
|
+
if (value instanceof Int32Array)
|
1360
|
+
return serializeTypedArray(request, "L", value);
|
1361
|
+
if (value instanceof Uint32Array)
|
1362
|
+
return serializeTypedArray(request, "l", value);
|
1363
|
+
if (value instanceof Float32Array)
|
1364
|
+
return serializeTypedArray(request, "G", value);
|
1365
|
+
if (value instanceof Float64Array)
|
1366
|
+
return serializeTypedArray(request, "g", value);
|
1367
|
+
if (value instanceof BigInt64Array)
|
1368
|
+
return serializeTypedArray(request, "M", value);
|
1369
|
+
if (value instanceof BigUint64Array)
|
1370
|
+
return serializeTypedArray(request, "m", value);
|
1371
|
+
if (value instanceof DataView)
|
1372
|
+
return serializeTypedArray(request, "V", value);
|
1373
|
+
if ("function" === typeof Blob && value instanceof Blob)
|
1374
|
+
return serializeBlob(request, value);
|
1375
|
+
if ((parentPropertyName = getIteratorFn(value)))
|
1167
1376
|
return (
|
1168
|
-
(
|
1169
|
-
|
1170
|
-
? "$i" +
|
1171
|
-
|
1377
|
+
(parentPropertyName = parentPropertyName.call(value)),
|
1378
|
+
parentPropertyName === value
|
1379
|
+
? "$i" +
|
1380
|
+
outlineModel(request, Array.from(parentPropertyName)).toString(16)
|
1381
|
+
: renderFragment(request, task, Array.from(parentPropertyName))
|
1382
|
+
);
|
1383
|
+
if ("function" === typeof ReadableStream && value instanceof ReadableStream)
|
1384
|
+
return serializeReadableStream(request, task, value);
|
1385
|
+
parentPropertyName = value[ASYNC_ITERATOR];
|
1386
|
+
if ("function" === typeof parentPropertyName)
|
1387
|
+
return (
|
1388
|
+
null !== task.keyPath
|
1389
|
+
? ((request = [
|
1390
|
+
REACT_ELEMENT_TYPE,
|
1391
|
+
REACT_FRAGMENT_TYPE,
|
1392
|
+
task.keyPath,
|
1393
|
+
{ children: value }
|
1394
|
+
]),
|
1395
|
+
(request = task.implicitSlot ? [request] : request))
|
1396
|
+
: ((parentPropertyName = parentPropertyName.call(value)),
|
1397
|
+
(request = serializeAsyncIterable(
|
1398
|
+
request,
|
1399
|
+
task,
|
1400
|
+
value,
|
1401
|
+
parentPropertyName
|
1402
|
+
))),
|
1403
|
+
request
|
1172
1404
|
);
|
1173
1405
|
request = getPrototypeOf(value);
|
1174
1406
|
if (
|
@@ -1219,20 +1451,30 @@ function renderModelDestructive(
|
|
1219
1451
|
if (value.$$typeof === SERVER_REFERENCE_TAG)
|
1220
1452
|
return (
|
1221
1453
|
(task = request.writtenServerReferences),
|
1222
|
-
(
|
1223
|
-
void 0 !==
|
1224
|
-
? (request = "$F" +
|
1225
|
-
: ((
|
1226
|
-
(
|
1454
|
+
(parentPropertyName = task.get(value)),
|
1455
|
+
void 0 !== parentPropertyName
|
1456
|
+
? (request = "$F" + parentPropertyName.toString(16))
|
1457
|
+
: ((parentPropertyName = value.$$bound),
|
1458
|
+
(parentPropertyName = {
|
1227
1459
|
id: value.$$id,
|
1228
|
-
bound:
|
1460
|
+
bound: parentPropertyName
|
1461
|
+
? Promise.resolve(parentPropertyName)
|
1462
|
+
: null
|
1229
1463
|
}),
|
1230
|
-
(request = outlineModel(request,
|
1464
|
+
(request = outlineModel(request, parentPropertyName)),
|
1231
1465
|
task.set(value, request),
|
1232
1466
|
(request = "$F" + request.toString(16))),
|
1233
1467
|
request
|
1234
1468
|
);
|
1235
|
-
if (
|
1469
|
+
if (
|
1470
|
+
void 0 !== request.temporaryReferences &&
|
1471
|
+
((request = request.temporaryReferences.get(value)), void 0 !== request)
|
1472
|
+
)
|
1473
|
+
return "$T" + request;
|
1474
|
+
if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
|
1475
|
+
throw Error(
|
1476
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
1477
|
+
);
|
1236
1478
|
if (/^on[A-Z]/.test(parentPropertyName))
|
1237
1479
|
throw Error(
|
1238
1480
|
"Event handlers cannot be passed to Client Component props." +
|
@@ -1246,25 +1488,25 @@ function renderModelDestructive(
|
|
1246
1488
|
}
|
1247
1489
|
if ("symbol" === typeof value) {
|
1248
1490
|
task = request.writtenSymbols;
|
1249
|
-
|
1250
|
-
if (void 0 !==
|
1251
|
-
|
1252
|
-
if (Symbol.for(
|
1491
|
+
writtenObjects = task.get(value);
|
1492
|
+
if (void 0 !== writtenObjects) return serializeByValueID(writtenObjects);
|
1493
|
+
writtenObjects = value.description;
|
1494
|
+
if (Symbol.for(writtenObjects) !== value)
|
1253
1495
|
throw Error(
|
1254
1496
|
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
1255
1497
|
(value.description + ") cannot be found among global symbols.") +
|
1256
1498
|
describeObjectForErrorMessage(parent, parentPropertyName)
|
1257
1499
|
);
|
1258
1500
|
request.pendingChunks++;
|
1259
|
-
|
1260
|
-
|
1501
|
+
parentPropertyName = request.nextChunkId++;
|
1502
|
+
parent = encodeReferenceChunk(
|
1261
1503
|
request,
|
1262
|
-
|
1263
|
-
"$S" +
|
1504
|
+
parentPropertyName,
|
1505
|
+
"$S" + writtenObjects
|
1264
1506
|
);
|
1265
|
-
request.completedImportChunks.push(
|
1266
|
-
task.set(value,
|
1267
|
-
return serializeByValueID(
|
1507
|
+
request.completedImportChunks.push(parent);
|
1508
|
+
task.set(value, parentPropertyName);
|
1509
|
+
return serializeByValueID(parentPropertyName);
|
1268
1510
|
}
|
1269
1511
|
if ("bigint" === typeof value) return "$n" + value.toString(10);
|
1270
1512
|
throw Error(
|
@@ -1299,22 +1541,68 @@ function fatalError(request, error) {
|
|
1299
1541
|
function emitErrorChunk(request, id, digest) {
|
1300
1542
|
digest = { digest: digest };
|
1301
1543
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1302
|
-
id =
|
1544
|
+
id = stringToChunk(id);
|
1303
1545
|
request.completedErrorChunks.push(id);
|
1304
1546
|
}
|
1305
1547
|
function emitModelChunk(request, id, json) {
|
1306
1548
|
id = id.toString(16) + ":" + json + "\n";
|
1307
|
-
id =
|
1549
|
+
id = stringToChunk(id);
|
1308
1550
|
request.completedRegularChunks.push(id);
|
1309
1551
|
}
|
1552
|
+
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1553
|
+
request.pendingChunks++;
|
1554
|
+
var buffer = new Uint8Array(
|
1555
|
+
typedArray.buffer,
|
1556
|
+
typedArray.byteOffset,
|
1557
|
+
typedArray.byteLength
|
1558
|
+
);
|
1559
|
+
typedArray = 2048 < typedArray.byteLength ? buffer.slice() : buffer;
|
1560
|
+
buffer = typedArray.byteLength;
|
1561
|
+
id = id.toString(16) + ":" + tag + buffer.toString(16) + ",";
|
1562
|
+
id = stringToChunk(id);
|
1563
|
+
request.completedRegularChunks.push(id, typedArray);
|
1564
|
+
}
|
1310
1565
|
function emitTextChunk(request, id, text) {
|
1311
1566
|
request.pendingChunks++;
|
1312
|
-
text =
|
1567
|
+
text = stringToChunk(text);
|
1313
1568
|
var binaryLength = text.byteLength;
|
1314
1569
|
id = id.toString(16) + ":T" + binaryLength.toString(16) + ",";
|
1315
|
-
id =
|
1570
|
+
id = stringToChunk(id);
|
1316
1571
|
request.completedRegularChunks.push(id, text);
|
1317
1572
|
}
|
1573
|
+
function emitChunk(request, task, value) {
|
1574
|
+
var id = task.id;
|
1575
|
+
"string" === typeof value
|
1576
|
+
? emitTextChunk(request, id, value)
|
1577
|
+
: value instanceof ArrayBuffer
|
1578
|
+
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
|
1579
|
+
: value instanceof Int8Array
|
1580
|
+
? emitTypedArrayChunk(request, id, "O", value)
|
1581
|
+
: value instanceof Uint8Array
|
1582
|
+
? emitTypedArrayChunk(request, id, "o", value)
|
1583
|
+
: value instanceof Uint8ClampedArray
|
1584
|
+
? emitTypedArrayChunk(request, id, "U", value)
|
1585
|
+
: value instanceof Int16Array
|
1586
|
+
? emitTypedArrayChunk(request, id, "S", value)
|
1587
|
+
: value instanceof Uint16Array
|
1588
|
+
? emitTypedArrayChunk(request, id, "s", value)
|
1589
|
+
: value instanceof Int32Array
|
1590
|
+
? emitTypedArrayChunk(request, id, "L", value)
|
1591
|
+
: value instanceof Uint32Array
|
1592
|
+
? emitTypedArrayChunk(request, id, "l", value)
|
1593
|
+
: value instanceof Float32Array
|
1594
|
+
? emitTypedArrayChunk(request, id, "G", value)
|
1595
|
+
: value instanceof Float64Array
|
1596
|
+
? emitTypedArrayChunk(request, id, "g", value)
|
1597
|
+
: value instanceof BigInt64Array
|
1598
|
+
? emitTypedArrayChunk(request, id, "M", value)
|
1599
|
+
: value instanceof BigUint64Array
|
1600
|
+
? emitTypedArrayChunk(request, id, "m", value)
|
1601
|
+
: value instanceof DataView
|
1602
|
+
? emitTypedArrayChunk(request, id, "V", value)
|
1603
|
+
: ((value = stringify(value, task.toJSON)),
|
1604
|
+
emitModelChunk(request, task.id, value));
|
1605
|
+
}
|
1318
1606
|
var emptyRoot = {};
|
1319
1607
|
function retryTask(request, task) {
|
1320
1608
|
if (0 === task.status)
|
@@ -1330,17 +1618,12 @@ function retryTask(request, task) {
|
|
1330
1618
|
modelRoot = resolvedModel;
|
1331
1619
|
task.keyPath = null;
|
1332
1620
|
task.implicitSlot = !1;
|
1333
|
-
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
emitModelChunk(request, task.id, json);
|
1340
|
-
}
|
1341
|
-
} else {
|
1342
|
-
var json$jscomp$0 = stringify(resolvedModel);
|
1343
|
-
emitModelChunk(request, task.id, json$jscomp$0);
|
1621
|
+
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
1622
|
+
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1623
|
+
emitChunk(request, task, resolvedModel);
|
1624
|
+
else {
|
1625
|
+
var json = stringify(resolvedModel);
|
1626
|
+
emitModelChunk(request, task.id, json);
|
1344
1627
|
}
|
1345
1628
|
request.abortableTasks.delete(task);
|
1346
1629
|
task.status = 1;
|
@@ -1453,19 +1736,19 @@ function abort(request, reason) {
|
|
1453
1736
|
}
|
1454
1737
|
var abortListeners = request.abortListeners;
|
1455
1738
|
if (0 < abortListeners.size) {
|
1456
|
-
var error$
|
1739
|
+
var error$22 =
|
1457
1740
|
void 0 === reason
|
1458
1741
|
? Error("The render was aborted by the server without a reason.")
|
1459
1742
|
: reason;
|
1460
1743
|
abortListeners.forEach(function (callback) {
|
1461
|
-
return callback(error$
|
1744
|
+
return callback(error$22);
|
1462
1745
|
});
|
1463
1746
|
abortListeners.clear();
|
1464
1747
|
}
|
1465
1748
|
null !== request.destination &&
|
1466
1749
|
flushCompletedChunks(request, request.destination);
|
1467
|
-
} catch (error$
|
1468
|
-
logRecoverableError(request, error$
|
1750
|
+
} catch (error$23) {
|
1751
|
+
logRecoverableError(request, error$23), fatalError(request, error$23);
|
1469
1752
|
}
|
1470
1753
|
}
|
1471
1754
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -1550,6 +1833,7 @@ __webpack_require__.u = function (chunkId) {
|
|
1550
1833
|
? flightChunk
|
1551
1834
|
: webpackGetChunkFilename(chunkId);
|
1552
1835
|
};
|
1836
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
1553
1837
|
function Chunk(status, value, reason, response) {
|
1554
1838
|
this.status = status;
|
1555
1839
|
this.value = value;
|
@@ -1568,6 +1852,7 @@ Chunk.prototype.then = function (resolve, reject) {
|
|
1568
1852
|
break;
|
1569
1853
|
case "pending":
|
1570
1854
|
case "blocked":
|
1855
|
+
case "cyclic":
|
1571
1856
|
resolve &&
|
1572
1857
|
(null === this.value && (this.value = []), this.value.push(resolve));
|
1573
1858
|
reject &&
|
@@ -1577,17 +1862,65 @@ Chunk.prototype.then = function (resolve, reject) {
|
|
1577
1862
|
reject(this.reason);
|
1578
1863
|
}
|
1579
1864
|
};
|
1865
|
+
function createPendingChunk(response) {
|
1866
|
+
return new Chunk("pending", null, null, response);
|
1867
|
+
}
|
1580
1868
|
function wakeChunk(listeners, value) {
|
1581
1869
|
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
|
1582
1870
|
}
|
1583
1871
|
function triggerErrorOnChunk(chunk, error) {
|
1584
|
-
if ("pending"
|
1872
|
+
if ("pending" !== chunk.status && "blocked" !== chunk.status)
|
1873
|
+
chunk.reason.error(error);
|
1874
|
+
else {
|
1585
1875
|
var listeners = chunk.reason;
|
1586
1876
|
chunk.status = "rejected";
|
1587
1877
|
chunk.reason = error;
|
1588
1878
|
null !== listeners && wakeChunk(listeners, error);
|
1589
1879
|
}
|
1590
1880
|
}
|
1881
|
+
function resolveModelChunk(chunk, value, id) {
|
1882
|
+
if ("pending" !== chunk.status)
|
1883
|
+
(chunk = chunk.reason),
|
1884
|
+
"C" === value[0]
|
1885
|
+
? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
|
1886
|
+
: chunk.enqueueModel(value);
|
1887
|
+
else {
|
1888
|
+
var resolveListeners = chunk.value,
|
1889
|
+
rejectListeners = chunk.reason;
|
1890
|
+
chunk.status = "resolved_model";
|
1891
|
+
chunk.value = value;
|
1892
|
+
chunk.reason = id;
|
1893
|
+
if (null !== resolveListeners)
|
1894
|
+
switch ((initializeModelChunk(chunk), chunk.status)) {
|
1895
|
+
case "fulfilled":
|
1896
|
+
wakeChunk(resolveListeners, chunk.value);
|
1897
|
+
break;
|
1898
|
+
case "pending":
|
1899
|
+
case "blocked":
|
1900
|
+
case "cyclic":
|
1901
|
+
chunk.value = resolveListeners;
|
1902
|
+
chunk.reason = rejectListeners;
|
1903
|
+
break;
|
1904
|
+
case "rejected":
|
1905
|
+
rejectListeners && wakeChunk(rejectListeners, chunk.reason);
|
1906
|
+
}
|
1907
|
+
}
|
1908
|
+
}
|
1909
|
+
function createResolvedIteratorResultChunk(response, value, done) {
|
1910
|
+
return new Chunk(
|
1911
|
+
"resolved_model",
|
1912
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
1913
|
+
-1,
|
1914
|
+
response
|
1915
|
+
);
|
1916
|
+
}
|
1917
|
+
function resolveIteratorResultChunk(chunk, value, done) {
|
1918
|
+
resolveModelChunk(
|
1919
|
+
chunk,
|
1920
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
1921
|
+
-1
|
1922
|
+
);
|
1923
|
+
}
|
1591
1924
|
function loadServerReference$1(
|
1592
1925
|
response,
|
1593
1926
|
id,
|
@@ -1597,24 +1930,61 @@ function loadServerReference$1(
|
|
1597
1930
|
key
|
1598
1931
|
) {
|
1599
1932
|
var serverReference = resolveServerReference(response._bundlerConfig, id);
|
1600
|
-
|
1933
|
+
id = preloadModule(serverReference);
|
1601
1934
|
if (bound)
|
1602
|
-
bound = Promise.all([bound,
|
1935
|
+
bound = Promise.all([bound, id]).then(function (_ref) {
|
1603
1936
|
_ref = _ref[0];
|
1604
1937
|
var fn = requireModule(serverReference);
|
1605
1938
|
return fn.bind.apply(fn, [null].concat(_ref));
|
1606
1939
|
});
|
1607
|
-
else if (
|
1608
|
-
bound = Promise.resolve(
|
1940
|
+
else if (id)
|
1941
|
+
bound = Promise.resolve(id).then(function () {
|
1609
1942
|
return requireModule(serverReference);
|
1610
1943
|
});
|
1611
1944
|
else return requireModule(serverReference);
|
1612
1945
|
bound.then(
|
1613
|
-
createModelResolver(
|
1946
|
+
createModelResolver(
|
1947
|
+
parentChunk,
|
1948
|
+
parentObject,
|
1949
|
+
key,
|
1950
|
+
!1,
|
1951
|
+
response,
|
1952
|
+
createModel,
|
1953
|
+
[]
|
1954
|
+
),
|
1614
1955
|
createModelReject(parentChunk)
|
1615
1956
|
);
|
1616
1957
|
return null;
|
1617
1958
|
}
|
1959
|
+
function reviveModel(response, parentObj, parentKey, value, reference) {
|
1960
|
+
if ("string" === typeof value)
|
1961
|
+
return parseModelString(response, parentObj, parentKey, value, reference);
|
1962
|
+
if ("object" === typeof value && null !== value)
|
1963
|
+
if (
|
1964
|
+
(void 0 !== reference &&
|
1965
|
+
void 0 !== response._temporaryReferences &&
|
1966
|
+
response._temporaryReferences.set(value, reference),
|
1967
|
+
Array.isArray(value))
|
1968
|
+
)
|
1969
|
+
for (var i = 0; i < value.length; i++)
|
1970
|
+
value[i] = reviveModel(
|
1971
|
+
response,
|
1972
|
+
value,
|
1973
|
+
"" + i,
|
1974
|
+
value[i],
|
1975
|
+
void 0 !== reference ? reference + ":" + i : void 0
|
1976
|
+
);
|
1977
|
+
else
|
1978
|
+
for (i in value)
|
1979
|
+
hasOwnProperty.call(value, i) &&
|
1980
|
+
((parentObj =
|
1981
|
+
void 0 !== reference && -1 === i.indexOf(":")
|
1982
|
+
? reference + ":" + i
|
1983
|
+
: void 0),
|
1984
|
+
(parentObj = reviveModel(response, value, i, value[i], parentObj)),
|
1985
|
+
void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);
|
1986
|
+
return value;
|
1987
|
+
}
|
1618
1988
|
var initializingChunk = null,
|
1619
1989
|
initializingChunkBlockedModel = null;
|
1620
1990
|
function initializeModelChunk(chunk) {
|
@@ -1622,15 +1992,34 @@ function initializeModelChunk(chunk) {
|
|
1622
1992
|
prevBlocked = initializingChunkBlockedModel;
|
1623
1993
|
initializingChunk = chunk;
|
1624
1994
|
initializingChunkBlockedModel = null;
|
1995
|
+
var rootReference = -1 === chunk.reason ? void 0 : chunk.reason.toString(16),
|
1996
|
+
resolvedModel = chunk.value;
|
1997
|
+
chunk.status = "cyclic";
|
1998
|
+
chunk.value = null;
|
1999
|
+
chunk.reason = null;
|
1625
2000
|
try {
|
1626
|
-
var
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
2001
|
+
var rawModel = JSON.parse(resolvedModel),
|
2002
|
+
value = reviveModel(
|
2003
|
+
chunk._response,
|
2004
|
+
{ "": rawModel },
|
2005
|
+
"",
|
2006
|
+
rawModel,
|
2007
|
+
rootReference
|
2008
|
+
);
|
2009
|
+
if (
|
2010
|
+
null !== initializingChunkBlockedModel &&
|
2011
|
+
0 < initializingChunkBlockedModel.deps
|
2012
|
+
)
|
2013
|
+
(initializingChunkBlockedModel.value = value),
|
1630
2014
|
(chunk.status = "blocked"),
|
1631
2015
|
(chunk.value = null),
|
1632
|
-
(chunk.reason = null)
|
1633
|
-
|
2016
|
+
(chunk.reason = null);
|
2017
|
+
else {
|
2018
|
+
var resolveListeners = chunk.value;
|
2019
|
+
chunk.status = "fulfilled";
|
2020
|
+
chunk.value = value;
|
2021
|
+
null !== resolveListeners && wakeChunk(resolveListeners, value);
|
2022
|
+
}
|
1634
2023
|
} catch (error) {
|
1635
2024
|
(chunk.status = "rejected"), (chunk.reason = error);
|
1636
2025
|
} finally {
|
@@ -1650,18 +2039,32 @@ function getChunk(response, id) {
|
|
1650
2039
|
((chunk = response._formData.get(response._prefix + id)),
|
1651
2040
|
(chunk =
|
1652
2041
|
null != chunk
|
1653
|
-
? new Chunk("resolved_model", chunk,
|
1654
|
-
:
|
2042
|
+
? new Chunk("resolved_model", chunk, id, response)
|
2043
|
+
: createPendingChunk(response)),
|
1655
2044
|
chunks.set(id, chunk));
|
1656
2045
|
return chunk;
|
1657
2046
|
}
|
1658
|
-
function createModelResolver(
|
2047
|
+
function createModelResolver(
|
2048
|
+
chunk,
|
2049
|
+
parentObject,
|
2050
|
+
key,
|
2051
|
+
cyclic,
|
2052
|
+
response,
|
2053
|
+
map,
|
2054
|
+
path
|
2055
|
+
) {
|
1659
2056
|
if (initializingChunkBlockedModel) {
|
1660
2057
|
var blocked = initializingChunkBlockedModel;
|
1661
|
-
blocked.deps++;
|
1662
|
-
} else
|
2058
|
+
cyclic || blocked.deps++;
|
2059
|
+
} else
|
2060
|
+
blocked = initializingChunkBlockedModel = {
|
2061
|
+
deps: cyclic ? 0 : 1,
|
2062
|
+
value: null
|
2063
|
+
};
|
1663
2064
|
return function (value) {
|
1664
|
-
|
2065
|
+
for (var i = 1; i < path.length; i++) value = value[path[i]];
|
2066
|
+
parentObject[key] = map(response, value);
|
2067
|
+
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
|
1665
2068
|
blocked.deps--;
|
1666
2069
|
0 === blocked.deps &&
|
1667
2070
|
"blocked" === chunk.status &&
|
@@ -1676,13 +2079,240 @@ function createModelReject(chunk) {
|
|
1676
2079
|
return triggerErrorOnChunk(chunk, error);
|
1677
2080
|
};
|
1678
2081
|
}
|
1679
|
-
function getOutlinedModel(response,
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
2082
|
+
function getOutlinedModel(response, reference, parentObject, key, map) {
|
2083
|
+
reference = reference.split(":");
|
2084
|
+
var id = parseInt(reference[0], 16);
|
2085
|
+
id = getChunk(response, id);
|
2086
|
+
switch (id.status) {
|
2087
|
+
case "resolved_model":
|
2088
|
+
initializeModelChunk(id);
|
2089
|
+
}
|
2090
|
+
switch (id.status) {
|
2091
|
+
case "fulfilled":
|
2092
|
+
parentObject = id.value;
|
2093
|
+
for (key = 1; key < reference.length; key++)
|
2094
|
+
parentObject = parentObject[reference[key]];
|
2095
|
+
return map(response, parentObject);
|
2096
|
+
case "pending":
|
2097
|
+
case "blocked":
|
2098
|
+
case "cyclic":
|
2099
|
+
var parentChunk = initializingChunk;
|
2100
|
+
id.then(
|
2101
|
+
createModelResolver(
|
2102
|
+
parentChunk,
|
2103
|
+
parentObject,
|
2104
|
+
key,
|
2105
|
+
"cyclic" === id.status,
|
2106
|
+
response,
|
2107
|
+
map,
|
2108
|
+
reference
|
2109
|
+
),
|
2110
|
+
createModelReject(parentChunk)
|
2111
|
+
);
|
2112
|
+
return null;
|
2113
|
+
default:
|
2114
|
+
throw id.reason;
|
2115
|
+
}
|
2116
|
+
}
|
2117
|
+
function createMap(response, model) {
|
2118
|
+
return new Map(model);
|
2119
|
+
}
|
2120
|
+
function createSet(response, model) {
|
2121
|
+
return new Set(model);
|
2122
|
+
}
|
2123
|
+
function extractIterator(response, model) {
|
2124
|
+
return model[Symbol.iterator]();
|
2125
|
+
}
|
2126
|
+
function createModel(response, model) {
|
2127
|
+
return model;
|
2128
|
+
}
|
2129
|
+
function parseTypedArray(
|
2130
|
+
response,
|
2131
|
+
reference,
|
2132
|
+
constructor,
|
2133
|
+
bytesPerElement,
|
2134
|
+
parentObject,
|
2135
|
+
parentKey
|
2136
|
+
) {
|
2137
|
+
reference = parseInt(reference.slice(2), 16);
|
2138
|
+
reference = response._formData.get(response._prefix + reference);
|
2139
|
+
reference =
|
2140
|
+
constructor === ArrayBuffer
|
2141
|
+
? reference.arrayBuffer()
|
2142
|
+
: reference.arrayBuffer().then(function (buffer) {
|
2143
|
+
return new constructor(buffer);
|
2144
|
+
});
|
2145
|
+
bytesPerElement = initializingChunk;
|
2146
|
+
reference.then(
|
2147
|
+
createModelResolver(
|
2148
|
+
bytesPerElement,
|
2149
|
+
parentObject,
|
2150
|
+
parentKey,
|
2151
|
+
!1,
|
2152
|
+
response,
|
2153
|
+
createModel,
|
2154
|
+
[]
|
2155
|
+
),
|
2156
|
+
createModelReject(bytesPerElement)
|
2157
|
+
);
|
2158
|
+
return null;
|
2159
|
+
}
|
2160
|
+
function resolveStream(response, id, stream, controller) {
|
2161
|
+
var chunks = response._chunks;
|
2162
|
+
stream = new Chunk("fulfilled", stream, controller, response);
|
2163
|
+
chunks.set(id, stream);
|
2164
|
+
response = response._formData.getAll(response._prefix + id);
|
2165
|
+
for (id = 0; id < response.length; id++)
|
2166
|
+
(chunks = response[id]),
|
2167
|
+
"C" === chunks[0]
|
2168
|
+
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
2169
|
+
: controller.enqueueModel(chunks);
|
2170
|
+
}
|
2171
|
+
function parseReadableStream(response, reference, type) {
|
2172
|
+
reference = parseInt(reference.slice(2), 16);
|
2173
|
+
var controller = null;
|
2174
|
+
type = new ReadableStream({
|
2175
|
+
type: type,
|
2176
|
+
start: function (c) {
|
2177
|
+
controller = c;
|
2178
|
+
}
|
2179
|
+
});
|
2180
|
+
var previousBlockedChunk = null;
|
2181
|
+
resolveStream(response, reference, type, {
|
2182
|
+
enqueueModel: function (json) {
|
2183
|
+
if (null === previousBlockedChunk) {
|
2184
|
+
var chunk = new Chunk("resolved_model", json, -1, response);
|
2185
|
+
initializeModelChunk(chunk);
|
2186
|
+
"fulfilled" === chunk.status
|
2187
|
+
? controller.enqueue(chunk.value)
|
2188
|
+
: (chunk.then(
|
2189
|
+
function (v) {
|
2190
|
+
return controller.enqueue(v);
|
2191
|
+
},
|
2192
|
+
function (e) {
|
2193
|
+
return controller.error(e);
|
2194
|
+
}
|
2195
|
+
),
|
2196
|
+
(previousBlockedChunk = chunk));
|
2197
|
+
} else {
|
2198
|
+
chunk = previousBlockedChunk;
|
2199
|
+
var chunk$25 = createPendingChunk(response);
|
2200
|
+
chunk$25.then(
|
2201
|
+
function (v) {
|
2202
|
+
return controller.enqueue(v);
|
2203
|
+
},
|
2204
|
+
function (e) {
|
2205
|
+
return controller.error(e);
|
2206
|
+
}
|
2207
|
+
);
|
2208
|
+
previousBlockedChunk = chunk$25;
|
2209
|
+
chunk.then(function () {
|
2210
|
+
previousBlockedChunk === chunk$25 && (previousBlockedChunk = null);
|
2211
|
+
resolveModelChunk(chunk$25, json, -1);
|
2212
|
+
});
|
2213
|
+
}
|
2214
|
+
},
|
2215
|
+
close: function () {
|
2216
|
+
if (null === previousBlockedChunk) controller.close();
|
2217
|
+
else {
|
2218
|
+
var blockedChunk = previousBlockedChunk;
|
2219
|
+
previousBlockedChunk = null;
|
2220
|
+
blockedChunk.then(function () {
|
2221
|
+
return controller.close();
|
2222
|
+
});
|
2223
|
+
}
|
2224
|
+
},
|
2225
|
+
error: function (error) {
|
2226
|
+
if (null === previousBlockedChunk) controller.error(error);
|
2227
|
+
else {
|
2228
|
+
var blockedChunk = previousBlockedChunk;
|
2229
|
+
previousBlockedChunk = null;
|
2230
|
+
blockedChunk.then(function () {
|
2231
|
+
return controller.error(error);
|
2232
|
+
});
|
2233
|
+
}
|
2234
|
+
}
|
2235
|
+
});
|
2236
|
+
return type;
|
2237
|
+
}
|
2238
|
+
function asyncIterator() {
|
2239
|
+
return this;
|
2240
|
+
}
|
2241
|
+
function createIterator(next) {
|
2242
|
+
next = { next: next };
|
2243
|
+
next[ASYNC_ITERATOR] = asyncIterator;
|
2244
|
+
return next;
|
2245
|
+
}
|
2246
|
+
function parseAsyncIterable(response, reference, iterator) {
|
2247
|
+
reference = parseInt(reference.slice(2), 16);
|
2248
|
+
var buffer = [],
|
2249
|
+
closed = !1,
|
2250
|
+
nextWriteIndex = 0,
|
2251
|
+
$jscomp$compprop2 = {};
|
2252
|
+
$jscomp$compprop2 =
|
2253
|
+
(($jscomp$compprop2[ASYNC_ITERATOR] = function () {
|
2254
|
+
var nextReadIndex = 0;
|
2255
|
+
return createIterator(function (arg) {
|
2256
|
+
if (void 0 !== arg)
|
2257
|
+
throw Error(
|
2258
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
2259
|
+
);
|
2260
|
+
if (nextReadIndex === buffer.length) {
|
2261
|
+
if (closed)
|
2262
|
+
return new Chunk(
|
2263
|
+
"fulfilled",
|
2264
|
+
{ done: !0, value: void 0 },
|
2265
|
+
null,
|
2266
|
+
response
|
2267
|
+
);
|
2268
|
+
buffer[nextReadIndex] = createPendingChunk(response);
|
2269
|
+
}
|
2270
|
+
return buffer[nextReadIndex++];
|
2271
|
+
});
|
2272
|
+
}),
|
2273
|
+
$jscomp$compprop2);
|
2274
|
+
iterator = iterator ? $jscomp$compprop2[ASYNC_ITERATOR]() : $jscomp$compprop2;
|
2275
|
+
resolveStream(response, reference, iterator, {
|
2276
|
+
enqueueModel: function (value) {
|
2277
|
+
nextWriteIndex === buffer.length
|
2278
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2279
|
+
response,
|
2280
|
+
value,
|
2281
|
+
!1
|
2282
|
+
))
|
2283
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);
|
2284
|
+
nextWriteIndex++;
|
2285
|
+
},
|
2286
|
+
close: function (value) {
|
2287
|
+
closed = !0;
|
2288
|
+
nextWriteIndex === buffer.length
|
2289
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2290
|
+
response,
|
2291
|
+
value,
|
2292
|
+
!0
|
2293
|
+
))
|
2294
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);
|
2295
|
+
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
2296
|
+
resolveIteratorResultChunk(
|
2297
|
+
buffer[nextWriteIndex++],
|
2298
|
+
'"$undefined"',
|
2299
|
+
!0
|
2300
|
+
);
|
2301
|
+
},
|
2302
|
+
error: function (error) {
|
2303
|
+
closed = !0;
|
2304
|
+
for (
|
2305
|
+
nextWriteIndex === buffer.length &&
|
2306
|
+
(buffer[nextWriteIndex] = createPendingChunk(response));
|
2307
|
+
nextWriteIndex < buffer.length;
|
2308
|
+
|
2309
|
+
)
|
2310
|
+
triggerErrorOnChunk(buffer[nextWriteIndex++], error);
|
2311
|
+
}
|
2312
|
+
});
|
2313
|
+
return iterator;
|
1684
2314
|
}
|
1685
|
-
function parseModelString(response, obj, key, value) {
|
2315
|
+
function parseModelString(response, obj, key, value, reference) {
|
1686
2316
|
if ("$" === value[0]) {
|
1687
2317
|
switch (value[1]) {
|
1688
2318
|
case "$":
|
@@ -1691,8 +2321,8 @@ function parseModelString(response, obj, key, value) {
|
|
1691
2321
|
return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
|
1692
2322
|
case "F":
|
1693
2323
|
return (
|
1694
|
-
(value =
|
1695
|
-
(value = getOutlinedModel(response, value)),
|
2324
|
+
(value = value.slice(2)),
|
2325
|
+
(value = getOutlinedModel(response, value, obj, key, createModel)),
|
1696
2326
|
loadServerReference$1(
|
1697
2327
|
response,
|
1698
2328
|
value.id,
|
@@ -1703,32 +2333,37 @@ function parseModelString(response, obj, key, value) {
|
|
1703
2333
|
)
|
1704
2334
|
);
|
1705
2335
|
case "T":
|
1706
|
-
|
2336
|
+
if (void 0 === reference || void 0 === response._temporaryReferences)
|
2337
|
+
throw Error(
|
2338
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
2339
|
+
);
|
2340
|
+
return createTemporaryReference(
|
2341
|
+
response._temporaryReferences,
|
2342
|
+
reference
|
2343
|
+
);
|
1707
2344
|
case "Q":
|
1708
2345
|
return (
|
1709
|
-
(
|
1710
|
-
(response
|
1711
|
-
new Map(response)
|
2346
|
+
(value = value.slice(2)),
|
2347
|
+
getOutlinedModel(response, value, obj, key, createMap)
|
1712
2348
|
);
|
1713
2349
|
case "W":
|
1714
2350
|
return (
|
1715
|
-
(
|
1716
|
-
(response
|
1717
|
-
new Set(response)
|
2351
|
+
(value = value.slice(2)),
|
2352
|
+
getOutlinedModel(response, value, obj, key, createSet)
|
1718
2353
|
);
|
1719
2354
|
case "K":
|
1720
2355
|
obj = value.slice(2);
|
1721
2356
|
var formPrefix = response._prefix + obj + "_",
|
1722
|
-
data
|
2357
|
+
data = new FormData();
|
1723
2358
|
response._formData.forEach(function (entry, entryKey) {
|
1724
2359
|
entryKey.startsWith(formPrefix) &&
|
1725
|
-
data
|
2360
|
+
data.append(entryKey.slice(formPrefix.length), entry);
|
1726
2361
|
});
|
1727
|
-
return data
|
2362
|
+
return data;
|
1728
2363
|
case "i":
|
1729
2364
|
return (
|
1730
|
-
(
|
1731
|
-
getOutlinedModel(response, obj)
|
2365
|
+
(value = value.slice(2)),
|
2366
|
+
getOutlinedModel(response, value, obj, key, extractIterator)
|
1732
2367
|
);
|
1733
2368
|
case "I":
|
1734
2369
|
return Infinity;
|
@@ -1743,49 +2378,67 @@ function parseModelString(response, obj, key, value) {
|
|
1743
2378
|
case "n":
|
1744
2379
|
return BigInt(value.slice(2));
|
1745
2380
|
}
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
case "
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
case "
|
1754
|
-
return response
|
1755
|
-
case "
|
1756
|
-
|
2381
|
+
switch (value[1]) {
|
2382
|
+
case "A":
|
2383
|
+
return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
|
2384
|
+
case "O":
|
2385
|
+
return parseTypedArray(response, value, Int8Array, 1, obj, key);
|
2386
|
+
case "o":
|
2387
|
+
return parseTypedArray(response, value, Uint8Array, 1, obj, key);
|
2388
|
+
case "U":
|
2389
|
+
return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);
|
2390
|
+
case "S":
|
2391
|
+
return parseTypedArray(response, value, Int16Array, 2, obj, key);
|
2392
|
+
case "s":
|
2393
|
+
return parseTypedArray(response, value, Uint16Array, 2, obj, key);
|
2394
|
+
case "L":
|
2395
|
+
return parseTypedArray(response, value, Int32Array, 4, obj, key);
|
2396
|
+
case "l":
|
2397
|
+
return parseTypedArray(response, value, Uint32Array, 4, obj, key);
|
2398
|
+
case "G":
|
2399
|
+
return parseTypedArray(response, value, Float32Array, 4, obj, key);
|
2400
|
+
case "g":
|
2401
|
+
return parseTypedArray(response, value, Float64Array, 8, obj, key);
|
2402
|
+
case "M":
|
2403
|
+
return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
|
2404
|
+
case "m":
|
2405
|
+
return parseTypedArray(response, value, BigUint64Array, 8, obj, key);
|
2406
|
+
case "V":
|
2407
|
+
return parseTypedArray(response, value, DataView, 1, obj, key);
|
2408
|
+
case "B":
|
1757
2409
|
return (
|
1758
|
-
(
|
1759
|
-
response.
|
1760
|
-
createModelResolver(value, obj, key),
|
1761
|
-
createModelReject(value)
|
1762
|
-
),
|
1763
|
-
null
|
2410
|
+
(obj = parseInt(value.slice(2), 16)),
|
2411
|
+
response._formData.get(response._prefix + obj)
|
1764
2412
|
);
|
1765
|
-
default:
|
1766
|
-
throw response.reason;
|
1767
2413
|
}
|
2414
|
+
switch (value[1]) {
|
2415
|
+
case "R":
|
2416
|
+
return parseReadableStream(response, value, void 0);
|
2417
|
+
case "r":
|
2418
|
+
return parseReadableStream(response, value, "bytes");
|
2419
|
+
case "X":
|
2420
|
+
return parseAsyncIterable(response, value, !1);
|
2421
|
+
case "x":
|
2422
|
+
return parseAsyncIterable(response, value, !0);
|
2423
|
+
}
|
2424
|
+
value = value.slice(1);
|
2425
|
+
return getOutlinedModel(response, value, obj, key, createModel);
|
1768
2426
|
}
|
1769
2427
|
return value;
|
1770
2428
|
}
|
1771
|
-
function createResponse(bundlerConfig, formFieldPrefix) {
|
2429
|
+
function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
1772
2430
|
var backingFormData =
|
1773
|
-
|
1774
|
-
? arguments[
|
2431
|
+
3 < arguments.length && void 0 !== arguments[3]
|
2432
|
+
? arguments[3]
|
1775
2433
|
: new FormData(),
|
1776
|
-
chunks = new Map()
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
? parseModelString(response, this, key, value)
|
1785
|
-
: value;
|
1786
|
-
}
|
1787
|
-
};
|
1788
|
-
return response;
|
2434
|
+
chunks = new Map();
|
2435
|
+
return {
|
2436
|
+
_bundlerConfig: bundlerConfig,
|
2437
|
+
_prefix: formFieldPrefix,
|
2438
|
+
_formData: backingFormData,
|
2439
|
+
_chunks: chunks,
|
2440
|
+
_temporaryReferences: temporaryReferences
|
2441
|
+
};
|
1789
2442
|
}
|
1790
2443
|
function close(response) {
|
1791
2444
|
reportGlobalError(response, Error("Connection closed."));
|
@@ -1806,7 +2459,7 @@ function loadServerReference(bundlerConfig, id, bound) {
|
|
1806
2459
|
: Promise.resolve(requireModule(serverReference));
|
1807
2460
|
}
|
1808
2461
|
function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
|
1809
|
-
body = createResponse(serverManifest, formFieldPrefix, body);
|
2462
|
+
body = createResponse(serverManifest, formFieldPrefix, void 0, body);
|
1810
2463
|
close(body);
|
1811
2464
|
body = getChunk(body, 0);
|
1812
2465
|
body.then(function () {});
|
@@ -1817,6 +2470,9 @@ exports.createClientModuleProxy = function (moduleId) {
|
|
1817
2470
|
moduleId = registerClientReferenceImpl({}, moduleId, !1);
|
1818
2471
|
return new Proxy(moduleId, proxyHandlers$1);
|
1819
2472
|
};
|
2473
|
+
exports.createTemporaryReferenceSet = function () {
|
2474
|
+
return new WeakMap();
|
2475
|
+
};
|
1820
2476
|
exports.decodeAction = function (body, serverManifest) {
|
1821
2477
|
var formData = new FormData(),
|
1822
2478
|
action = null;
|
@@ -1854,13 +2510,18 @@ exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
1854
2510
|
: [actionResult, keyPath, referenceId, bound.length - 1];
|
1855
2511
|
});
|
1856
2512
|
};
|
1857
|
-
exports.decodeReply = function (body, webpackMap) {
|
2513
|
+
exports.decodeReply = function (body, webpackMap, options) {
|
1858
2514
|
if ("string" === typeof body) {
|
1859
2515
|
var form = new FormData();
|
1860
2516
|
form.append("0", body);
|
1861
2517
|
body = form;
|
1862
2518
|
}
|
1863
|
-
body = createResponse(
|
2519
|
+
body = createResponse(
|
2520
|
+
webpackMap,
|
2521
|
+
"",
|
2522
|
+
options ? options.temporaryReferences : void 0,
|
2523
|
+
body
|
2524
|
+
);
|
1864
2525
|
webpackMap = getChunk(body, 0);
|
1865
2526
|
close(body);
|
1866
2527
|
return webpackMap;
|
@@ -1893,7 +2554,9 @@ exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
1893
2554
|
webpackMap,
|
1894
2555
|
options ? options.onError : void 0,
|
1895
2556
|
options ? options.identifierPrefix : void 0,
|
1896
|
-
options ? options.onPostpone : void 0
|
2557
|
+
options ? options.onPostpone : void 0,
|
2558
|
+
options ? options.environmentName : void 0,
|
2559
|
+
options ? options.temporaryReferences : void 0
|
1897
2560
|
);
|
1898
2561
|
if (options && options.signal) {
|
1899
2562
|
var signal = options.signal;
|