react-server-dom-webpack 19.0.0-rc-6230622a1a-20240610 → 19.0.0-rc-f3e09d6328-20240612
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 +1929 -3275
- package/cjs/react-server-dom-webpack-client.browser.production.js +167 -111
- package/cjs/react-server-dom-webpack-client.edge.development.js +2112 -3547
- package/cjs/react-server-dom-webpack-client.edge.production.js +167 -114
- package/cjs/react-server-dom-webpack-client.node.development.js +2072 -3508
- package/cjs/react-server-dom-webpack-client.node.production.js +151 -109
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2024 -3438
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +151 -109
- package/cjs/react-server-dom-webpack-server.browser.development.js +3297 -5256
- package/cjs/react-server-dom-webpack-server.browser.production.js +221 -139
- package/cjs/react-server-dom-webpack-server.edge.development.js +3305 -5267
- package/cjs/react-server-dom-webpack-server.edge.production.js +203 -140
- package/cjs/react-server-dom-webpack-server.node.development.js +3381 -5414
- package/cjs/react-server-dom-webpack-server.node.production.js +198 -146
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +3346 -5341
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +198 -146
- package/package.json +3 -3
@@ -10,7 +10,21 @@
|
|
10
10
|
|
11
11
|
"use strict";
|
12
12
|
var ReactDOM = require("react-dom"),
|
13
|
-
React = require("react")
|
13
|
+
React = require("react");
|
14
|
+
function handleErrorInNextTick(error) {
|
15
|
+
setTimeout(function () {
|
16
|
+
throw error;
|
17
|
+
});
|
18
|
+
}
|
19
|
+
var LocalPromise = Promise,
|
20
|
+
scheduleMicrotask =
|
21
|
+
"function" === typeof queueMicrotask
|
22
|
+
? queueMicrotask
|
23
|
+
: function (callback) {
|
24
|
+
LocalPromise.resolve(null)
|
25
|
+
.then(callback)
|
26
|
+
.catch(handleErrorInNextTick);
|
27
|
+
},
|
14
28
|
currentView = null,
|
15
29
|
writtenBytes = 0;
|
16
30
|
function writeChunkAndReturn(destination, chunk) {
|
@@ -677,12 +691,13 @@ if (!ReactSharedInternalsServer)
|
|
677
691
|
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
|
678
692
|
);
|
679
693
|
var ObjectPrototype = Object.prototype,
|
680
|
-
stringify = JSON.stringify
|
694
|
+
stringify = JSON.stringify,
|
695
|
+
AbortSigil = {};
|
681
696
|
function defaultErrorHandler(error) {
|
682
697
|
console.error(error);
|
683
698
|
}
|
684
699
|
function defaultPostponeHandler() {}
|
685
|
-
function
|
700
|
+
function RequestInstance(
|
686
701
|
model,
|
687
702
|
bundlerConfig,
|
688
703
|
onError,
|
@@ -700,37 +715,32 @@ function createRequest(
|
|
700
715
|
var abortSet = new Set();
|
701
716
|
environmentName = [];
|
702
717
|
var hints = new Set();
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
onError: void 0 === onError ? defaultErrorHandler : onError,
|
729
|
-
onPostpone: void 0 === onPostpone ? defaultPostponeHandler : onPostpone
|
730
|
-
};
|
731
|
-
model = createTask(bundlerConfig, model, null, !1, abortSet);
|
718
|
+
this.status = 0;
|
719
|
+
this.flushScheduled = !1;
|
720
|
+
this.destination = this.fatalError = null;
|
721
|
+
this.bundlerConfig = bundlerConfig;
|
722
|
+
this.cache = new Map();
|
723
|
+
this.pendingChunks = this.nextChunkId = 0;
|
724
|
+
this.hints = hints;
|
725
|
+
this.abortListeners = new Set();
|
726
|
+
this.abortableTasks = abortSet;
|
727
|
+
this.pingedTasks = environmentName;
|
728
|
+
this.completedImportChunks = [];
|
729
|
+
this.completedHintChunks = [];
|
730
|
+
this.completedRegularChunks = [];
|
731
|
+
this.completedErrorChunks = [];
|
732
|
+
this.writtenSymbols = new Map();
|
733
|
+
this.writtenClientReferences = new Map();
|
734
|
+
this.writtenServerReferences = new Map();
|
735
|
+
this.writtenObjects = new WeakMap();
|
736
|
+
this.temporaryReferences = temporaryReferences;
|
737
|
+
this.identifierPrefix = identifierPrefix || "";
|
738
|
+
this.identifierCount = 1;
|
739
|
+
this.taintCleanupQueue = [];
|
740
|
+
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
741
|
+
this.onPostpone = void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
|
742
|
+
model = createTask(this, model, null, !1, abortSet);
|
732
743
|
environmentName.push(model);
|
733
|
-
return bundlerConfig;
|
734
744
|
}
|
735
745
|
var currentRequest = null;
|
736
746
|
function resolveRequest() {
|
@@ -761,6 +771,14 @@ function serializeThenable(request, task, thenable) {
|
|
761
771
|
newTask.id
|
762
772
|
);
|
763
773
|
default:
|
774
|
+
if (1 === request.status)
|
775
|
+
return (
|
776
|
+
(newTask.status = 3),
|
777
|
+
(task = stringify(serializeByValueID(request.fatalError))),
|
778
|
+
emitModelChunk(request, newTask.id, task),
|
779
|
+
request.abortableTasks.delete(newTask),
|
780
|
+
newTask.id
|
781
|
+
);
|
764
782
|
"string" !== typeof thenable.status &&
|
765
783
|
((thenable.status = "pending"),
|
766
784
|
thenable.then(
|
@@ -947,6 +965,7 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
947
965
|
thenableIndexCounter = 0;
|
948
966
|
thenableState = prevThenableState;
|
949
967
|
Component = Component(props, void 0);
|
968
|
+
if (1 === request.status) throw AbortSigil;
|
950
969
|
if (
|
951
970
|
"object" === typeof Component &&
|
952
971
|
null !== Component &&
|
@@ -1044,6 +1063,7 @@ function renderElement(request, task, type, key, ref, props) {
|
|
1044
1063
|
case REACT_LAZY_TYPE:
|
1045
1064
|
var init = type._init;
|
1046
1065
|
type = init(type._payload);
|
1066
|
+
if (1 === request.status) throw AbortSigil;
|
1047
1067
|
return renderElement(request, task, type, key, ref, props);
|
1048
1068
|
case REACT_FORWARD_REF_TYPE:
|
1049
1069
|
return renderFunctionComponent(request, task, key, type.render, props);
|
@@ -1060,9 +1080,9 @@ function pingTask(request, task) {
|
|
1060
1080
|
pingedTasks.push(task);
|
1061
1081
|
1 === pingedTasks.length &&
|
1062
1082
|
((request.flushScheduled = null !== request.destination),
|
1063
|
-
|
1083
|
+
scheduleMicrotask(function () {
|
1064
1084
|
return performWork(request);
|
1065
|
-
}
|
1085
|
+
}));
|
1066
1086
|
}
|
1067
1087
|
function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
1068
1088
|
request.pendingChunks++;
|
@@ -1094,50 +1114,60 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
1094
1114
|
);
|
1095
1115
|
} catch (thrownValue) {
|
1096
1116
|
if (
|
1097
|
-
((parentPropertyName =
|
1117
|
+
((parentPropertyName = task.model),
|
1118
|
+
(parentPropertyName =
|
1119
|
+
"object" === typeof parentPropertyName &&
|
1120
|
+
null !== parentPropertyName &&
|
1121
|
+
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
1122
|
+
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
1123
|
+
(value =
|
1098
1124
|
thrownValue === SuspenseException
|
1099
1125
|
? getSuspendedThenable()
|
1100
1126
|
: thrownValue),
|
1101
|
-
|
1102
|
-
(value =
|
1103
|
-
"object" === typeof value &&
|
1127
|
+
"object" === typeof value &&
|
1104
1128
|
null !== value &&
|
1105
|
-
|
1106
|
-
value.$$typeof === REACT_LAZY_TYPE)),
|
1107
|
-
"object" === typeof parentPropertyName &&
|
1108
|
-
null !== parentPropertyName &&
|
1109
|
-
"function" === typeof parentPropertyName.then)
|
1110
|
-
) {
|
1111
|
-
JSCompiler_inline_result = createTask(
|
1112
|
-
request,
|
1113
|
-
task.model,
|
1114
|
-
task.keyPath,
|
1115
|
-
task.implicitSlot,
|
1116
|
-
request.abortableTasks
|
1117
|
-
);
|
1118
|
-
var ping = JSCompiler_inline_result.ping;
|
1119
|
-
parentPropertyName.then(ping, ping);
|
1120
|
-
JSCompiler_inline_result.thenableState =
|
1121
|
-
getThenableStateAfterSuspending();
|
1122
|
-
task.keyPath = prevKeyPath;
|
1123
|
-
task.implicitSlot = prevImplicitSlot;
|
1124
|
-
JSCompiler_inline_result = value
|
1125
|
-
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1126
|
-
: serializeByValueID(JSCompiler_inline_result.id);
|
1127
|
-
} else if (
|
1128
|
-
((task.keyPath = prevKeyPath),
|
1129
|
-
(task.implicitSlot = prevImplicitSlot),
|
1130
|
-
value)
|
1129
|
+
"function" === typeof value.then)
|
1131
1130
|
)
|
1132
|
-
request.
|
1133
|
-
(
|
1134
|
-
|
1131
|
+
if (1 === request.status)
|
1132
|
+
(task.status = 3),
|
1133
|
+
(prevKeyPath = request.fatalError),
|
1134
|
+
(JSCompiler_inline_result = parentPropertyName
|
1135
|
+
? "$L" + prevKeyPath.toString(16)
|
1136
|
+
: serializeByValueID(prevKeyPath));
|
1137
|
+
else {
|
1138
|
+
JSCompiler_inline_result = createTask(
|
1135
1139
|
request,
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1140
|
+
task.model,
|
1141
|
+
task.keyPath,
|
1142
|
+
task.implicitSlot,
|
1143
|
+
request.abortableTasks
|
1144
|
+
);
|
1145
|
+
var ping = JSCompiler_inline_result.ping;
|
1146
|
+
value.then(ping, ping);
|
1147
|
+
JSCompiler_inline_result.thenableState =
|
1148
|
+
getThenableStateAfterSuspending();
|
1149
|
+
task.keyPath = prevKeyPath;
|
1150
|
+
task.implicitSlot = prevImplicitSlot;
|
1151
|
+
JSCompiler_inline_result = parentPropertyName
|
1152
|
+
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1153
|
+
: serializeByValueID(JSCompiler_inline_result.id);
|
1154
|
+
}
|
1155
|
+
else
|
1156
|
+
thrownValue === AbortSigil
|
1157
|
+
? ((task.status = 3),
|
1158
|
+
(prevKeyPath = request.fatalError),
|
1159
|
+
(JSCompiler_inline_result = parentPropertyName
|
1160
|
+
? "$L" + prevKeyPath.toString(16)
|
1161
|
+
: serializeByValueID(prevKeyPath)))
|
1162
|
+
: ((task.keyPath = prevKeyPath),
|
1163
|
+
(task.implicitSlot = prevImplicitSlot),
|
1164
|
+
request.pendingChunks++,
|
1165
|
+
(prevKeyPath = request.nextChunkId++),
|
1166
|
+
(prevImplicitSlot = logRecoverableError(request, value)),
|
1167
|
+
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
1168
|
+
(JSCompiler_inline_result = parentPropertyName
|
1169
|
+
? "$L" + prevKeyPath.toString(16)
|
1170
|
+
: serializeByValueID(prevKeyPath)));
|
1141
1171
|
}
|
1142
1172
|
return JSCompiler_inline_result;
|
1143
1173
|
},
|
@@ -1267,7 +1297,8 @@ function renderModelDestructive(
|
|
1267
1297
|
if ("object" === typeof value) {
|
1268
1298
|
switch (value.$$typeof) {
|
1269
1299
|
case REACT_ELEMENT_TYPE:
|
1270
|
-
var
|
1300
|
+
var elementReference = null,
|
1301
|
+
writtenObjects = request.writtenObjects;
|
1271
1302
|
if (null === task.keyPath && !task.implicitSlot) {
|
1272
1303
|
var existingReference = writtenObjects.get(value);
|
1273
1304
|
if (void 0 !== existingReference)
|
@@ -1277,11 +1308,12 @@ function renderModelDestructive(
|
|
1277
1308
|
-1 === parentPropertyName.indexOf(":") &&
|
1278
1309
|
((parent = writtenObjects.get(parent)),
|
1279
1310
|
void 0 !== parent &&
|
1280
|
-
|
1311
|
+
((elementReference = parent + ":" + parentPropertyName),
|
1312
|
+
writtenObjects.set(value, elementReference)));
|
1281
1313
|
}
|
1282
1314
|
parentPropertyName = value.props;
|
1283
1315
|
parent = parentPropertyName.ref;
|
1284
|
-
|
1316
|
+
request = renderElement(
|
1285
1317
|
request,
|
1286
1318
|
task,
|
1287
1319
|
value.type,
|
@@ -1289,13 +1321,18 @@ function renderModelDestructive(
|
|
1289
1321
|
void 0 !== parent ? parent : null,
|
1290
1322
|
parentPropertyName
|
1291
1323
|
);
|
1324
|
+
"object" === typeof request &&
|
1325
|
+
null !== request &&
|
1326
|
+
null !== elementReference &&
|
1327
|
+
(writtenObjects.has(request) ||
|
1328
|
+
writtenObjects.set(request, elementReference));
|
1329
|
+
return request;
|
1292
1330
|
case REACT_LAZY_TYPE:
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
);
|
1331
|
+
task.thenableState = null;
|
1332
|
+
parentPropertyName = value._init;
|
1333
|
+
value = parentPropertyName(value._payload);
|
1334
|
+
if (1 === request.status) throw AbortSigil;
|
1335
|
+
return renderModelDestructive(request, task, emptyRoot, "", value);
|
1299
1336
|
case REACT_LEGACY_ELEMENT_TYPE:
|
1300
1337
|
throw Error(
|
1301
1338
|
'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.'
|
@@ -1310,44 +1347,44 @@ function renderModelDestructive(
|
|
1310
1347
|
);
|
1311
1348
|
if (
|
1312
1349
|
void 0 !== request.temporaryReferences &&
|
1313
|
-
((
|
1314
|
-
void 0 !==
|
1350
|
+
((elementReference = request.temporaryReferences.get(value)),
|
1351
|
+
void 0 !== elementReference)
|
1315
1352
|
)
|
1316
|
-
return "$T" +
|
1317
|
-
|
1318
|
-
|
1353
|
+
return "$T" + elementReference;
|
1354
|
+
elementReference = request.writtenObjects;
|
1355
|
+
writtenObjects = elementReference.get(value);
|
1319
1356
|
if ("function" === typeof value.then) {
|
1320
|
-
if (void 0 !==
|
1357
|
+
if (void 0 !== writtenObjects) {
|
1321
1358
|
if (null !== task.keyPath || task.implicitSlot)
|
1322
1359
|
return "$@" + serializeThenable(request, task, value).toString(16);
|
1323
1360
|
if (modelRoot === value) modelRoot = null;
|
1324
|
-
else return
|
1361
|
+
else return writtenObjects;
|
1325
1362
|
}
|
1326
1363
|
request = "$@" + serializeThenable(request, task, value).toString(16);
|
1327
|
-
|
1364
|
+
elementReference.set(value, request);
|
1328
1365
|
return request;
|
1329
1366
|
}
|
1330
|
-
if (void 0 !==
|
1367
|
+
if (void 0 !== writtenObjects)
|
1331
1368
|
if (modelRoot === value) modelRoot = null;
|
1332
|
-
else return
|
1369
|
+
else return writtenObjects;
|
1333
1370
|
else if (
|
1334
1371
|
-1 === parentPropertyName.indexOf(":") &&
|
1335
|
-
((
|
1336
|
-
void 0 !==
|
1372
|
+
((writtenObjects = elementReference.get(parent)),
|
1373
|
+
void 0 !== writtenObjects)
|
1337
1374
|
) {
|
1338
|
-
|
1375
|
+
existingReference = parentPropertyName;
|
1339
1376
|
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
1340
1377
|
switch (parentPropertyName) {
|
1341
1378
|
case "1":
|
1342
|
-
|
1379
|
+
existingReference = "type";
|
1343
1380
|
break;
|
1344
1381
|
case "2":
|
1345
|
-
|
1382
|
+
existingReference = "key";
|
1346
1383
|
break;
|
1347
1384
|
case "3":
|
1348
|
-
|
1385
|
+
existingReference = "props";
|
1349
1386
|
}
|
1350
|
-
|
1387
|
+
elementReference.set(value, writtenObjects + ":" + existingReference);
|
1351
1388
|
}
|
1352
1389
|
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
1353
1390
|
if (value instanceof Map)
|
@@ -1509,10 +1546,11 @@ function renderModelDestructive(
|
|
1509
1546
|
}
|
1510
1547
|
if ("symbol" === typeof value) {
|
1511
1548
|
task = request.writtenSymbols;
|
1512
|
-
|
1513
|
-
if (void 0 !==
|
1514
|
-
|
1515
|
-
|
1549
|
+
elementReference = task.get(value);
|
1550
|
+
if (void 0 !== elementReference)
|
1551
|
+
return serializeByValueID(elementReference);
|
1552
|
+
elementReference = value.description;
|
1553
|
+
if (Symbol.for(elementReference) !== value)
|
1516
1554
|
throw Error(
|
1517
1555
|
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
1518
1556
|
(value.description + ") cannot be found among global symbols.") +
|
@@ -1523,7 +1561,7 @@ function renderModelDestructive(
|
|
1523
1561
|
parent = encodeReferenceChunk(
|
1524
1562
|
request,
|
1525
1563
|
parentPropertyName,
|
1526
|
-
"$S" +
|
1564
|
+
"$S" + elementReference
|
1527
1565
|
);
|
1528
1566
|
request.completedImportChunks.push(parent);
|
1529
1567
|
task.set(value, parentPropertyName);
|
@@ -1558,8 +1596,8 @@ function logRecoverableError(request, error) {
|
|
1558
1596
|
}
|
1559
1597
|
function fatalError(request, error) {
|
1560
1598
|
null !== request.destination
|
1561
|
-
? ((request.status =
|
1562
|
-
: ((request.status =
|
1599
|
+
? ((request.status = 3), closeWithError(request.destination, error))
|
1600
|
+
: ((request.status = 2), (request.fatalError = error));
|
1563
1601
|
}
|
1564
1602
|
function emitErrorChunk(request, id, digest) {
|
1565
1603
|
digest = { digest: digest };
|
@@ -1628,7 +1666,8 @@ function emitChunk(request, task, value) {
|
|
1628
1666
|
}
|
1629
1667
|
var emptyRoot = {};
|
1630
1668
|
function retryTask(request, task) {
|
1631
|
-
if (0 === task.status)
|
1669
|
+
if (0 === task.status) {
|
1670
|
+
task.status = 5;
|
1632
1671
|
try {
|
1633
1672
|
modelRoot = task.model;
|
1634
1673
|
var resolvedModel = renderModelDestructive(
|
@@ -1655,10 +1694,23 @@ function retryTask(request, task) {
|
|
1655
1694
|
thrownValue === SuspenseException
|
1656
1695
|
? getSuspendedThenable()
|
1657
1696
|
: thrownValue;
|
1658
|
-
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1697
|
+
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1698
|
+
if (1 === request.status) {
|
1699
|
+
request.abortableTasks.delete(task);
|
1700
|
+
task.status = 3;
|
1701
|
+
var model = stringify(serializeByValueID(request.fatalError));
|
1702
|
+
emitModelChunk(request, task.id, model);
|
1703
|
+
} else {
|
1704
|
+
task.status = 0;
|
1705
|
+
task.thenableState = getThenableStateAfterSuspending();
|
1706
|
+
var ping = task.ping;
|
1707
|
+
x.then(ping, ping);
|
1708
|
+
}
|
1709
|
+
else if (x === AbortSigil) {
|
1710
|
+
request.abortableTasks.delete(task);
|
1711
|
+
task.status = 3;
|
1712
|
+
var model$19 = stringify(serializeByValueID(request.fatalError));
|
1713
|
+
emitModelChunk(request, task.id, model$19);
|
1662
1714
|
} else {
|
1663
1715
|
request.abortableTasks.delete(task);
|
1664
1716
|
task.status = 4;
|
@@ -1667,6 +1719,7 @@ function retryTask(request, task) {
|
|
1667
1719
|
}
|
1668
1720
|
} finally {
|
1669
1721
|
}
|
1722
|
+
}
|
1670
1723
|
}
|
1671
1724
|
function performWork(request) {
|
1672
1725
|
var prevDispatcher = ReactSharedInternalsServer.H;
|
@@ -1724,7 +1777,7 @@ function flushCompletedChunks(request, destination) {
|
|
1724
1777
|
(writtenBytes = 0));
|
1725
1778
|
}
|
1726
1779
|
0 === request.pendingChunks &&
|
1727
|
-
(destination.close(), (request.destination = null));
|
1780
|
+
((request.status = 3), destination.close(), (request.destination = null));
|
1728
1781
|
}
|
1729
1782
|
function startWork(request) {
|
1730
1783
|
request.flushScheduled = null !== request.destination;
|
@@ -1737,53 +1790,63 @@ function startWork(request) {
|
|
1737
1790
|
}, 0);
|
1738
1791
|
}
|
1739
1792
|
function enqueueFlush(request) {
|
1740
|
-
|
1741
|
-
!1 === request.flushScheduled &&
|
1793
|
+
!1 === request.flushScheduled &&
|
1742
1794
|
0 === request.pingedTasks.length &&
|
1743
|
-
null !== request.destination
|
1744
|
-
|
1745
|
-
var destination = request.destination;
|
1746
|
-
request.flushScheduled = !0;
|
1795
|
+
null !== request.destination &&
|
1796
|
+
((request.flushScheduled = !0),
|
1747
1797
|
setTimeout(function () {
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1798
|
+
request.flushScheduled = !1;
|
1799
|
+
var destination = request.destination;
|
1800
|
+
destination && flushCompletedChunks(request, destination);
|
1801
|
+
}, 0));
|
1751
1802
|
}
|
1752
1803
|
function abort(request, reason) {
|
1753
1804
|
try {
|
1805
|
+
request.status = 1;
|
1754
1806
|
var abortableTasks = request.abortableTasks;
|
1755
1807
|
if (0 < abortableTasks.size) {
|
1756
1808
|
request.pendingChunks++;
|
1757
|
-
var errorId = request.nextChunkId
|
1758
|
-
|
1809
|
+
var errorId = request.nextChunkId++;
|
1810
|
+
request.fatalError = errorId;
|
1811
|
+
var error =
|
1759
1812
|
void 0 === reason
|
1760
1813
|
? Error("The render was aborted by the server without a reason.")
|
1814
|
+
: "object" === typeof reason &&
|
1815
|
+
null !== reason &&
|
1816
|
+
"function" === typeof reason.then
|
1817
|
+
? Error("The render was aborted by the server with a promise.")
|
1761
1818
|
: reason,
|
1762
1819
|
digest = logRecoverableError(request, error);
|
1763
1820
|
emitErrorChunk(request, errorId, digest, error);
|
1764
1821
|
abortableTasks.forEach(function (task) {
|
1765
|
-
task.status
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1822
|
+
if (5 !== task.status) {
|
1823
|
+
task.status = 3;
|
1824
|
+
var ref = serializeByValueID(errorId);
|
1825
|
+
task = encodeReferenceChunk(request, task.id, ref);
|
1826
|
+
request.completedErrorChunks.push(task);
|
1827
|
+
}
|
1769
1828
|
});
|
1770
1829
|
abortableTasks.clear();
|
1771
1830
|
}
|
1772
1831
|
var abortListeners = request.abortListeners;
|
1773
1832
|
if (0 < abortListeners.size) {
|
1774
|
-
var error$
|
1833
|
+
var error$26 =
|
1775
1834
|
void 0 === reason
|
1776
1835
|
? Error("The render was aborted by the server without a reason.")
|
1836
|
+
: "object" === typeof reason &&
|
1837
|
+
null !== reason &&
|
1838
|
+
"function" === typeof reason.then
|
1839
|
+
? Error("The render was aborted by the server with a promise.")
|
1777
1840
|
: reason;
|
1778
1841
|
abortListeners.forEach(function (callback) {
|
1779
|
-
return callback(error$
|
1842
|
+
return callback(error$26);
|
1780
1843
|
});
|
1781
1844
|
abortListeners.clear();
|
1782
1845
|
}
|
1783
1846
|
null !== request.destination &&
|
1784
1847
|
flushCompletedChunks(request, request.destination);
|
1785
|
-
} catch (error$
|
1786
|
-
logRecoverableError(request, error$
|
1848
|
+
} catch (error$27) {
|
1849
|
+
logRecoverableError(request, error$27), fatalError(request, error$27);
|
1787
1850
|
}
|
1788
1851
|
}
|
1789
1852
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -2226,8 +2289,8 @@ function parseReadableStream(response, reference, type) {
|
|
2226
2289
|
(previousBlockedChunk = chunk));
|
2227
2290
|
} else {
|
2228
2291
|
chunk = previousBlockedChunk;
|
2229
|
-
var chunk$
|
2230
|
-
chunk$
|
2292
|
+
var chunk$30 = createPendingChunk(response);
|
2293
|
+
chunk$30.then(
|
2231
2294
|
function (v) {
|
2232
2295
|
return controller.enqueue(v);
|
2233
2296
|
},
|
@@ -2235,10 +2298,10 @@ function parseReadableStream(response, reference, type) {
|
|
2235
2298
|
return controller.error(e);
|
2236
2299
|
}
|
2237
2300
|
);
|
2238
|
-
previousBlockedChunk = chunk$
|
2301
|
+
previousBlockedChunk = chunk$30;
|
2239
2302
|
chunk.then(function () {
|
2240
|
-
previousBlockedChunk === chunk$
|
2241
|
-
resolveModelChunk(chunk$
|
2303
|
+
previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
|
2304
|
+
resolveModelChunk(chunk$30, json, -1);
|
2242
2305
|
});
|
2243
2306
|
}
|
2244
2307
|
},
|
@@ -2579,7 +2642,7 @@ exports.registerServerReference = function (reference, id, exportName) {
|
|
2579
2642
|
});
|
2580
2643
|
};
|
2581
2644
|
exports.renderToReadableStream = function (model, webpackMap, options) {
|
2582
|
-
var request =
|
2645
|
+
var request = new RequestInstance(
|
2583
2646
|
model,
|
2584
2647
|
webpackMap,
|
2585
2648
|
options ? options.onError : void 0,
|
@@ -2606,9 +2669,9 @@ exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
2606
2669
|
startWork(request);
|
2607
2670
|
},
|
2608
2671
|
pull: function (controller) {
|
2609
|
-
if (
|
2610
|
-
(request.status =
|
2611
|
-
else if (
|
2672
|
+
if (2 === request.status)
|
2673
|
+
(request.status = 3), closeWithError(controller, request.fatalError);
|
2674
|
+
else if (3 !== request.status && null === request.destination) {
|
2612
2675
|
request.destination = controller;
|
2613
2676
|
try {
|
2614
2677
|
flushCompletedChunks(request, controller);
|