react-server-dom-webpack 19.0.0-canary-cf5ab8b8b2-20240425 → 19.0.0-rc-3f1436cca1-20240516
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)
|
@@ -352,10 +355,6 @@ var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
352
355
|
switch (name) {
|
353
356
|
case "$$typeof":
|
354
357
|
return target.$$typeof;
|
355
|
-
case "$$id":
|
356
|
-
return target.$$id;
|
357
|
-
case "$$async":
|
358
|
-
return target.$$async;
|
359
358
|
case "name":
|
360
359
|
return;
|
361
360
|
case "displayName":
|
@@ -385,18 +384,21 @@ var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
385
384
|
);
|
386
385
|
}
|
387
386
|
};
|
388
|
-
function createTemporaryReference(id) {
|
389
|
-
|
387
|
+
function createTemporaryReference(temporaryReferences, id) {
|
388
|
+
var reference = Object.defineProperties(
|
390
389
|
function () {
|
391
390
|
throw Error(
|
392
391
|
"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."
|
393
392
|
);
|
394
393
|
},
|
395
|
-
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG }
|
394
|
+
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
|
396
395
|
);
|
397
|
-
|
396
|
+
reference = new Proxy(reference, proxyHandlers);
|
397
|
+
temporaryReferences.set(reference, id);
|
398
|
+
return reference;
|
398
399
|
}
|
399
|
-
var
|
400
|
+
var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
401
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
400
402
|
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
401
403
|
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
402
404
|
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
@@ -414,9 +416,10 @@ function getIteratorFn(maybeIterable) {
|
|
414
416
|
maybeIterable["@@iterator"];
|
415
417
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
416
418
|
}
|
417
|
-
var
|
418
|
-
|
419
|
-
|
419
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
420
|
+
SuspenseException = Error(
|
421
|
+
"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`"
|
422
|
+
);
|
420
423
|
function noop() {}
|
421
424
|
function trackUsedThenable(thenableState, thenable, index) {
|
422
425
|
index = thenableState[index];
|
@@ -543,7 +546,7 @@ function use(usable) {
|
|
543
546
|
}
|
544
547
|
throw Error("An unsupported type was passed to use(): " + String(usable));
|
545
548
|
}
|
546
|
-
var
|
549
|
+
var DefaultAsyncDispatcher = {
|
547
550
|
getCacheForType: function (resourceType) {
|
548
551
|
var JSCompiler_inline_result = (JSCompiler_inline_result =
|
549
552
|
resolveRequest())
|
@@ -684,17 +687,19 @@ function createRequest(
|
|
684
687
|
bundlerConfig,
|
685
688
|
onError,
|
686
689
|
identifierPrefix,
|
687
|
-
onPostpone
|
690
|
+
onPostpone,
|
691
|
+
environmentName,
|
692
|
+
temporaryReferences
|
688
693
|
) {
|
689
694
|
if (
|
690
|
-
null !== ReactSharedInternalsServer.
|
691
|
-
ReactSharedInternalsServer.
|
695
|
+
null !== ReactSharedInternalsServer.A &&
|
696
|
+
ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
|
692
697
|
)
|
693
698
|
throw Error("Currently React only supports one RSC renderer at a time.");
|
694
|
-
ReactSharedInternalsServer.
|
695
|
-
var abortSet = new Set()
|
696
|
-
|
697
|
-
|
699
|
+
ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
|
700
|
+
var abortSet = new Set();
|
701
|
+
environmentName = [];
|
702
|
+
var hints = new Set();
|
698
703
|
bundlerConfig = {
|
699
704
|
status: 0,
|
700
705
|
flushScheduled: !1,
|
@@ -707,7 +712,7 @@ function createRequest(
|
|
707
712
|
hints: hints,
|
708
713
|
abortListeners: new Set(),
|
709
714
|
abortableTasks: abortSet,
|
710
|
-
pingedTasks:
|
715
|
+
pingedTasks: environmentName,
|
711
716
|
completedImportChunks: [],
|
712
717
|
completedHintChunks: [],
|
713
718
|
completedRegularChunks: [],
|
@@ -716,6 +721,7 @@ function createRequest(
|
|
716
721
|
writtenClientReferences: new Map(),
|
717
722
|
writtenServerReferences: new Map(),
|
718
723
|
writtenObjects: new WeakMap(),
|
724
|
+
temporaryReferences: temporaryReferences,
|
719
725
|
identifierPrefix: identifierPrefix || "",
|
720
726
|
identifierCount: 1,
|
721
727
|
taintCleanupQueue: [],
|
@@ -723,7 +729,7 @@ function createRequest(
|
|
723
729
|
onPostpone: void 0 === onPostpone ? defaultPostponeHandler : onPostpone
|
724
730
|
};
|
725
731
|
model = createTask(bundlerConfig, model, null, !1, abortSet);
|
726
|
-
|
732
|
+
environmentName.push(model);
|
727
733
|
return bundlerConfig;
|
728
734
|
}
|
729
735
|
var currentRequest = null;
|
@@ -784,12 +790,127 @@ function serializeThenable(request, task, thenable) {
|
|
784
790
|
);
|
785
791
|
return newTask.id;
|
786
792
|
}
|
793
|
+
function serializeReadableStream(request, task, stream) {
|
794
|
+
function progress(entry) {
|
795
|
+
if (!aborted)
|
796
|
+
if (entry.done)
|
797
|
+
request.abortListeners.delete(error),
|
798
|
+
(entry = streamTask.id.toString(16) + ":C\n"),
|
799
|
+
request.completedRegularChunks.push(stringToChunk(entry)),
|
800
|
+
enqueueFlush(request),
|
801
|
+
(aborted = !0);
|
802
|
+
else
|
803
|
+
try {
|
804
|
+
(streamTask.model = entry.value),
|
805
|
+
request.pendingChunks++,
|
806
|
+
emitChunk(request, streamTask, streamTask.model),
|
807
|
+
enqueueFlush(request),
|
808
|
+
reader.read().then(progress, error);
|
809
|
+
} catch (x$8) {
|
810
|
+
error(x$8);
|
811
|
+
}
|
812
|
+
}
|
813
|
+
function error(reason) {
|
814
|
+
if (!aborted) {
|
815
|
+
aborted = !0;
|
816
|
+
request.abortListeners.delete(error);
|
817
|
+
var digest = logRecoverableError(request, reason);
|
818
|
+
emitErrorChunk(request, streamTask.id, digest);
|
819
|
+
enqueueFlush(request);
|
820
|
+
reader.cancel(reason).then(error, error);
|
821
|
+
}
|
822
|
+
}
|
823
|
+
var supportsBYOB = stream.supportsBYOB;
|
824
|
+
if (void 0 === supportsBYOB)
|
825
|
+
try {
|
826
|
+
stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
|
827
|
+
} catch (x) {
|
828
|
+
supportsBYOB = !1;
|
829
|
+
}
|
830
|
+
var reader = stream.getReader(),
|
831
|
+
streamTask = createTask(
|
832
|
+
request,
|
833
|
+
task.model,
|
834
|
+
task.keyPath,
|
835
|
+
task.implicitSlot,
|
836
|
+
request.abortableTasks
|
837
|
+
);
|
838
|
+
request.abortableTasks.delete(streamTask);
|
839
|
+
request.pendingChunks++;
|
840
|
+
task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
|
841
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
842
|
+
var aborted = !1;
|
843
|
+
request.abortListeners.add(error);
|
844
|
+
reader.read().then(progress, error);
|
845
|
+
return serializeByValueID(streamTask.id);
|
846
|
+
}
|
847
|
+
function serializeAsyncIterable(request, task, iterable, iterator) {
|
848
|
+
function progress(entry) {
|
849
|
+
if (!aborted)
|
850
|
+
if (entry.done) {
|
851
|
+
request.abortListeners.delete(error);
|
852
|
+
if (void 0 === entry.value)
|
853
|
+
var endStreamRow = streamTask.id.toString(16) + ":C\n";
|
854
|
+
else
|
855
|
+
try {
|
856
|
+
var chunkId = outlineModel(request, entry.value);
|
857
|
+
endStreamRow =
|
858
|
+
streamTask.id.toString(16) +
|
859
|
+
":C" +
|
860
|
+
stringify(serializeByValueID(chunkId)) +
|
861
|
+
"\n";
|
862
|
+
} catch (x) {
|
863
|
+
error(x);
|
864
|
+
return;
|
865
|
+
}
|
866
|
+
request.completedRegularChunks.push(stringToChunk(endStreamRow));
|
867
|
+
enqueueFlush(request);
|
868
|
+
aborted = !0;
|
869
|
+
} else
|
870
|
+
try {
|
871
|
+
(streamTask.model = entry.value),
|
872
|
+
request.pendingChunks++,
|
873
|
+
emitChunk(request, streamTask, streamTask.model),
|
874
|
+
enqueueFlush(request),
|
875
|
+
iterator.next().then(progress, error);
|
876
|
+
} catch (x$9) {
|
877
|
+
error(x$9);
|
878
|
+
}
|
879
|
+
}
|
880
|
+
function error(reason) {
|
881
|
+
if (!aborted) {
|
882
|
+
aborted = !0;
|
883
|
+
request.abortListeners.delete(error);
|
884
|
+
var digest = logRecoverableError(request, reason);
|
885
|
+
emitErrorChunk(request, streamTask.id, digest);
|
886
|
+
enqueueFlush(request);
|
887
|
+
"function" === typeof iterator.throw &&
|
888
|
+
iterator.throw(reason).then(error, error);
|
889
|
+
}
|
890
|
+
}
|
891
|
+
iterable = iterable === iterator;
|
892
|
+
var streamTask = createTask(
|
893
|
+
request,
|
894
|
+
task.model,
|
895
|
+
task.keyPath,
|
896
|
+
task.implicitSlot,
|
897
|
+
request.abortableTasks
|
898
|
+
);
|
899
|
+
request.abortableTasks.delete(streamTask);
|
900
|
+
request.pendingChunks++;
|
901
|
+
task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
|
902
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
903
|
+
var aborted = !1;
|
904
|
+
request.abortListeners.add(error);
|
905
|
+
iterator.next().then(progress, error);
|
906
|
+
return serializeByValueID(streamTask.id);
|
907
|
+
}
|
787
908
|
function emitHint(request, code, model) {
|
788
909
|
model = stringify(model);
|
789
910
|
var id = request.nextChunkId++;
|
790
911
|
code = "H" + code;
|
791
912
|
code = id.toString(16) + ":" + code;
|
792
|
-
model =
|
913
|
+
model = stringToChunk(code + model + "\n");
|
793
914
|
request.completedHintChunks.push(model);
|
794
915
|
enqueueFlush(request);
|
795
916
|
}
|
@@ -841,6 +962,20 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
841
962
|
return iteratorFn.call(iterableChild);
|
842
963
|
}),
|
843
964
|
Component);
|
965
|
+
} else if (
|
966
|
+
!(
|
967
|
+
"function" !== typeof Component[ASYNC_ITERATOR] ||
|
968
|
+
("function" === typeof ReadableStream &&
|
969
|
+
Component instanceof ReadableStream)
|
970
|
+
)
|
971
|
+
) {
|
972
|
+
var iterableChild$10 = Component;
|
973
|
+
Component = {};
|
974
|
+
Component =
|
975
|
+
((Component[ASYNC_ITERATOR] = function () {
|
976
|
+
return iterableChild$10[ASYNC_ITERATOR]();
|
977
|
+
}),
|
978
|
+
Component);
|
844
979
|
}
|
845
980
|
}
|
846
981
|
props = task.keyPath;
|
@@ -932,7 +1067,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
932
1067
|
null === model ||
|
933
1068
|
null !== keyPath ||
|
934
1069
|
implicitSlot ||
|
935
|
-
request.writtenObjects.set(model, id);
|
1070
|
+
request.writtenObjects.set(model, serializeByValueID(id));
|
936
1071
|
var task = {
|
937
1072
|
id: id,
|
938
1073
|
status: 0,
|
@@ -1013,7 +1148,7 @@ function serializeByValueID(id) {
|
|
1013
1148
|
function encodeReferenceChunk(request, id, reference) {
|
1014
1149
|
request = stringify(reference);
|
1015
1150
|
id = id.toString(16) + ":" + request + "\n";
|
1016
|
-
return
|
1151
|
+
return stringToChunk(id);
|
1017
1152
|
}
|
1018
1153
|
function serializeClientReference(
|
1019
1154
|
request,
|
@@ -1056,7 +1191,7 @@ function serializeClientReference(
|
|
1056
1191
|
var importId = request.nextChunkId++,
|
1057
1192
|
json = stringify(JSCompiler_inline_result),
|
1058
1193
|
row = importId.toString(16) + ":I" + json + "\n",
|
1059
|
-
processedChunk =
|
1194
|
+
processedChunk = stringToChunk(row);
|
1060
1195
|
request.completedImportChunks.push(processedChunk);
|
1061
1196
|
writtenClientReferences.set(clientReferenceKey, importId);
|
1062
1197
|
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
@@ -1077,6 +1212,43 @@ function outlineModel(request, value) {
|
|
1077
1212
|
retryTask(request, value);
|
1078
1213
|
return value.id;
|
1079
1214
|
}
|
1215
|
+
function serializeTypedArray(request, tag, typedArray) {
|
1216
|
+
request.pendingChunks++;
|
1217
|
+
var bufferId = request.nextChunkId++;
|
1218
|
+
emitTypedArrayChunk(request, bufferId, tag, typedArray);
|
1219
|
+
return serializeByValueID(bufferId);
|
1220
|
+
}
|
1221
|
+
function serializeBlob(request, blob) {
|
1222
|
+
function progress(entry) {
|
1223
|
+
if (!aborted)
|
1224
|
+
if (entry.done)
|
1225
|
+
request.abortListeners.delete(error),
|
1226
|
+
(aborted = !0),
|
1227
|
+
pingTask(request, newTask);
|
1228
|
+
else
|
1229
|
+
return (
|
1230
|
+
model.push(entry.value), reader.read().then(progress).catch(error)
|
1231
|
+
);
|
1232
|
+
}
|
1233
|
+
function error(reason) {
|
1234
|
+
if (!aborted) {
|
1235
|
+
aborted = !0;
|
1236
|
+
request.abortListeners.delete(error);
|
1237
|
+
var digest = logRecoverableError(request, reason);
|
1238
|
+
emitErrorChunk(request, newTask.id, digest);
|
1239
|
+
request.abortableTasks.delete(newTask);
|
1240
|
+
enqueueFlush(request);
|
1241
|
+
reader.cancel(reason).then(error, error);
|
1242
|
+
}
|
1243
|
+
}
|
1244
|
+
var model = [blob.type],
|
1245
|
+
newTask = createTask(request, model, null, !1, request.abortableTasks),
|
1246
|
+
reader = blob.stream().getReader(),
|
1247
|
+
aborted = !1;
|
1248
|
+
request.abortListeners.add(error);
|
1249
|
+
reader.read().then(progress).catch(error);
|
1250
|
+
return "$B" + newTask.id.toString(16);
|
1251
|
+
}
|
1080
1252
|
var modelRoot = !1;
|
1081
1253
|
function renderModelDestructive(
|
1082
1254
|
request,
|
@@ -1091,34 +1263,39 @@ function renderModelDestructive(
|
|
1091
1263
|
if ("object" === typeof value) {
|
1092
1264
|
switch (value.$$typeof) {
|
1093
1265
|
case REACT_ELEMENT_TYPE:
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
if (
|
1266
|
+
var writtenObjects = request.writtenObjects;
|
1267
|
+
if (null === task.keyPath && !task.implicitSlot) {
|
1268
|
+
var existingReference = writtenObjects.get(value);
|
1269
|
+
if (void 0 !== existingReference)
|
1098
1270
|
if (modelRoot === value) modelRoot = null;
|
1099
|
-
else
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
parentPropertyName =
|
1271
|
+
else return existingReference;
|
1272
|
+
else
|
1273
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1274
|
+
((parent = writtenObjects.get(parent)),
|
1275
|
+
void 0 !== parent &&
|
1276
|
+
writtenObjects.set(value, parent + ":" + parentPropertyName));
|
1277
|
+
}
|
1278
|
+
parentPropertyName = value.props;
|
1279
|
+
parent = parentPropertyName.ref;
|
1107
1280
|
return renderElement(
|
1108
1281
|
request,
|
1109
1282
|
task,
|
1110
1283
|
value.type,
|
1111
1284
|
value.key,
|
1112
|
-
void 0 !==
|
1113
|
-
|
1285
|
+
void 0 !== parent ? parent : null,
|
1286
|
+
parentPropertyName
|
1114
1287
|
);
|
1115
1288
|
case REACT_LAZY_TYPE:
|
1116
1289
|
return (
|
1117
1290
|
(task.thenableState = null),
|
1118
|
-
(
|
1119
|
-
(value =
|
1291
|
+
(parentPropertyName = value._init),
|
1292
|
+
(value = parentPropertyName(value._payload)),
|
1120
1293
|
renderModelDestructive(request, task, emptyRoot, "", value)
|
1121
1294
|
);
|
1295
|
+
case REACT_LEGACY_ELEMENT_TYPE:
|
1296
|
+
throw Error(
|
1297
|
+
'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.'
|
1298
|
+
);
|
1122
1299
|
}
|
1123
1300
|
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
1124
1301
|
return serializeClientReference(
|
@@ -1127,65 +1304,120 @@ function renderModelDestructive(
|
|
1127
1304
|
parentPropertyName,
|
1128
1305
|
value
|
1129
1306
|
);
|
1130
|
-
|
1131
|
-
|
1307
|
+
if (
|
1308
|
+
void 0 !== request.temporaryReferences &&
|
1309
|
+
((writtenObjects = request.temporaryReferences.get(value)),
|
1310
|
+
void 0 !== writtenObjects)
|
1311
|
+
)
|
1312
|
+
return "$T" + writtenObjects;
|
1313
|
+
writtenObjects = request.writtenObjects;
|
1314
|
+
existingReference = writtenObjects.get(value);
|
1132
1315
|
if ("function" === typeof value.then) {
|
1133
|
-
if (void 0 !==
|
1316
|
+
if (void 0 !== existingReference) {
|
1134
1317
|
if (null !== task.keyPath || task.implicitSlot)
|
1135
1318
|
return "$@" + serializeThenable(request, task, value).toString(16);
|
1136
1319
|
if (modelRoot === value) modelRoot = null;
|
1137
|
-
else return
|
1320
|
+
else return existingReference;
|
1138
1321
|
}
|
1139
|
-
request = serializeThenable(request, task, value);
|
1140
|
-
|
1141
|
-
return
|
1322
|
+
request = "$@" + serializeThenable(request, task, value).toString(16);
|
1323
|
+
writtenObjects.set(value, request);
|
1324
|
+
return request;
|
1142
1325
|
}
|
1143
|
-
if (void 0 !==
|
1326
|
+
if (void 0 !== existingReference)
|
1144
1327
|
if (modelRoot === value) modelRoot = null;
|
1145
|
-
else
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
"
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
parentPropertyName.set(parent, -1));
|
1165
|
-
return "$Q" + outlineModel(request, value).toString(16);
|
1166
|
-
}
|
1167
|
-
if (value instanceof Set) {
|
1168
|
-
value = Array.from(value);
|
1169
|
-
for (task = 0; task < value.length; task++)
|
1170
|
-
(parent = value[task]),
|
1171
|
-
"object" === typeof parent &&
|
1172
|
-
null !== parent &&
|
1173
|
-
((parentPropertyName = request.writtenObjects),
|
1174
|
-
void 0 === parentPropertyName.get(parent) &&
|
1175
|
-
parentPropertyName.set(parent, -1));
|
1176
|
-
return "$W" + outlineModel(request, value).toString(16);
|
1328
|
+
else return existingReference;
|
1329
|
+
else if (
|
1330
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1331
|
+
((existingReference = writtenObjects.get(parent)),
|
1332
|
+
void 0 !== existingReference)
|
1333
|
+
) {
|
1334
|
+
var propertyName = parentPropertyName;
|
1335
|
+
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
1336
|
+
switch (parentPropertyName) {
|
1337
|
+
case "1":
|
1338
|
+
propertyName = "type";
|
1339
|
+
break;
|
1340
|
+
case "2":
|
1341
|
+
propertyName = "key";
|
1342
|
+
break;
|
1343
|
+
case "3":
|
1344
|
+
propertyName = "props";
|
1345
|
+
}
|
1346
|
+
writtenObjects.set(value, existingReference + ":" + propertyName);
|
1177
1347
|
}
|
1348
|
+
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
1349
|
+
if (value instanceof Map)
|
1350
|
+
return (
|
1351
|
+
(value = Array.from(value)),
|
1352
|
+
"$Q" + outlineModel(request, value).toString(16)
|
1353
|
+
);
|
1354
|
+
if (value instanceof Set)
|
1355
|
+
return (
|
1356
|
+
(value = Array.from(value)),
|
1357
|
+
"$W" + outlineModel(request, value).toString(16)
|
1358
|
+
);
|
1178
1359
|
if ("function" === typeof FormData && value instanceof FormData)
|
1179
1360
|
return (
|
1180
1361
|
(value = Array.from(value.entries())),
|
1181
1362
|
"$K" + outlineModel(request, value).toString(16)
|
1182
1363
|
);
|
1183
|
-
if (
|
1364
|
+
if (value instanceof ArrayBuffer)
|
1365
|
+
return serializeTypedArray(request, "A", new Uint8Array(value));
|
1366
|
+
if (value instanceof Int8Array)
|
1367
|
+
return serializeTypedArray(request, "O", value);
|
1368
|
+
if (value instanceof Uint8Array)
|
1369
|
+
return serializeTypedArray(request, "o", value);
|
1370
|
+
if (value instanceof Uint8ClampedArray)
|
1371
|
+
return serializeTypedArray(request, "U", value);
|
1372
|
+
if (value instanceof Int16Array)
|
1373
|
+
return serializeTypedArray(request, "S", value);
|
1374
|
+
if (value instanceof Uint16Array)
|
1375
|
+
return serializeTypedArray(request, "s", value);
|
1376
|
+
if (value instanceof Int32Array)
|
1377
|
+
return serializeTypedArray(request, "L", value);
|
1378
|
+
if (value instanceof Uint32Array)
|
1379
|
+
return serializeTypedArray(request, "l", value);
|
1380
|
+
if (value instanceof Float32Array)
|
1381
|
+
return serializeTypedArray(request, "G", value);
|
1382
|
+
if (value instanceof Float64Array)
|
1383
|
+
return serializeTypedArray(request, "g", value);
|
1384
|
+
if (value instanceof BigInt64Array)
|
1385
|
+
return serializeTypedArray(request, "M", value);
|
1386
|
+
if (value instanceof BigUint64Array)
|
1387
|
+
return serializeTypedArray(request, "m", value);
|
1388
|
+
if (value instanceof DataView)
|
1389
|
+
return serializeTypedArray(request, "V", value);
|
1390
|
+
if ("function" === typeof Blob && value instanceof Blob)
|
1391
|
+
return serializeBlob(request, value);
|
1392
|
+
if ((parentPropertyName = getIteratorFn(value)))
|
1184
1393
|
return (
|
1185
|
-
(
|
1186
|
-
|
1187
|
-
? "$i" +
|
1188
|
-
|
1394
|
+
(parentPropertyName = parentPropertyName.call(value)),
|
1395
|
+
parentPropertyName === value
|
1396
|
+
? "$i" +
|
1397
|
+
outlineModel(request, Array.from(parentPropertyName)).toString(16)
|
1398
|
+
: renderFragment(request, task, Array.from(parentPropertyName))
|
1399
|
+
);
|
1400
|
+
if ("function" === typeof ReadableStream && value instanceof ReadableStream)
|
1401
|
+
return serializeReadableStream(request, task, value);
|
1402
|
+
parentPropertyName = value[ASYNC_ITERATOR];
|
1403
|
+
if ("function" === typeof parentPropertyName)
|
1404
|
+
return (
|
1405
|
+
null !== task.keyPath
|
1406
|
+
? ((request = [
|
1407
|
+
REACT_ELEMENT_TYPE,
|
1408
|
+
REACT_FRAGMENT_TYPE,
|
1409
|
+
task.keyPath,
|
1410
|
+
{ children: value }
|
1411
|
+
]),
|
1412
|
+
(request = task.implicitSlot ? [request] : request))
|
1413
|
+
: ((parentPropertyName = parentPropertyName.call(value)),
|
1414
|
+
(request = serializeAsyncIterable(
|
1415
|
+
request,
|
1416
|
+
task,
|
1417
|
+
value,
|
1418
|
+
parentPropertyName
|
1419
|
+
))),
|
1420
|
+
request
|
1189
1421
|
);
|
1190
1422
|
request = getPrototypeOf(value);
|
1191
1423
|
if (
|
@@ -1236,20 +1468,30 @@ function renderModelDestructive(
|
|
1236
1468
|
if (value.$$typeof === SERVER_REFERENCE_TAG)
|
1237
1469
|
return (
|
1238
1470
|
(task = request.writtenServerReferences),
|
1239
|
-
(
|
1240
|
-
void 0 !==
|
1241
|
-
? (request = "$F" +
|
1242
|
-
: ((
|
1243
|
-
(
|
1471
|
+
(parentPropertyName = task.get(value)),
|
1472
|
+
void 0 !== parentPropertyName
|
1473
|
+
? (request = "$F" + parentPropertyName.toString(16))
|
1474
|
+
: ((parentPropertyName = value.$$bound),
|
1475
|
+
(parentPropertyName = {
|
1244
1476
|
id: value.$$id,
|
1245
|
-
bound:
|
1477
|
+
bound: parentPropertyName
|
1478
|
+
? Promise.resolve(parentPropertyName)
|
1479
|
+
: null
|
1246
1480
|
}),
|
1247
|
-
(request = outlineModel(request,
|
1481
|
+
(request = outlineModel(request, parentPropertyName)),
|
1248
1482
|
task.set(value, request),
|
1249
1483
|
(request = "$F" + request.toString(16))),
|
1250
1484
|
request
|
1251
1485
|
);
|
1252
|
-
if (
|
1486
|
+
if (
|
1487
|
+
void 0 !== request.temporaryReferences &&
|
1488
|
+
((request = request.temporaryReferences.get(value)), void 0 !== request)
|
1489
|
+
)
|
1490
|
+
return "$T" + request;
|
1491
|
+
if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
|
1492
|
+
throw Error(
|
1493
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
1494
|
+
);
|
1253
1495
|
if (/^on[A-Z]/.test(parentPropertyName))
|
1254
1496
|
throw Error(
|
1255
1497
|
"Event handlers cannot be passed to Client Component props." +
|
@@ -1263,25 +1505,25 @@ function renderModelDestructive(
|
|
1263
1505
|
}
|
1264
1506
|
if ("symbol" === typeof value) {
|
1265
1507
|
task = request.writtenSymbols;
|
1266
|
-
|
1267
|
-
if (void 0 !==
|
1268
|
-
|
1269
|
-
if (Symbol.for(
|
1508
|
+
writtenObjects = task.get(value);
|
1509
|
+
if (void 0 !== writtenObjects) return serializeByValueID(writtenObjects);
|
1510
|
+
writtenObjects = value.description;
|
1511
|
+
if (Symbol.for(writtenObjects) !== value)
|
1270
1512
|
throw Error(
|
1271
1513
|
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
1272
1514
|
(value.description + ") cannot be found among global symbols.") +
|
1273
1515
|
describeObjectForErrorMessage(parent, parentPropertyName)
|
1274
1516
|
);
|
1275
1517
|
request.pendingChunks++;
|
1276
|
-
|
1277
|
-
|
1518
|
+
parentPropertyName = request.nextChunkId++;
|
1519
|
+
parent = encodeReferenceChunk(
|
1278
1520
|
request,
|
1279
|
-
|
1280
|
-
"$S" +
|
1521
|
+
parentPropertyName,
|
1522
|
+
"$S" + writtenObjects
|
1281
1523
|
);
|
1282
|
-
request.completedImportChunks.push(
|
1283
|
-
task.set(value,
|
1284
|
-
return serializeByValueID(
|
1524
|
+
request.completedImportChunks.push(parent);
|
1525
|
+
task.set(value, parentPropertyName);
|
1526
|
+
return serializeByValueID(parentPropertyName);
|
1285
1527
|
}
|
1286
1528
|
if ("bigint" === typeof value) return "$n" + value.toString(10);
|
1287
1529
|
throw Error(
|
@@ -1318,22 +1560,68 @@ function fatalError(request, error) {
|
|
1318
1560
|
function emitErrorChunk(request, id, digest) {
|
1319
1561
|
digest = { digest: digest };
|
1320
1562
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1321
|
-
id =
|
1563
|
+
id = stringToChunk(id);
|
1322
1564
|
request.completedErrorChunks.push(id);
|
1323
1565
|
}
|
1324
1566
|
function emitModelChunk(request, id, json) {
|
1325
1567
|
id = id.toString(16) + ":" + json + "\n";
|
1326
|
-
id =
|
1568
|
+
id = stringToChunk(id);
|
1327
1569
|
request.completedRegularChunks.push(id);
|
1328
1570
|
}
|
1571
|
+
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1572
|
+
request.pendingChunks++;
|
1573
|
+
var buffer = new Uint8Array(
|
1574
|
+
typedArray.buffer,
|
1575
|
+
typedArray.byteOffset,
|
1576
|
+
typedArray.byteLength
|
1577
|
+
);
|
1578
|
+
typedArray = 2048 < typedArray.byteLength ? buffer.slice() : buffer;
|
1579
|
+
buffer = typedArray.byteLength;
|
1580
|
+
id = id.toString(16) + ":" + tag + buffer.toString(16) + ",";
|
1581
|
+
id = stringToChunk(id);
|
1582
|
+
request.completedRegularChunks.push(id, typedArray);
|
1583
|
+
}
|
1329
1584
|
function emitTextChunk(request, id, text) {
|
1330
1585
|
request.pendingChunks++;
|
1331
|
-
text =
|
1586
|
+
text = stringToChunk(text);
|
1332
1587
|
var binaryLength = text.byteLength;
|
1333
1588
|
id = id.toString(16) + ":T" + binaryLength.toString(16) + ",";
|
1334
|
-
id =
|
1589
|
+
id = stringToChunk(id);
|
1335
1590
|
request.completedRegularChunks.push(id, text);
|
1336
1591
|
}
|
1592
|
+
function emitChunk(request, task, value) {
|
1593
|
+
var id = task.id;
|
1594
|
+
"string" === typeof value
|
1595
|
+
? emitTextChunk(request, id, value)
|
1596
|
+
: value instanceof ArrayBuffer
|
1597
|
+
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
|
1598
|
+
: value instanceof Int8Array
|
1599
|
+
? emitTypedArrayChunk(request, id, "O", value)
|
1600
|
+
: value instanceof Uint8Array
|
1601
|
+
? emitTypedArrayChunk(request, id, "o", value)
|
1602
|
+
: value instanceof Uint8ClampedArray
|
1603
|
+
? emitTypedArrayChunk(request, id, "U", value)
|
1604
|
+
: value instanceof Int16Array
|
1605
|
+
? emitTypedArrayChunk(request, id, "S", value)
|
1606
|
+
: value instanceof Uint16Array
|
1607
|
+
? emitTypedArrayChunk(request, id, "s", value)
|
1608
|
+
: value instanceof Int32Array
|
1609
|
+
? emitTypedArrayChunk(request, id, "L", value)
|
1610
|
+
: value instanceof Uint32Array
|
1611
|
+
? emitTypedArrayChunk(request, id, "l", value)
|
1612
|
+
: value instanceof Float32Array
|
1613
|
+
? emitTypedArrayChunk(request, id, "G", value)
|
1614
|
+
: value instanceof Float64Array
|
1615
|
+
? emitTypedArrayChunk(request, id, "g", value)
|
1616
|
+
: value instanceof BigInt64Array
|
1617
|
+
? emitTypedArrayChunk(request, id, "M", value)
|
1618
|
+
: value instanceof BigUint64Array
|
1619
|
+
? emitTypedArrayChunk(request, id, "m", value)
|
1620
|
+
: value instanceof DataView
|
1621
|
+
? emitTypedArrayChunk(request, id, "V", value)
|
1622
|
+
: ((value = stringify(value, task.toJSON)),
|
1623
|
+
emitModelChunk(request, task.id, value));
|
1624
|
+
}
|
1337
1625
|
var emptyRoot = {};
|
1338
1626
|
function retryTask(request, task) {
|
1339
1627
|
if (0 === task.status)
|
@@ -1349,17 +1637,12 @@ function retryTask(request, task) {
|
|
1349
1637
|
modelRoot = resolvedModel;
|
1350
1638
|
task.keyPath = null;
|
1351
1639
|
task.implicitSlot = !1;
|
1352
|
-
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
emitModelChunk(request, task.id, json);
|
1359
|
-
}
|
1360
|
-
} else {
|
1361
|
-
var json$jscomp$0 = stringify(resolvedModel);
|
1362
|
-
emitModelChunk(request, task.id, json$jscomp$0);
|
1640
|
+
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
1641
|
+
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1642
|
+
emitChunk(request, task, resolvedModel);
|
1643
|
+
else {
|
1644
|
+
var json = stringify(resolvedModel);
|
1645
|
+
emitModelChunk(request, task.id, json);
|
1363
1646
|
}
|
1364
1647
|
request.abortableTasks.delete(task);
|
1365
1648
|
task.status = 1;
|
@@ -1484,19 +1767,19 @@ function abort(request, reason) {
|
|
1484
1767
|
}
|
1485
1768
|
var abortListeners = request.abortListeners;
|
1486
1769
|
if (0 < abortListeners.size) {
|
1487
|
-
var error$
|
1770
|
+
var error$22 =
|
1488
1771
|
void 0 === reason
|
1489
1772
|
? Error("The render was aborted by the server without a reason.")
|
1490
1773
|
: reason;
|
1491
1774
|
abortListeners.forEach(function (callback) {
|
1492
|
-
return callback(error$
|
1775
|
+
return callback(error$22);
|
1493
1776
|
});
|
1494
1777
|
abortListeners.clear();
|
1495
1778
|
}
|
1496
1779
|
null !== request.destination &&
|
1497
1780
|
flushCompletedChunks(request, request.destination);
|
1498
|
-
} catch (error$
|
1499
|
-
logRecoverableError(request, error$
|
1781
|
+
} catch (error$23) {
|
1782
|
+
logRecoverableError(request, error$23), fatalError(request, error$23);
|
1500
1783
|
}
|
1501
1784
|
}
|
1502
1785
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -1572,6 +1855,7 @@ function requireModule(metadata) {
|
|
1572
1855
|
: moduleExports
|
1573
1856
|
: moduleExports[metadata[2]];
|
1574
1857
|
}
|
1858
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
1575
1859
|
function Chunk(status, value, reason, response) {
|
1576
1860
|
this.status = status;
|
1577
1861
|
this.value = value;
|
@@ -1590,6 +1874,7 @@ Chunk.prototype.then = function (resolve, reject) {
|
|
1590
1874
|
break;
|
1591
1875
|
case "pending":
|
1592
1876
|
case "blocked":
|
1877
|
+
case "cyclic":
|
1593
1878
|
resolve &&
|
1594
1879
|
(null === this.value && (this.value = []), this.value.push(resolve));
|
1595
1880
|
reject &&
|
@@ -1599,17 +1884,65 @@ Chunk.prototype.then = function (resolve, reject) {
|
|
1599
1884
|
reject(this.reason);
|
1600
1885
|
}
|
1601
1886
|
};
|
1887
|
+
function createPendingChunk(response) {
|
1888
|
+
return new Chunk("pending", null, null, response);
|
1889
|
+
}
|
1602
1890
|
function wakeChunk(listeners, value) {
|
1603
1891
|
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
|
1604
1892
|
}
|
1605
1893
|
function triggerErrorOnChunk(chunk, error) {
|
1606
|
-
if ("pending"
|
1894
|
+
if ("pending" !== chunk.status && "blocked" !== chunk.status)
|
1895
|
+
chunk.reason.error(error);
|
1896
|
+
else {
|
1607
1897
|
var listeners = chunk.reason;
|
1608
1898
|
chunk.status = "rejected";
|
1609
1899
|
chunk.reason = error;
|
1610
1900
|
null !== listeners && wakeChunk(listeners, error);
|
1611
1901
|
}
|
1612
1902
|
}
|
1903
|
+
function resolveModelChunk(chunk, value, id) {
|
1904
|
+
if ("pending" !== chunk.status)
|
1905
|
+
(chunk = chunk.reason),
|
1906
|
+
"C" === value[0]
|
1907
|
+
? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
|
1908
|
+
: chunk.enqueueModel(value);
|
1909
|
+
else {
|
1910
|
+
var resolveListeners = chunk.value,
|
1911
|
+
rejectListeners = chunk.reason;
|
1912
|
+
chunk.status = "resolved_model";
|
1913
|
+
chunk.value = value;
|
1914
|
+
chunk.reason = id;
|
1915
|
+
if (null !== resolveListeners)
|
1916
|
+
switch ((initializeModelChunk(chunk), chunk.status)) {
|
1917
|
+
case "fulfilled":
|
1918
|
+
wakeChunk(resolveListeners, chunk.value);
|
1919
|
+
break;
|
1920
|
+
case "pending":
|
1921
|
+
case "blocked":
|
1922
|
+
case "cyclic":
|
1923
|
+
chunk.value = resolveListeners;
|
1924
|
+
chunk.reason = rejectListeners;
|
1925
|
+
break;
|
1926
|
+
case "rejected":
|
1927
|
+
rejectListeners && wakeChunk(rejectListeners, chunk.reason);
|
1928
|
+
}
|
1929
|
+
}
|
1930
|
+
}
|
1931
|
+
function createResolvedIteratorResultChunk(response, value, done) {
|
1932
|
+
return new Chunk(
|
1933
|
+
"resolved_model",
|
1934
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
1935
|
+
-1,
|
1936
|
+
response
|
1937
|
+
);
|
1938
|
+
}
|
1939
|
+
function resolveIteratorResultChunk(chunk, value, done) {
|
1940
|
+
resolveModelChunk(
|
1941
|
+
chunk,
|
1942
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
1943
|
+
-1
|
1944
|
+
);
|
1945
|
+
}
|
1613
1946
|
function loadServerReference$1(
|
1614
1947
|
response,
|
1615
1948
|
id,
|
@@ -1619,24 +1952,61 @@ function loadServerReference$1(
|
|
1619
1952
|
key
|
1620
1953
|
) {
|
1621
1954
|
var serverReference = resolveServerReference(response._bundlerConfig, id);
|
1622
|
-
|
1955
|
+
id = preloadModule(serverReference);
|
1623
1956
|
if (bound)
|
1624
|
-
bound = Promise.all([bound,
|
1957
|
+
bound = Promise.all([bound, id]).then(function (_ref) {
|
1625
1958
|
_ref = _ref[0];
|
1626
1959
|
var fn = requireModule(serverReference);
|
1627
1960
|
return fn.bind.apply(fn, [null].concat(_ref));
|
1628
1961
|
});
|
1629
|
-
else if (
|
1630
|
-
bound = Promise.resolve(
|
1962
|
+
else if (id)
|
1963
|
+
bound = Promise.resolve(id).then(function () {
|
1631
1964
|
return requireModule(serverReference);
|
1632
1965
|
});
|
1633
1966
|
else return requireModule(serverReference);
|
1634
1967
|
bound.then(
|
1635
|
-
createModelResolver(
|
1968
|
+
createModelResolver(
|
1969
|
+
parentChunk,
|
1970
|
+
parentObject,
|
1971
|
+
key,
|
1972
|
+
!1,
|
1973
|
+
response,
|
1974
|
+
createModel,
|
1975
|
+
[]
|
1976
|
+
),
|
1636
1977
|
createModelReject(parentChunk)
|
1637
1978
|
);
|
1638
1979
|
return null;
|
1639
1980
|
}
|
1981
|
+
function reviveModel(response, parentObj, parentKey, value, reference) {
|
1982
|
+
if ("string" === typeof value)
|
1983
|
+
return parseModelString(response, parentObj, parentKey, value, reference);
|
1984
|
+
if ("object" === typeof value && null !== value)
|
1985
|
+
if (
|
1986
|
+
(void 0 !== reference &&
|
1987
|
+
void 0 !== response._temporaryReferences &&
|
1988
|
+
response._temporaryReferences.set(value, reference),
|
1989
|
+
Array.isArray(value))
|
1990
|
+
)
|
1991
|
+
for (var i = 0; i < value.length; i++)
|
1992
|
+
value[i] = reviveModel(
|
1993
|
+
response,
|
1994
|
+
value,
|
1995
|
+
"" + i,
|
1996
|
+
value[i],
|
1997
|
+
void 0 !== reference ? reference + ":" + i : void 0
|
1998
|
+
);
|
1999
|
+
else
|
2000
|
+
for (i in value)
|
2001
|
+
hasOwnProperty.call(value, i) &&
|
2002
|
+
((parentObj =
|
2003
|
+
void 0 !== reference && -1 === i.indexOf(":")
|
2004
|
+
? reference + ":" + i
|
2005
|
+
: void 0),
|
2006
|
+
(parentObj = reviveModel(response, value, i, value[i], parentObj)),
|
2007
|
+
void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);
|
2008
|
+
return value;
|
2009
|
+
}
|
1640
2010
|
var initializingChunk = null,
|
1641
2011
|
initializingChunkBlockedModel = null;
|
1642
2012
|
function initializeModelChunk(chunk) {
|
@@ -1644,15 +2014,34 @@ function initializeModelChunk(chunk) {
|
|
1644
2014
|
prevBlocked = initializingChunkBlockedModel;
|
1645
2015
|
initializingChunk = chunk;
|
1646
2016
|
initializingChunkBlockedModel = null;
|
2017
|
+
var rootReference = -1 === chunk.reason ? void 0 : chunk.reason.toString(16),
|
2018
|
+
resolvedModel = chunk.value;
|
2019
|
+
chunk.status = "cyclic";
|
2020
|
+
chunk.value = null;
|
2021
|
+
chunk.reason = null;
|
1647
2022
|
try {
|
1648
|
-
var
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
2023
|
+
var rawModel = JSON.parse(resolvedModel),
|
2024
|
+
value = reviveModel(
|
2025
|
+
chunk._response,
|
2026
|
+
{ "": rawModel },
|
2027
|
+
"",
|
2028
|
+
rawModel,
|
2029
|
+
rootReference
|
2030
|
+
);
|
2031
|
+
if (
|
2032
|
+
null !== initializingChunkBlockedModel &&
|
2033
|
+
0 < initializingChunkBlockedModel.deps
|
2034
|
+
)
|
2035
|
+
(initializingChunkBlockedModel.value = value),
|
1652
2036
|
(chunk.status = "blocked"),
|
1653
2037
|
(chunk.value = null),
|
1654
|
-
(chunk.reason = null)
|
1655
|
-
|
2038
|
+
(chunk.reason = null);
|
2039
|
+
else {
|
2040
|
+
var resolveListeners = chunk.value;
|
2041
|
+
chunk.status = "fulfilled";
|
2042
|
+
chunk.value = value;
|
2043
|
+
null !== resolveListeners && wakeChunk(resolveListeners, value);
|
2044
|
+
}
|
1656
2045
|
} catch (error) {
|
1657
2046
|
(chunk.status = "rejected"), (chunk.reason = error);
|
1658
2047
|
} finally {
|
@@ -1672,18 +2061,32 @@ function getChunk(response, id) {
|
|
1672
2061
|
((chunk = response._formData.get(response._prefix + id)),
|
1673
2062
|
(chunk =
|
1674
2063
|
null != chunk
|
1675
|
-
? new Chunk("resolved_model", chunk,
|
1676
|
-
:
|
2064
|
+
? new Chunk("resolved_model", chunk, id, response)
|
2065
|
+
: createPendingChunk(response)),
|
1677
2066
|
chunks.set(id, chunk));
|
1678
2067
|
return chunk;
|
1679
2068
|
}
|
1680
|
-
function createModelResolver(
|
2069
|
+
function createModelResolver(
|
2070
|
+
chunk,
|
2071
|
+
parentObject,
|
2072
|
+
key,
|
2073
|
+
cyclic,
|
2074
|
+
response,
|
2075
|
+
map,
|
2076
|
+
path
|
2077
|
+
) {
|
1681
2078
|
if (initializingChunkBlockedModel) {
|
1682
2079
|
var blocked = initializingChunkBlockedModel;
|
1683
|
-
blocked.deps++;
|
1684
|
-
} else
|
2080
|
+
cyclic || blocked.deps++;
|
2081
|
+
} else
|
2082
|
+
blocked = initializingChunkBlockedModel = {
|
2083
|
+
deps: cyclic ? 0 : 1,
|
2084
|
+
value: null
|
2085
|
+
};
|
1685
2086
|
return function (value) {
|
1686
|
-
|
2087
|
+
for (var i = 1; i < path.length; i++) value = value[path[i]];
|
2088
|
+
parentObject[key] = map(response, value);
|
2089
|
+
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
|
1687
2090
|
blocked.deps--;
|
1688
2091
|
0 === blocked.deps &&
|
1689
2092
|
"blocked" === chunk.status &&
|
@@ -1698,13 +2101,240 @@ function createModelReject(chunk) {
|
|
1698
2101
|
return triggerErrorOnChunk(chunk, error);
|
1699
2102
|
};
|
1700
2103
|
}
|
1701
|
-
function getOutlinedModel(response,
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
2104
|
+
function getOutlinedModel(response, reference, parentObject, key, map) {
|
2105
|
+
reference = reference.split(":");
|
2106
|
+
var id = parseInt(reference[0], 16);
|
2107
|
+
id = getChunk(response, id);
|
2108
|
+
switch (id.status) {
|
2109
|
+
case "resolved_model":
|
2110
|
+
initializeModelChunk(id);
|
2111
|
+
}
|
2112
|
+
switch (id.status) {
|
2113
|
+
case "fulfilled":
|
2114
|
+
parentObject = id.value;
|
2115
|
+
for (key = 1; key < reference.length; key++)
|
2116
|
+
parentObject = parentObject[reference[key]];
|
2117
|
+
return map(response, parentObject);
|
2118
|
+
case "pending":
|
2119
|
+
case "blocked":
|
2120
|
+
case "cyclic":
|
2121
|
+
var parentChunk = initializingChunk;
|
2122
|
+
id.then(
|
2123
|
+
createModelResolver(
|
2124
|
+
parentChunk,
|
2125
|
+
parentObject,
|
2126
|
+
key,
|
2127
|
+
"cyclic" === id.status,
|
2128
|
+
response,
|
2129
|
+
map,
|
2130
|
+
reference
|
2131
|
+
),
|
2132
|
+
createModelReject(parentChunk)
|
2133
|
+
);
|
2134
|
+
return null;
|
2135
|
+
default:
|
2136
|
+
throw id.reason;
|
2137
|
+
}
|
2138
|
+
}
|
2139
|
+
function createMap(response, model) {
|
2140
|
+
return new Map(model);
|
2141
|
+
}
|
2142
|
+
function createSet(response, model) {
|
2143
|
+
return new Set(model);
|
2144
|
+
}
|
2145
|
+
function extractIterator(response, model) {
|
2146
|
+
return model[Symbol.iterator]();
|
2147
|
+
}
|
2148
|
+
function createModel(response, model) {
|
2149
|
+
return model;
|
2150
|
+
}
|
2151
|
+
function parseTypedArray(
|
2152
|
+
response,
|
2153
|
+
reference,
|
2154
|
+
constructor,
|
2155
|
+
bytesPerElement,
|
2156
|
+
parentObject,
|
2157
|
+
parentKey
|
2158
|
+
) {
|
2159
|
+
reference = parseInt(reference.slice(2), 16);
|
2160
|
+
reference = response._formData.get(response._prefix + reference);
|
2161
|
+
reference =
|
2162
|
+
constructor === ArrayBuffer
|
2163
|
+
? reference.arrayBuffer()
|
2164
|
+
: reference.arrayBuffer().then(function (buffer) {
|
2165
|
+
return new constructor(buffer);
|
2166
|
+
});
|
2167
|
+
bytesPerElement = initializingChunk;
|
2168
|
+
reference.then(
|
2169
|
+
createModelResolver(
|
2170
|
+
bytesPerElement,
|
2171
|
+
parentObject,
|
2172
|
+
parentKey,
|
2173
|
+
!1,
|
2174
|
+
response,
|
2175
|
+
createModel,
|
2176
|
+
[]
|
2177
|
+
),
|
2178
|
+
createModelReject(bytesPerElement)
|
2179
|
+
);
|
2180
|
+
return null;
|
2181
|
+
}
|
2182
|
+
function resolveStream(response, id, stream, controller) {
|
2183
|
+
var chunks = response._chunks;
|
2184
|
+
stream = new Chunk("fulfilled", stream, controller, response);
|
2185
|
+
chunks.set(id, stream);
|
2186
|
+
response = response._formData.getAll(response._prefix + id);
|
2187
|
+
for (id = 0; id < response.length; id++)
|
2188
|
+
(chunks = response[id]),
|
2189
|
+
"C" === chunks[0]
|
2190
|
+
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
2191
|
+
: controller.enqueueModel(chunks);
|
2192
|
+
}
|
2193
|
+
function parseReadableStream(response, reference, type) {
|
2194
|
+
reference = parseInt(reference.slice(2), 16);
|
2195
|
+
var controller = null;
|
2196
|
+
type = new ReadableStream({
|
2197
|
+
type: type,
|
2198
|
+
start: function (c) {
|
2199
|
+
controller = c;
|
2200
|
+
}
|
2201
|
+
});
|
2202
|
+
var previousBlockedChunk = null;
|
2203
|
+
resolveStream(response, reference, type, {
|
2204
|
+
enqueueModel: function (json) {
|
2205
|
+
if (null === previousBlockedChunk) {
|
2206
|
+
var chunk = new Chunk("resolved_model", json, -1, response);
|
2207
|
+
initializeModelChunk(chunk);
|
2208
|
+
"fulfilled" === chunk.status
|
2209
|
+
? controller.enqueue(chunk.value)
|
2210
|
+
: (chunk.then(
|
2211
|
+
function (v) {
|
2212
|
+
return controller.enqueue(v);
|
2213
|
+
},
|
2214
|
+
function (e) {
|
2215
|
+
return controller.error(e);
|
2216
|
+
}
|
2217
|
+
),
|
2218
|
+
(previousBlockedChunk = chunk));
|
2219
|
+
} else {
|
2220
|
+
chunk = previousBlockedChunk;
|
2221
|
+
var chunk$25 = createPendingChunk(response);
|
2222
|
+
chunk$25.then(
|
2223
|
+
function (v) {
|
2224
|
+
return controller.enqueue(v);
|
2225
|
+
},
|
2226
|
+
function (e) {
|
2227
|
+
return controller.error(e);
|
2228
|
+
}
|
2229
|
+
);
|
2230
|
+
previousBlockedChunk = chunk$25;
|
2231
|
+
chunk.then(function () {
|
2232
|
+
previousBlockedChunk === chunk$25 && (previousBlockedChunk = null);
|
2233
|
+
resolveModelChunk(chunk$25, json, -1);
|
2234
|
+
});
|
2235
|
+
}
|
2236
|
+
},
|
2237
|
+
close: function () {
|
2238
|
+
if (null === previousBlockedChunk) controller.close();
|
2239
|
+
else {
|
2240
|
+
var blockedChunk = previousBlockedChunk;
|
2241
|
+
previousBlockedChunk = null;
|
2242
|
+
blockedChunk.then(function () {
|
2243
|
+
return controller.close();
|
2244
|
+
});
|
2245
|
+
}
|
2246
|
+
},
|
2247
|
+
error: function (error) {
|
2248
|
+
if (null === previousBlockedChunk) controller.error(error);
|
2249
|
+
else {
|
2250
|
+
var blockedChunk = previousBlockedChunk;
|
2251
|
+
previousBlockedChunk = null;
|
2252
|
+
blockedChunk.then(function () {
|
2253
|
+
return controller.error(error);
|
2254
|
+
});
|
2255
|
+
}
|
2256
|
+
}
|
2257
|
+
});
|
2258
|
+
return type;
|
2259
|
+
}
|
2260
|
+
function asyncIterator() {
|
2261
|
+
return this;
|
2262
|
+
}
|
2263
|
+
function createIterator(next) {
|
2264
|
+
next = { next: next };
|
2265
|
+
next[ASYNC_ITERATOR] = asyncIterator;
|
2266
|
+
return next;
|
2267
|
+
}
|
2268
|
+
function parseAsyncIterable(response, reference, iterator) {
|
2269
|
+
reference = parseInt(reference.slice(2), 16);
|
2270
|
+
var buffer = [],
|
2271
|
+
closed = !1,
|
2272
|
+
nextWriteIndex = 0,
|
2273
|
+
$jscomp$compprop2 = {};
|
2274
|
+
$jscomp$compprop2 =
|
2275
|
+
(($jscomp$compprop2[ASYNC_ITERATOR] = function () {
|
2276
|
+
var nextReadIndex = 0;
|
2277
|
+
return createIterator(function (arg) {
|
2278
|
+
if (void 0 !== arg)
|
2279
|
+
throw Error(
|
2280
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
2281
|
+
);
|
2282
|
+
if (nextReadIndex === buffer.length) {
|
2283
|
+
if (closed)
|
2284
|
+
return new Chunk(
|
2285
|
+
"fulfilled",
|
2286
|
+
{ done: !0, value: void 0 },
|
2287
|
+
null,
|
2288
|
+
response
|
2289
|
+
);
|
2290
|
+
buffer[nextReadIndex] = createPendingChunk(response);
|
2291
|
+
}
|
2292
|
+
return buffer[nextReadIndex++];
|
2293
|
+
});
|
2294
|
+
}),
|
2295
|
+
$jscomp$compprop2);
|
2296
|
+
iterator = iterator ? $jscomp$compprop2[ASYNC_ITERATOR]() : $jscomp$compprop2;
|
2297
|
+
resolveStream(response, reference, iterator, {
|
2298
|
+
enqueueModel: function (value) {
|
2299
|
+
nextWriteIndex === buffer.length
|
2300
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2301
|
+
response,
|
2302
|
+
value,
|
2303
|
+
!1
|
2304
|
+
))
|
2305
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);
|
2306
|
+
nextWriteIndex++;
|
2307
|
+
},
|
2308
|
+
close: function (value) {
|
2309
|
+
closed = !0;
|
2310
|
+
nextWriteIndex === buffer.length
|
2311
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2312
|
+
response,
|
2313
|
+
value,
|
2314
|
+
!0
|
2315
|
+
))
|
2316
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);
|
2317
|
+
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
2318
|
+
resolveIteratorResultChunk(
|
2319
|
+
buffer[nextWriteIndex++],
|
2320
|
+
'"$undefined"',
|
2321
|
+
!0
|
2322
|
+
);
|
2323
|
+
},
|
2324
|
+
error: function (error) {
|
2325
|
+
closed = !0;
|
2326
|
+
for (
|
2327
|
+
nextWriteIndex === buffer.length &&
|
2328
|
+
(buffer[nextWriteIndex] = createPendingChunk(response));
|
2329
|
+
nextWriteIndex < buffer.length;
|
2330
|
+
|
2331
|
+
)
|
2332
|
+
triggerErrorOnChunk(buffer[nextWriteIndex++], error);
|
2333
|
+
}
|
2334
|
+
});
|
2335
|
+
return iterator;
|
1706
2336
|
}
|
1707
|
-
function parseModelString(response, obj, key, value) {
|
2337
|
+
function parseModelString(response, obj, key, value, reference) {
|
1708
2338
|
if ("$" === value[0]) {
|
1709
2339
|
switch (value[1]) {
|
1710
2340
|
case "$":
|
@@ -1713,8 +2343,8 @@ function parseModelString(response, obj, key, value) {
|
|
1713
2343
|
return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
|
1714
2344
|
case "F":
|
1715
2345
|
return (
|
1716
|
-
(value =
|
1717
|
-
(value = getOutlinedModel(response, value)),
|
2346
|
+
(value = value.slice(2)),
|
2347
|
+
(value = getOutlinedModel(response, value, obj, key, createModel)),
|
1718
2348
|
loadServerReference$1(
|
1719
2349
|
response,
|
1720
2350
|
value.id,
|
@@ -1725,32 +2355,37 @@ function parseModelString(response, obj, key, value) {
|
|
1725
2355
|
)
|
1726
2356
|
);
|
1727
2357
|
case "T":
|
1728
|
-
|
2358
|
+
if (void 0 === reference || void 0 === response._temporaryReferences)
|
2359
|
+
throw Error(
|
2360
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
2361
|
+
);
|
2362
|
+
return createTemporaryReference(
|
2363
|
+
response._temporaryReferences,
|
2364
|
+
reference
|
2365
|
+
);
|
1729
2366
|
case "Q":
|
1730
2367
|
return (
|
1731
|
-
(
|
1732
|
-
(response
|
1733
|
-
new Map(response)
|
2368
|
+
(value = value.slice(2)),
|
2369
|
+
getOutlinedModel(response, value, obj, key, createMap)
|
1734
2370
|
);
|
1735
2371
|
case "W":
|
1736
2372
|
return (
|
1737
|
-
(
|
1738
|
-
(response
|
1739
|
-
new Set(response)
|
2373
|
+
(value = value.slice(2)),
|
2374
|
+
getOutlinedModel(response, value, obj, key, createSet)
|
1740
2375
|
);
|
1741
2376
|
case "K":
|
1742
2377
|
obj = value.slice(2);
|
1743
2378
|
var formPrefix = response._prefix + obj + "_",
|
1744
|
-
data
|
2379
|
+
data = new FormData();
|
1745
2380
|
response._formData.forEach(function (entry, entryKey) {
|
1746
2381
|
entryKey.startsWith(formPrefix) &&
|
1747
|
-
data
|
2382
|
+
data.append(entryKey.slice(formPrefix.length), entry);
|
1748
2383
|
});
|
1749
|
-
return data
|
2384
|
+
return data;
|
1750
2385
|
case "i":
|
1751
2386
|
return (
|
1752
|
-
(
|
1753
|
-
getOutlinedModel(response, obj)
|
2387
|
+
(value = value.slice(2)),
|
2388
|
+
getOutlinedModel(response, value, obj, key, extractIterator)
|
1754
2389
|
);
|
1755
2390
|
case "I":
|
1756
2391
|
return Infinity;
|
@@ -1765,49 +2400,67 @@ function parseModelString(response, obj, key, value) {
|
|
1765
2400
|
case "n":
|
1766
2401
|
return BigInt(value.slice(2));
|
1767
2402
|
}
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
case "
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
case "
|
1776
|
-
return response
|
1777
|
-
case "
|
1778
|
-
|
2403
|
+
switch (value[1]) {
|
2404
|
+
case "A":
|
2405
|
+
return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
|
2406
|
+
case "O":
|
2407
|
+
return parseTypedArray(response, value, Int8Array, 1, obj, key);
|
2408
|
+
case "o":
|
2409
|
+
return parseTypedArray(response, value, Uint8Array, 1, obj, key);
|
2410
|
+
case "U":
|
2411
|
+
return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);
|
2412
|
+
case "S":
|
2413
|
+
return parseTypedArray(response, value, Int16Array, 2, obj, key);
|
2414
|
+
case "s":
|
2415
|
+
return parseTypedArray(response, value, Uint16Array, 2, obj, key);
|
2416
|
+
case "L":
|
2417
|
+
return parseTypedArray(response, value, Int32Array, 4, obj, key);
|
2418
|
+
case "l":
|
2419
|
+
return parseTypedArray(response, value, Uint32Array, 4, obj, key);
|
2420
|
+
case "G":
|
2421
|
+
return parseTypedArray(response, value, Float32Array, 4, obj, key);
|
2422
|
+
case "g":
|
2423
|
+
return parseTypedArray(response, value, Float64Array, 8, obj, key);
|
2424
|
+
case "M":
|
2425
|
+
return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
|
2426
|
+
case "m":
|
2427
|
+
return parseTypedArray(response, value, BigUint64Array, 8, obj, key);
|
2428
|
+
case "V":
|
2429
|
+
return parseTypedArray(response, value, DataView, 1, obj, key);
|
2430
|
+
case "B":
|
1779
2431
|
return (
|
1780
|
-
(
|
1781
|
-
response.
|
1782
|
-
createModelResolver(value, obj, key),
|
1783
|
-
createModelReject(value)
|
1784
|
-
),
|
1785
|
-
null
|
2432
|
+
(obj = parseInt(value.slice(2), 16)),
|
2433
|
+
response._formData.get(response._prefix + obj)
|
1786
2434
|
);
|
1787
|
-
default:
|
1788
|
-
throw response.reason;
|
1789
2435
|
}
|
2436
|
+
switch (value[1]) {
|
2437
|
+
case "R":
|
2438
|
+
return parseReadableStream(response, value, void 0);
|
2439
|
+
case "r":
|
2440
|
+
return parseReadableStream(response, value, "bytes");
|
2441
|
+
case "X":
|
2442
|
+
return parseAsyncIterable(response, value, !1);
|
2443
|
+
case "x":
|
2444
|
+
return parseAsyncIterable(response, value, !0);
|
2445
|
+
}
|
2446
|
+
value = value.slice(1);
|
2447
|
+
return getOutlinedModel(response, value, obj, key, createModel);
|
1790
2448
|
}
|
1791
2449
|
return value;
|
1792
2450
|
}
|
1793
|
-
function createResponse(bundlerConfig, formFieldPrefix) {
|
2451
|
+
function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
1794
2452
|
var backingFormData =
|
1795
|
-
|
1796
|
-
? arguments[
|
2453
|
+
3 < arguments.length && void 0 !== arguments[3]
|
2454
|
+
? arguments[3]
|
1797
2455
|
: new FormData(),
|
1798
|
-
chunks = new Map()
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
? parseModelString(response, this, key, value)
|
1807
|
-
: value;
|
1808
|
-
}
|
1809
|
-
};
|
1810
|
-
return response;
|
2456
|
+
chunks = new Map();
|
2457
|
+
return {
|
2458
|
+
_bundlerConfig: bundlerConfig,
|
2459
|
+
_prefix: formFieldPrefix,
|
2460
|
+
_formData: backingFormData,
|
2461
|
+
_chunks: chunks,
|
2462
|
+
_temporaryReferences: temporaryReferences
|
2463
|
+
};
|
1811
2464
|
}
|
1812
2465
|
function close(response) {
|
1813
2466
|
reportGlobalError(response, Error("Connection closed."));
|
@@ -1828,7 +2481,7 @@ function loadServerReference(bundlerConfig, id, bound) {
|
|
1828
2481
|
: Promise.resolve(requireModule(serverReference));
|
1829
2482
|
}
|
1830
2483
|
function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
|
1831
|
-
body = createResponse(serverManifest, formFieldPrefix, body);
|
2484
|
+
body = createResponse(serverManifest, formFieldPrefix, void 0, body);
|
1832
2485
|
close(body);
|
1833
2486
|
body = getChunk(body, 0);
|
1834
2487
|
body.then(function () {});
|
@@ -1839,6 +2492,9 @@ exports.createClientModuleProxy = function (moduleId) {
|
|
1839
2492
|
moduleId = registerClientReferenceImpl({}, moduleId, !1);
|
1840
2493
|
return new Proxy(moduleId, proxyHandlers$1);
|
1841
2494
|
};
|
2495
|
+
exports.createTemporaryReferenceSet = function () {
|
2496
|
+
return new WeakMap();
|
2497
|
+
};
|
1842
2498
|
exports.decodeAction = function (body, serverManifest) {
|
1843
2499
|
var formData = new FormData(),
|
1844
2500
|
action = null;
|
@@ -1876,13 +2532,18 @@ exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
1876
2532
|
: [actionResult, keyPath, referenceId, bound.length - 1];
|
1877
2533
|
});
|
1878
2534
|
};
|
1879
|
-
exports.decodeReply = function (body, webpackMap) {
|
2535
|
+
exports.decodeReply = function (body, webpackMap, options) {
|
1880
2536
|
if ("string" === typeof body) {
|
1881
2537
|
var form = new FormData();
|
1882
2538
|
form.append("0", body);
|
1883
2539
|
body = form;
|
1884
2540
|
}
|
1885
|
-
body = createResponse(
|
2541
|
+
body = createResponse(
|
2542
|
+
webpackMap,
|
2543
|
+
"",
|
2544
|
+
options ? options.temporaryReferences : void 0,
|
2545
|
+
body
|
2546
|
+
);
|
1886
2547
|
webpackMap = getChunk(body, 0);
|
1887
2548
|
close(body);
|
1888
2549
|
return webpackMap;
|
@@ -1915,7 +2576,9 @@ exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
1915
2576
|
webpackMap,
|
1916
2577
|
options ? options.onError : void 0,
|
1917
2578
|
options ? options.identifierPrefix : void 0,
|
1918
|
-
options ? options.onPostpone : void 0
|
2579
|
+
options ? options.onPostpone : void 0,
|
2580
|
+
options ? options.environmentName : void 0,
|
2581
|
+
options ? options.temporaryReferences : void 0
|
1919
2582
|
);
|
1920
2583
|
if (options && options.signal) {
|
1921
2584
|
var signal = options.signal;
|