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
@@ -14,6 +14,7 @@ require("crypto");
|
|
14
14
|
var async_hooks = require("async_hooks"),
|
15
15
|
ReactDOM = require("react-dom"),
|
16
16
|
React = require("react"),
|
17
|
+
scheduleMicrotask = queueMicrotask,
|
17
18
|
currentView = null,
|
18
19
|
writtenBytes = 0,
|
19
20
|
destinationHasCapacity = !0;
|
@@ -707,12 +708,13 @@ if (!ReactSharedInternalsServer)
|
|
707
708
|
'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.'
|
708
709
|
);
|
709
710
|
var ObjectPrototype = Object.prototype,
|
710
|
-
stringify = JSON.stringify
|
711
|
+
stringify = JSON.stringify,
|
712
|
+
AbortSigil = {};
|
711
713
|
function defaultErrorHandler(error) {
|
712
714
|
console.error(error);
|
713
715
|
}
|
714
716
|
function defaultPostponeHandler() {}
|
715
|
-
function
|
717
|
+
function RequestInstance(
|
716
718
|
model,
|
717
719
|
bundlerConfig,
|
718
720
|
onError,
|
@@ -730,37 +732,32 @@ function createRequest(
|
|
730
732
|
var abortSet = new Set();
|
731
733
|
environmentName = [];
|
732
734
|
var hints = new Set();
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
onError: void 0 === onError ? defaultErrorHandler : onError,
|
759
|
-
onPostpone: void 0 === onPostpone ? defaultPostponeHandler : onPostpone
|
760
|
-
};
|
761
|
-
model = createTask(bundlerConfig, model, null, !1, abortSet);
|
735
|
+
this.status = 0;
|
736
|
+
this.flushScheduled = !1;
|
737
|
+
this.destination = this.fatalError = null;
|
738
|
+
this.bundlerConfig = bundlerConfig;
|
739
|
+
this.cache = new Map();
|
740
|
+
this.pendingChunks = this.nextChunkId = 0;
|
741
|
+
this.hints = hints;
|
742
|
+
this.abortListeners = new Set();
|
743
|
+
this.abortableTasks = abortSet;
|
744
|
+
this.pingedTasks = environmentName;
|
745
|
+
this.completedImportChunks = [];
|
746
|
+
this.completedHintChunks = [];
|
747
|
+
this.completedRegularChunks = [];
|
748
|
+
this.completedErrorChunks = [];
|
749
|
+
this.writtenSymbols = new Map();
|
750
|
+
this.writtenClientReferences = new Map();
|
751
|
+
this.writtenServerReferences = new Map();
|
752
|
+
this.writtenObjects = new WeakMap();
|
753
|
+
this.temporaryReferences = temporaryReferences;
|
754
|
+
this.identifierPrefix = identifierPrefix || "";
|
755
|
+
this.identifierCount = 1;
|
756
|
+
this.taintCleanupQueue = [];
|
757
|
+
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
758
|
+
this.onPostpone = void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
|
759
|
+
model = createTask(this, model, null, !1, abortSet);
|
762
760
|
environmentName.push(model);
|
763
|
-
return bundlerConfig;
|
764
761
|
}
|
765
762
|
var currentRequest = null;
|
766
763
|
function resolveRequest() {
|
@@ -788,6 +785,14 @@ function serializeThenable(request, task, thenable) {
|
|
788
785
|
newTask.id
|
789
786
|
);
|
790
787
|
default:
|
788
|
+
if (1 === request.status)
|
789
|
+
return (
|
790
|
+
(newTask.status = 3),
|
791
|
+
(task = stringify(serializeByValueID(request.fatalError))),
|
792
|
+
emitModelChunk(request, newTask.id, task),
|
793
|
+
request.abortableTasks.delete(newTask),
|
794
|
+
newTask.id
|
795
|
+
);
|
791
796
|
"string" !== typeof thenable.status &&
|
792
797
|
((thenable.status = "pending"),
|
793
798
|
thenable.then(
|
@@ -973,6 +978,7 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
973
978
|
thenableIndexCounter = 0;
|
974
979
|
thenableState = prevThenableState;
|
975
980
|
Component = Component(props, void 0);
|
981
|
+
if (1 === request.status) throw AbortSigil;
|
976
982
|
if (
|
977
983
|
"object" === typeof Component &&
|
978
984
|
null !== Component &&
|
@@ -1070,6 +1076,7 @@ function renderElement(request, task, type, key, ref, props) {
|
|
1070
1076
|
case REACT_LAZY_TYPE:
|
1071
1077
|
var init = type._init;
|
1072
1078
|
type = init(type._payload);
|
1079
|
+
if (1 === request.status) throw AbortSigil;
|
1073
1080
|
return renderElement(request, task, type, key, ref, props);
|
1074
1081
|
case REACT_FORWARD_REF_TYPE:
|
1075
1082
|
return renderFunctionComponent(request, task, key, type.render, props);
|
@@ -1086,7 +1093,7 @@ function pingTask(request, task) {
|
|
1086
1093
|
pingedTasks.push(task);
|
1087
1094
|
1 === pingedTasks.length &&
|
1088
1095
|
((request.flushScheduled = null !== request.destination),
|
1089
|
-
|
1096
|
+
scheduleMicrotask(function () {
|
1090
1097
|
return performWork(request);
|
1091
1098
|
}));
|
1092
1099
|
}
|
@@ -1120,50 +1127,60 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
1120
1127
|
);
|
1121
1128
|
} catch (thrownValue) {
|
1122
1129
|
if (
|
1123
|
-
((parentPropertyName =
|
1130
|
+
((parentPropertyName = task.model),
|
1131
|
+
(parentPropertyName =
|
1132
|
+
"object" === typeof parentPropertyName &&
|
1133
|
+
null !== parentPropertyName &&
|
1134
|
+
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
1135
|
+
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
1136
|
+
(value =
|
1124
1137
|
thrownValue === SuspenseException
|
1125
1138
|
? getSuspendedThenable()
|
1126
1139
|
: thrownValue),
|
1127
|
-
|
1128
|
-
(value =
|
1129
|
-
"object" === typeof value &&
|
1140
|
+
"object" === typeof value &&
|
1130
1141
|
null !== value &&
|
1131
|
-
|
1132
|
-
value.$$typeof === REACT_LAZY_TYPE)),
|
1133
|
-
"object" === typeof parentPropertyName &&
|
1134
|
-
null !== parentPropertyName &&
|
1135
|
-
"function" === typeof parentPropertyName.then)
|
1136
|
-
) {
|
1137
|
-
JSCompiler_inline_result = createTask(
|
1138
|
-
request,
|
1139
|
-
task.model,
|
1140
|
-
task.keyPath,
|
1141
|
-
task.implicitSlot,
|
1142
|
-
request.abortableTasks
|
1143
|
-
);
|
1144
|
-
var ping = JSCompiler_inline_result.ping;
|
1145
|
-
parentPropertyName.then(ping, ping);
|
1146
|
-
JSCompiler_inline_result.thenableState =
|
1147
|
-
getThenableStateAfterSuspending();
|
1148
|
-
task.keyPath = prevKeyPath;
|
1149
|
-
task.implicitSlot = prevImplicitSlot;
|
1150
|
-
JSCompiler_inline_result = value
|
1151
|
-
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1152
|
-
: serializeByValueID(JSCompiler_inline_result.id);
|
1153
|
-
} else if (
|
1154
|
-
((task.keyPath = prevKeyPath),
|
1155
|
-
(task.implicitSlot = prevImplicitSlot),
|
1156
|
-
value)
|
1142
|
+
"function" === typeof value.then)
|
1157
1143
|
)
|
1158
|
-
request.
|
1159
|
-
(
|
1160
|
-
|
1144
|
+
if (1 === request.status)
|
1145
|
+
(task.status = 3),
|
1146
|
+
(prevKeyPath = request.fatalError),
|
1147
|
+
(JSCompiler_inline_result = parentPropertyName
|
1148
|
+
? "$L" + prevKeyPath.toString(16)
|
1149
|
+
: serializeByValueID(prevKeyPath));
|
1150
|
+
else {
|
1151
|
+
JSCompiler_inline_result = createTask(
|
1161
1152
|
request,
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1153
|
+
task.model,
|
1154
|
+
task.keyPath,
|
1155
|
+
task.implicitSlot,
|
1156
|
+
request.abortableTasks
|
1157
|
+
);
|
1158
|
+
var ping = JSCompiler_inline_result.ping;
|
1159
|
+
value.then(ping, ping);
|
1160
|
+
JSCompiler_inline_result.thenableState =
|
1161
|
+
getThenableStateAfterSuspending();
|
1162
|
+
task.keyPath = prevKeyPath;
|
1163
|
+
task.implicitSlot = prevImplicitSlot;
|
1164
|
+
JSCompiler_inline_result = parentPropertyName
|
1165
|
+
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1166
|
+
: serializeByValueID(JSCompiler_inline_result.id);
|
1167
|
+
}
|
1168
|
+
else
|
1169
|
+
thrownValue === AbortSigil
|
1170
|
+
? ((task.status = 3),
|
1171
|
+
(prevKeyPath = request.fatalError),
|
1172
|
+
(JSCompiler_inline_result = parentPropertyName
|
1173
|
+
? "$L" + prevKeyPath.toString(16)
|
1174
|
+
: serializeByValueID(prevKeyPath)))
|
1175
|
+
: ((task.keyPath = prevKeyPath),
|
1176
|
+
(task.implicitSlot = prevImplicitSlot),
|
1177
|
+
request.pendingChunks++,
|
1178
|
+
(prevKeyPath = request.nextChunkId++),
|
1179
|
+
(prevImplicitSlot = logRecoverableError(request, value)),
|
1180
|
+
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
1181
|
+
(JSCompiler_inline_result = parentPropertyName
|
1182
|
+
? "$L" + prevKeyPath.toString(16)
|
1183
|
+
: serializeByValueID(prevKeyPath)));
|
1167
1184
|
}
|
1168
1185
|
return JSCompiler_inline_result;
|
1169
1186
|
},
|
@@ -1291,7 +1308,8 @@ function renderModelDestructive(
|
|
1291
1308
|
if ("object" === typeof value) {
|
1292
1309
|
switch (value.$$typeof) {
|
1293
1310
|
case REACT_ELEMENT_TYPE:
|
1294
|
-
var
|
1311
|
+
var elementReference = null,
|
1312
|
+
writtenObjects = request.writtenObjects;
|
1295
1313
|
if (null === task.keyPath && !task.implicitSlot) {
|
1296
1314
|
var existingReference = writtenObjects.get(value);
|
1297
1315
|
if (void 0 !== existingReference)
|
@@ -1301,11 +1319,12 @@ function renderModelDestructive(
|
|
1301
1319
|
-1 === parentPropertyName.indexOf(":") &&
|
1302
1320
|
((parent = writtenObjects.get(parent)),
|
1303
1321
|
void 0 !== parent &&
|
1304
|
-
|
1322
|
+
((elementReference = parent + ":" + parentPropertyName),
|
1323
|
+
writtenObjects.set(value, elementReference)));
|
1305
1324
|
}
|
1306
1325
|
parentPropertyName = value.props;
|
1307
1326
|
parent = parentPropertyName.ref;
|
1308
|
-
|
1327
|
+
request = renderElement(
|
1309
1328
|
request,
|
1310
1329
|
task,
|
1311
1330
|
value.type,
|
@@ -1313,13 +1332,18 @@ function renderModelDestructive(
|
|
1313
1332
|
void 0 !== parent ? parent : null,
|
1314
1333
|
parentPropertyName
|
1315
1334
|
);
|
1335
|
+
"object" === typeof request &&
|
1336
|
+
null !== request &&
|
1337
|
+
null !== elementReference &&
|
1338
|
+
(writtenObjects.has(request) ||
|
1339
|
+
writtenObjects.set(request, elementReference));
|
1340
|
+
return request;
|
1316
1341
|
case REACT_LAZY_TYPE:
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
);
|
1342
|
+
task.thenableState = null;
|
1343
|
+
parentPropertyName = value._init;
|
1344
|
+
value = parentPropertyName(value._payload);
|
1345
|
+
if (1 === request.status) throw AbortSigil;
|
1346
|
+
return renderModelDestructive(request, task, emptyRoot, "", value);
|
1323
1347
|
case REACT_LEGACY_ELEMENT_TYPE:
|
1324
1348
|
throw Error(
|
1325
1349
|
'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.'
|
@@ -1334,44 +1358,44 @@ function renderModelDestructive(
|
|
1334
1358
|
);
|
1335
1359
|
if (
|
1336
1360
|
void 0 !== request.temporaryReferences &&
|
1337
|
-
((
|
1338
|
-
void 0 !==
|
1361
|
+
((elementReference = request.temporaryReferences.get(value)),
|
1362
|
+
void 0 !== elementReference)
|
1339
1363
|
)
|
1340
|
-
return "$T" +
|
1341
|
-
|
1342
|
-
|
1364
|
+
return "$T" + elementReference;
|
1365
|
+
elementReference = request.writtenObjects;
|
1366
|
+
writtenObjects = elementReference.get(value);
|
1343
1367
|
if ("function" === typeof value.then) {
|
1344
|
-
if (void 0 !==
|
1368
|
+
if (void 0 !== writtenObjects) {
|
1345
1369
|
if (null !== task.keyPath || task.implicitSlot)
|
1346
1370
|
return "$@" + serializeThenable(request, task, value).toString(16);
|
1347
1371
|
if (modelRoot === value) modelRoot = null;
|
1348
|
-
else return
|
1372
|
+
else return writtenObjects;
|
1349
1373
|
}
|
1350
1374
|
request = "$@" + serializeThenable(request, task, value).toString(16);
|
1351
|
-
|
1375
|
+
elementReference.set(value, request);
|
1352
1376
|
return request;
|
1353
1377
|
}
|
1354
|
-
if (void 0 !==
|
1378
|
+
if (void 0 !== writtenObjects)
|
1355
1379
|
if (modelRoot === value) modelRoot = null;
|
1356
|
-
else return
|
1380
|
+
else return writtenObjects;
|
1357
1381
|
else if (
|
1358
1382
|
-1 === parentPropertyName.indexOf(":") &&
|
1359
|
-
((
|
1360
|
-
void 0 !==
|
1383
|
+
((writtenObjects = elementReference.get(parent)),
|
1384
|
+
void 0 !== writtenObjects)
|
1361
1385
|
) {
|
1362
|
-
|
1386
|
+
existingReference = parentPropertyName;
|
1363
1387
|
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
1364
1388
|
switch (parentPropertyName) {
|
1365
1389
|
case "1":
|
1366
|
-
|
1390
|
+
existingReference = "type";
|
1367
1391
|
break;
|
1368
1392
|
case "2":
|
1369
|
-
|
1393
|
+
existingReference = "key";
|
1370
1394
|
break;
|
1371
1395
|
case "3":
|
1372
|
-
|
1396
|
+
existingReference = "props";
|
1373
1397
|
}
|
1374
|
-
|
1398
|
+
elementReference.set(value, writtenObjects + ":" + existingReference);
|
1375
1399
|
}
|
1376
1400
|
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
1377
1401
|
if (value instanceof Map)
|
@@ -1533,10 +1557,11 @@ function renderModelDestructive(
|
|
1533
1557
|
}
|
1534
1558
|
if ("symbol" === typeof value) {
|
1535
1559
|
task = request.writtenSymbols;
|
1536
|
-
|
1537
|
-
if (void 0 !==
|
1538
|
-
|
1539
|
-
|
1560
|
+
elementReference = task.get(value);
|
1561
|
+
if (void 0 !== elementReference)
|
1562
|
+
return serializeByValueID(elementReference);
|
1563
|
+
elementReference = value.description;
|
1564
|
+
if (Symbol.for(elementReference) !== value)
|
1540
1565
|
throw Error(
|
1541
1566
|
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
1542
1567
|
(value.description + ") cannot be found among global symbols.") +
|
@@ -1547,7 +1572,7 @@ function renderModelDestructive(
|
|
1547
1572
|
parent = encodeReferenceChunk(
|
1548
1573
|
request,
|
1549
1574
|
parentPropertyName,
|
1550
|
-
"$S" +
|
1575
|
+
"$S" + elementReference
|
1551
1576
|
);
|
1552
1577
|
request.completedImportChunks.push(parent);
|
1553
1578
|
task.set(value, parentPropertyName);
|
@@ -1579,14 +1604,18 @@ function logRecoverableError(request, error) {
|
|
1579
1604
|
}
|
1580
1605
|
function fatalError(request, error) {
|
1581
1606
|
null !== request.destination
|
1582
|
-
? ((request.status =
|
1583
|
-
: ((request.status =
|
1607
|
+
? ((request.status = 3), request.destination.destroy(error))
|
1608
|
+
: ((request.status = 2), (request.fatalError = error));
|
1584
1609
|
}
|
1585
1610
|
function emitErrorChunk(request, id, digest) {
|
1586
1611
|
digest = { digest: digest };
|
1587
1612
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1588
1613
|
request.completedErrorChunks.push(id);
|
1589
1614
|
}
|
1615
|
+
function emitModelChunk(request, id, json) {
|
1616
|
+
id = id.toString(16) + ":" + json + "\n";
|
1617
|
+
request.completedRegularChunks.push(id);
|
1618
|
+
}
|
1590
1619
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1591
1620
|
request.pendingChunks++;
|
1592
1621
|
typedArray = new Uint8Array(
|
@@ -1638,12 +1667,12 @@ function emitChunk(request, task, value) {
|
|
1638
1667
|
: value instanceof DataView
|
1639
1668
|
? emitTypedArrayChunk(request, id, "V", value)
|
1640
1669
|
: ((value = stringify(value, task.toJSON)),
|
1641
|
-
(
|
1642
|
-
request.completedRegularChunks.push(task));
|
1670
|
+
emitModelChunk(request, task.id, value));
|
1643
1671
|
}
|
1644
1672
|
var emptyRoot = {};
|
1645
1673
|
function retryTask(request, task) {
|
1646
|
-
if (0 === task.status)
|
1674
|
+
if (0 === task.status) {
|
1675
|
+
task.status = 5;
|
1647
1676
|
try {
|
1648
1677
|
modelRoot = task.model;
|
1649
1678
|
var resolvedModel = renderModelDestructive(
|
@@ -1660,9 +1689,8 @@ function retryTask(request, task) {
|
|
1660
1689
|
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1661
1690
|
emitChunk(request, task, resolvedModel);
|
1662
1691
|
else {
|
1663
|
-
var json = stringify(resolvedModel)
|
1664
|
-
|
1665
|
-
request.completedRegularChunks.push(processedChunk);
|
1692
|
+
var json = stringify(resolvedModel);
|
1693
|
+
emitModelChunk(request, task.id, json);
|
1666
1694
|
}
|
1667
1695
|
request.abortableTasks.delete(task);
|
1668
1696
|
task.status = 1;
|
@@ -1671,10 +1699,23 @@ function retryTask(request, task) {
|
|
1671
1699
|
thrownValue === SuspenseException
|
1672
1700
|
? getSuspendedThenable()
|
1673
1701
|
: thrownValue;
|
1674
|
-
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1702
|
+
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1703
|
+
if (1 === request.status) {
|
1704
|
+
request.abortableTasks.delete(task);
|
1705
|
+
task.status = 3;
|
1706
|
+
var model = stringify(serializeByValueID(request.fatalError));
|
1707
|
+
emitModelChunk(request, task.id, model);
|
1708
|
+
} else {
|
1709
|
+
task.status = 0;
|
1710
|
+
task.thenableState = getThenableStateAfterSuspending();
|
1711
|
+
var ping = task.ping;
|
1712
|
+
x.then(ping, ping);
|
1713
|
+
}
|
1714
|
+
else if (x === AbortSigil) {
|
1715
|
+
request.abortableTasks.delete(task);
|
1716
|
+
task.status = 3;
|
1717
|
+
var model$19 = stringify(serializeByValueID(request.fatalError));
|
1718
|
+
emitModelChunk(request, task.id, model$19);
|
1678
1719
|
} else {
|
1679
1720
|
request.abortableTasks.delete(task);
|
1680
1721
|
task.status = 4;
|
@@ -1683,6 +1724,7 @@ function retryTask(request, task) {
|
|
1683
1724
|
}
|
1684
1725
|
} finally {
|
1685
1726
|
}
|
1727
|
+
}
|
1686
1728
|
}
|
1687
1729
|
function performWork(request) {
|
1688
1730
|
var prevDispatcher = ReactSharedInternalsServer.H;
|
@@ -1764,7 +1806,7 @@ function flushCompletedChunks(request, destination) {
|
|
1764
1806
|
}
|
1765
1807
|
"function" === typeof destination.flush && destination.flush();
|
1766
1808
|
0 === request.pendingChunks &&
|
1767
|
-
(destination.end(), (request.destination = null));
|
1809
|
+
((request.status = 3), destination.end(), (request.destination = null));
|
1768
1810
|
}
|
1769
1811
|
function startWork(request) {
|
1770
1812
|
request.flushScheduled = null !== request.destination;
|
@@ -1773,22 +1815,20 @@ function startWork(request) {
|
|
1773
1815
|
});
|
1774
1816
|
}
|
1775
1817
|
function enqueueFlush(request) {
|
1776
|
-
|
1777
|
-
!1 === request.flushScheduled &&
|
1818
|
+
!1 === request.flushScheduled &&
|
1778
1819
|
0 === request.pingedTasks.length &&
|
1779
|
-
null !== request.destination
|
1780
|
-
|
1781
|
-
var destination = request.destination;
|
1782
|
-
request.flushScheduled = !0;
|
1820
|
+
null !== request.destination &&
|
1821
|
+
((request.flushScheduled = !0),
|
1783
1822
|
setImmediate(function () {
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1823
|
+
request.flushScheduled = !1;
|
1824
|
+
var destination = request.destination;
|
1825
|
+
destination && flushCompletedChunks(request, destination);
|
1826
|
+
}));
|
1787
1827
|
}
|
1788
1828
|
function startFlowing(request, destination) {
|
1789
|
-
if (
|
1790
|
-
(request.status =
|
1791
|
-
else if (
|
1829
|
+
if (2 === request.status)
|
1830
|
+
(request.status = 3), destination.destroy(request.fatalError);
|
1831
|
+
else if (3 !== request.status && null === request.destination) {
|
1792
1832
|
request.destination = destination;
|
1793
1833
|
try {
|
1794
1834
|
flushCompletedChunks(request, destination);
|
@@ -1799,39 +1839,51 @@ function startFlowing(request, destination) {
|
|
1799
1839
|
}
|
1800
1840
|
function abort(request, reason) {
|
1801
1841
|
try {
|
1842
|
+
request.status = 1;
|
1802
1843
|
var abortableTasks = request.abortableTasks;
|
1803
1844
|
if (0 < abortableTasks.size) {
|
1804
1845
|
request.pendingChunks++;
|
1805
|
-
var errorId = request.nextChunkId
|
1806
|
-
|
1846
|
+
var errorId = request.nextChunkId++;
|
1847
|
+
request.fatalError = errorId;
|
1848
|
+
var error =
|
1807
1849
|
void 0 === reason
|
1808
1850
|
? Error("The render was aborted by the server without a reason.")
|
1851
|
+
: "object" === typeof reason &&
|
1852
|
+
null !== reason &&
|
1853
|
+
"function" === typeof reason.then
|
1854
|
+
? Error("The render was aborted by the server with a promise.")
|
1809
1855
|
: reason,
|
1810
1856
|
digest = logRecoverableError(request, error);
|
1811
1857
|
emitErrorChunk(request, errorId, digest, error);
|
1812
1858
|
abortableTasks.forEach(function (task) {
|
1813
|
-
task.status
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1859
|
+
if (5 !== task.status) {
|
1860
|
+
task.status = 3;
|
1861
|
+
var ref = serializeByValueID(errorId);
|
1862
|
+
task = encodeReferenceChunk(request, task.id, ref);
|
1863
|
+
request.completedErrorChunks.push(task);
|
1864
|
+
}
|
1817
1865
|
});
|
1818
1866
|
abortableTasks.clear();
|
1819
1867
|
}
|
1820
1868
|
var abortListeners = request.abortListeners;
|
1821
1869
|
if (0 < abortListeners.size) {
|
1822
|
-
var error$
|
1870
|
+
var error$26 =
|
1823
1871
|
void 0 === reason
|
1824
1872
|
? Error("The render was aborted by the server without a reason.")
|
1873
|
+
: "object" === typeof reason &&
|
1874
|
+
null !== reason &&
|
1875
|
+
"function" === typeof reason.then
|
1876
|
+
? Error("The render was aborted by the server with a promise.")
|
1825
1877
|
: reason;
|
1826
1878
|
abortListeners.forEach(function (callback) {
|
1827
|
-
return callback(error$
|
1879
|
+
return callback(error$26);
|
1828
1880
|
});
|
1829
1881
|
abortListeners.clear();
|
1830
1882
|
}
|
1831
1883
|
null !== request.destination &&
|
1832
1884
|
flushCompletedChunks(request, request.destination);
|
1833
|
-
} catch (error$
|
1834
|
-
logRecoverableError(request, error$
|
1885
|
+
} catch (error$27) {
|
1886
|
+
logRecoverableError(request, error$27), fatalError(request, error$27);
|
1835
1887
|
}
|
1836
1888
|
}
|
1837
1889
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -2242,8 +2294,8 @@ function parseReadableStream(response, reference, type) {
|
|
2242
2294
|
(previousBlockedChunk = chunk));
|
2243
2295
|
} else {
|
2244
2296
|
chunk = previousBlockedChunk;
|
2245
|
-
var chunk$
|
2246
|
-
chunk$
|
2297
|
+
var chunk$30 = createPendingChunk(response);
|
2298
|
+
chunk$30.then(
|
2247
2299
|
function (v) {
|
2248
2300
|
return controller.enqueue(v);
|
2249
2301
|
},
|
@@ -2251,10 +2303,10 @@ function parseReadableStream(response, reference, type) {
|
|
2251
2303
|
return controller.error(e);
|
2252
2304
|
}
|
2253
2305
|
);
|
2254
|
-
previousBlockedChunk = chunk$
|
2306
|
+
previousBlockedChunk = chunk$30;
|
2255
2307
|
chunk.then(function () {
|
2256
|
-
previousBlockedChunk === chunk$
|
2257
|
-
resolveModelChunk(chunk$
|
2308
|
+
previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
|
2309
|
+
resolveModelChunk(chunk$30, json, -1);
|
2258
2310
|
});
|
2259
2311
|
}
|
2260
2312
|
},
|
@@ -2612,12 +2664,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
2612
2664
|
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
|
2613
2665
|
);
|
2614
2666
|
pendingFiles++;
|
2615
|
-
var
|
2667
|
+
var JSCompiler_object_inline_chunks_201 = [];
|
2616
2668
|
value.on("data", function (chunk) {
|
2617
|
-
|
2669
|
+
JSCompiler_object_inline_chunks_201.push(chunk);
|
2618
2670
|
});
|
2619
2671
|
value.on("end", function () {
|
2620
|
-
var blob = new Blob(
|
2672
|
+
var blob = new Blob(JSCompiler_object_inline_chunks_201, {
|
2621
2673
|
type: mimeType
|
2622
2674
|
});
|
2623
2675
|
response._formData.append(name, blob, filename);
|
@@ -2660,7 +2712,7 @@ exports.registerServerReference = function (reference, id, exportName) {
|
|
2660
2712
|
});
|
2661
2713
|
};
|
2662
2714
|
exports.renderToPipeableStream = function (model, webpackMap, options) {
|
2663
|
-
var request =
|
2715
|
+
var request = new RequestInstance(
|
2664
2716
|
model,
|
2665
2717
|
webpackMap,
|
2666
2718
|
options ? options.onError : void 0,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-server-dom-webpack",
|
3
3
|
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
|
4
|
-
"version": "19.0.0-rc-
|
4
|
+
"version": "19.0.0-rc-f3e09d6328-20240612",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -77,8 +77,8 @@
|
|
77
77
|
"node": ">=0.10.0"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
80
|
-
"react": "19.0.0-rc-
|
81
|
-
"react-dom": "19.0.0-rc-
|
80
|
+
"react": "19.0.0-rc-f3e09d6328-20240612",
|
81
|
+
"react-dom": "19.0.0-rc-f3e09d6328-20240612",
|
82
82
|
"webpack": "^5.59.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|