react-server-dom-webpack 19.0.0-rc-a532d91d01-20240610 → 19.0.0-rc-6230622a1a-20240610
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 +3270 -1796
- package/cjs/react-server-dom-webpack-client.edge.development.js +3546 -1985
- package/cjs/react-server-dom-webpack-client.node.development.js +3508 -1957
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +3435 -1906
- package/cjs/react-server-dom-webpack-server.browser.development.js +5254 -3276
- package/cjs/react-server-dom-webpack-server.browser.production.js +77 -156
- package/cjs/react-server-dom-webpack-server.edge.development.js +5265 -3284
- package/cjs/react-server-dom-webpack-server.edge.production.js +78 -138
- package/cjs/react-server-dom-webpack-server.node.development.js +5401 -3349
- package/cjs/react-server-dom-webpack-server.node.production.js +84 -133
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +5336 -3322
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +84 -133
- package/package.json +3 -3
@@ -14,7 +14,6 @@ require("crypto");
|
|
14
14
|
var async_hooks = require("async_hooks"),
|
15
15
|
ReactDOM = require("react-dom"),
|
16
16
|
React = require("react"),
|
17
|
-
scheduleMicrotask = queueMicrotask,
|
18
17
|
currentView = null,
|
19
18
|
writtenBytes = 0,
|
20
19
|
destinationHasCapacity = !0;
|
@@ -708,8 +707,7 @@ if (!ReactSharedInternalsServer)
|
|
708
707
|
'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.'
|
709
708
|
);
|
710
709
|
var ObjectPrototype = Object.prototype,
|
711
|
-
stringify = JSON.stringify
|
712
|
-
AbortSigil = {};
|
710
|
+
stringify = JSON.stringify;
|
713
711
|
function defaultErrorHandler(error) {
|
714
712
|
console.error(error);
|
715
713
|
}
|
@@ -790,14 +788,6 @@ function serializeThenable(request, task, thenable) {
|
|
790
788
|
newTask.id
|
791
789
|
);
|
792
790
|
default:
|
793
|
-
if (1 === request.status)
|
794
|
-
return (
|
795
|
-
(newTask.status = 3),
|
796
|
-
(task = stringify(serializeByValueID(request.fatalError))),
|
797
|
-
emitModelChunk(request, newTask.id, task),
|
798
|
-
request.abortableTasks.delete(newTask),
|
799
|
-
newTask.id
|
800
|
-
);
|
801
791
|
"string" !== typeof thenable.status &&
|
802
792
|
((thenable.status = "pending"),
|
803
793
|
thenable.then(
|
@@ -983,7 +973,6 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
983
973
|
thenableIndexCounter = 0;
|
984
974
|
thenableState = prevThenableState;
|
985
975
|
Component = Component(props, void 0);
|
986
|
-
if (1 === request.status) throw AbortSigil;
|
987
976
|
if (
|
988
977
|
"object" === typeof Component &&
|
989
978
|
null !== Component &&
|
@@ -1081,7 +1070,6 @@ function renderElement(request, task, type, key, ref, props) {
|
|
1081
1070
|
case REACT_LAZY_TYPE:
|
1082
1071
|
var init = type._init;
|
1083
1072
|
type = init(type._payload);
|
1084
|
-
if (1 === request.status) throw AbortSigil;
|
1085
1073
|
return renderElement(request, task, type, key, ref, props);
|
1086
1074
|
case REACT_FORWARD_REF_TYPE:
|
1087
1075
|
return renderFunctionComponent(request, task, key, type.render, props);
|
@@ -1098,7 +1086,7 @@ function pingTask(request, task) {
|
|
1098
1086
|
pingedTasks.push(task);
|
1099
1087
|
1 === pingedTasks.length &&
|
1100
1088
|
((request.flushScheduled = null !== request.destination),
|
1101
|
-
|
1089
|
+
setImmediate(function () {
|
1102
1090
|
return performWork(request);
|
1103
1091
|
}));
|
1104
1092
|
}
|
@@ -1132,61 +1120,50 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
1132
1120
|
);
|
1133
1121
|
} catch (thrownValue) {
|
1134
1122
|
if (
|
1135
|
-
((parentPropertyName =
|
1136
|
-
(parentPropertyName =
|
1137
|
-
"object" === typeof parentPropertyName &&
|
1138
|
-
null !== parentPropertyName &&
|
1139
|
-
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
1140
|
-
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
1141
|
-
(value =
|
1123
|
+
((parentPropertyName =
|
1142
1124
|
thrownValue === SuspenseException
|
1143
1125
|
? getSuspendedThenable()
|
1144
1126
|
: thrownValue),
|
1145
|
-
|
1127
|
+
(value = task.model),
|
1128
|
+
(value =
|
1129
|
+
"object" === typeof value &&
|
1146
1130
|
null !== value &&
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1171
|
-
: serializeByValueID(JSCompiler_inline_result.id);
|
1172
|
-
}
|
1173
|
-
else if (thrownValue === AbortSigil)
|
1174
|
-
(task.status = 3),
|
1175
|
-
(prevKeyPath = request.fatalError),
|
1176
|
-
(JSCompiler_inline_result = parentPropertyName
|
1177
|
-
? "$L" + prevKeyPath.toString(16)
|
1178
|
-
: serializeByValueID(prevKeyPath));
|
1179
|
-
else if (
|
1131
|
+
(value.$$typeof === REACT_ELEMENT_TYPE ||
|
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 (
|
1180
1154
|
((task.keyPath = prevKeyPath),
|
1181
1155
|
(task.implicitSlot = prevImplicitSlot),
|
1182
|
-
|
1156
|
+
value)
|
1183
1157
|
)
|
1184
1158
|
request.pendingChunks++,
|
1185
1159
|
(prevKeyPath = request.nextChunkId++),
|
1186
|
-
(prevImplicitSlot = logRecoverableError(
|
1160
|
+
(prevImplicitSlot = logRecoverableError(
|
1161
|
+
request,
|
1162
|
+
parentPropertyName
|
1163
|
+
)),
|
1187
1164
|
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
1188
1165
|
(JSCompiler_inline_result = "$L" + prevKeyPath.toString(16));
|
1189
|
-
else throw
|
1166
|
+
else throw parentPropertyName;
|
1190
1167
|
}
|
1191
1168
|
return JSCompiler_inline_result;
|
1192
1169
|
},
|
@@ -1337,11 +1314,12 @@ function renderModelDestructive(
|
|
1337
1314
|
parentPropertyName
|
1338
1315
|
);
|
1339
1316
|
case REACT_LAZY_TYPE:
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1317
|
+
return (
|
1318
|
+
(task.thenableState = null),
|
1319
|
+
(parentPropertyName = value._init),
|
1320
|
+
(value = parentPropertyName(value._payload)),
|
1321
|
+
renderModelDestructive(request, task, emptyRoot, "", value)
|
1322
|
+
);
|
1345
1323
|
case REACT_LEGACY_ELEMENT_TYPE:
|
1346
1324
|
throw Error(
|
1347
1325
|
'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.'
|
@@ -1601,18 +1579,14 @@ function logRecoverableError(request, error) {
|
|
1601
1579
|
}
|
1602
1580
|
function fatalError(request, error) {
|
1603
1581
|
null !== request.destination
|
1604
|
-
? ((request.status =
|
1605
|
-
: ((request.status =
|
1582
|
+
? ((request.status = 2), request.destination.destroy(error))
|
1583
|
+
: ((request.status = 1), (request.fatalError = error));
|
1606
1584
|
}
|
1607
1585
|
function emitErrorChunk(request, id, digest) {
|
1608
1586
|
digest = { digest: digest };
|
1609
1587
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1610
1588
|
request.completedErrorChunks.push(id);
|
1611
1589
|
}
|
1612
|
-
function emitModelChunk(request, id, json) {
|
1613
|
-
id = id.toString(16) + ":" + json + "\n";
|
1614
|
-
request.completedRegularChunks.push(id);
|
1615
|
-
}
|
1616
1590
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1617
1591
|
request.pendingChunks++;
|
1618
1592
|
typedArray = new Uint8Array(
|
@@ -1664,12 +1638,12 @@ function emitChunk(request, task, value) {
|
|
1664
1638
|
: value instanceof DataView
|
1665
1639
|
? emitTypedArrayChunk(request, id, "V", value)
|
1666
1640
|
: ((value = stringify(value, task.toJSON)),
|
1667
|
-
|
1641
|
+
(task = task.id.toString(16) + ":" + value + "\n"),
|
1642
|
+
request.completedRegularChunks.push(task));
|
1668
1643
|
}
|
1669
1644
|
var emptyRoot = {};
|
1670
1645
|
function retryTask(request, task) {
|
1671
|
-
if (0 === task.status)
|
1672
|
-
task.status = 5;
|
1646
|
+
if (0 === task.status)
|
1673
1647
|
try {
|
1674
1648
|
modelRoot = task.model;
|
1675
1649
|
var resolvedModel = renderModelDestructive(
|
@@ -1686,8 +1660,9 @@ function retryTask(request, task) {
|
|
1686
1660
|
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1687
1661
|
emitChunk(request, task, resolvedModel);
|
1688
1662
|
else {
|
1689
|
-
var json = stringify(resolvedModel)
|
1690
|
-
|
1663
|
+
var json = stringify(resolvedModel),
|
1664
|
+
processedChunk = task.id.toString(16) + ":" + json + "\n";
|
1665
|
+
request.completedRegularChunks.push(processedChunk);
|
1691
1666
|
}
|
1692
1667
|
request.abortableTasks.delete(task);
|
1693
1668
|
task.status = 1;
|
@@ -1696,23 +1671,10 @@ function retryTask(request, task) {
|
|
1696
1671
|
thrownValue === SuspenseException
|
1697
1672
|
? getSuspendedThenable()
|
1698
1673
|
: thrownValue;
|
1699
|
-
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
var model = stringify(serializeByValueID(request.fatalError));
|
1704
|
-
emitModelChunk(request, task.id, model);
|
1705
|
-
} else {
|
1706
|
-
task.status = 0;
|
1707
|
-
task.thenableState = getThenableStateAfterSuspending();
|
1708
|
-
var ping = task.ping;
|
1709
|
-
x.then(ping, ping);
|
1710
|
-
}
|
1711
|
-
else if (x === AbortSigil) {
|
1712
|
-
request.abortableTasks.delete(task);
|
1713
|
-
task.status = 3;
|
1714
|
-
var model$19 = stringify(serializeByValueID(request.fatalError));
|
1715
|
-
emitModelChunk(request, task.id, model$19);
|
1674
|
+
if ("object" === typeof x && null !== x && "function" === typeof x.then) {
|
1675
|
+
var ping = task.ping;
|
1676
|
+
x.then(ping, ping);
|
1677
|
+
task.thenableState = getThenableStateAfterSuspending();
|
1716
1678
|
} else {
|
1717
1679
|
request.abortableTasks.delete(task);
|
1718
1680
|
task.status = 4;
|
@@ -1721,7 +1683,6 @@ function retryTask(request, task) {
|
|
1721
1683
|
}
|
1722
1684
|
} finally {
|
1723
1685
|
}
|
1724
|
-
}
|
1725
1686
|
}
|
1726
1687
|
function performWork(request) {
|
1727
1688
|
var prevDispatcher = ReactSharedInternalsServer.H;
|
@@ -1803,7 +1764,7 @@ function flushCompletedChunks(request, destination) {
|
|
1803
1764
|
}
|
1804
1765
|
"function" === typeof destination.flush && destination.flush();
|
1805
1766
|
0 === request.pendingChunks &&
|
1806
|
-
(
|
1767
|
+
(destination.end(), (request.destination = null));
|
1807
1768
|
}
|
1808
1769
|
function startWork(request) {
|
1809
1770
|
request.flushScheduled = null !== request.destination;
|
@@ -1812,20 +1773,22 @@ function startWork(request) {
|
|
1812
1773
|
});
|
1813
1774
|
}
|
1814
1775
|
function enqueueFlush(request) {
|
1815
|
-
|
1776
|
+
if (
|
1777
|
+
!1 === request.flushScheduled &&
|
1816
1778
|
0 === request.pingedTasks.length &&
|
1817
|
-
null !== request.destination
|
1818
|
-
|
1779
|
+
null !== request.destination
|
1780
|
+
) {
|
1781
|
+
var destination = request.destination;
|
1782
|
+
request.flushScheduled = !0;
|
1819
1783
|
setImmediate(function () {
|
1820
|
-
request
|
1821
|
-
|
1822
|
-
|
1823
|
-
}));
|
1784
|
+
return flushCompletedChunks(request, destination);
|
1785
|
+
});
|
1786
|
+
}
|
1824
1787
|
}
|
1825
1788
|
function startFlowing(request, destination) {
|
1826
|
-
if (
|
1827
|
-
(request.status =
|
1828
|
-
else if (
|
1789
|
+
if (1 === request.status)
|
1790
|
+
(request.status = 2), destination.destroy(request.fatalError);
|
1791
|
+
else if (2 !== request.status && null === request.destination) {
|
1829
1792
|
request.destination = destination;
|
1830
1793
|
try {
|
1831
1794
|
flushCompletedChunks(request, destination);
|
@@ -1836,51 +1799,39 @@ function startFlowing(request, destination) {
|
|
1836
1799
|
}
|
1837
1800
|
function abort(request, reason) {
|
1838
1801
|
try {
|
1839
|
-
request.status = 1;
|
1840
1802
|
var abortableTasks = request.abortableTasks;
|
1841
1803
|
if (0 < abortableTasks.size) {
|
1842
1804
|
request.pendingChunks++;
|
1843
|
-
var errorId = request.nextChunkId
|
1844
|
-
|
1845
|
-
var error =
|
1805
|
+
var errorId = request.nextChunkId++,
|
1806
|
+
error =
|
1846
1807
|
void 0 === reason
|
1847
1808
|
? Error("The render was aborted by the server without a reason.")
|
1848
|
-
: "object" === typeof reason &&
|
1849
|
-
null !== reason &&
|
1850
|
-
"function" === typeof reason.then
|
1851
|
-
? Error("The render was aborted by the server with a promise.")
|
1852
1809
|
: reason,
|
1853
1810
|
digest = logRecoverableError(request, error);
|
1854
1811
|
emitErrorChunk(request, errorId, digest, error);
|
1855
1812
|
abortableTasks.forEach(function (task) {
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
request.completedErrorChunks.push(task);
|
1861
|
-
}
|
1813
|
+
task.status = 3;
|
1814
|
+
var ref = serializeByValueID(errorId);
|
1815
|
+
task = encodeReferenceChunk(request, task.id, ref);
|
1816
|
+
request.completedErrorChunks.push(task);
|
1862
1817
|
});
|
1863
1818
|
abortableTasks.clear();
|
1864
1819
|
}
|
1865
1820
|
var abortListeners = request.abortListeners;
|
1866
1821
|
if (0 < abortListeners.size) {
|
1867
|
-
var error$
|
1822
|
+
var error$22 =
|
1868
1823
|
void 0 === reason
|
1869
1824
|
? Error("The render was aborted by the server without a reason.")
|
1870
|
-
: "object" === typeof reason &&
|
1871
|
-
null !== reason &&
|
1872
|
-
"function" === typeof reason.then
|
1873
|
-
? Error("The render was aborted by the server with a promise.")
|
1874
1825
|
: reason;
|
1875
1826
|
abortListeners.forEach(function (callback) {
|
1876
|
-
return callback(error$
|
1827
|
+
return callback(error$22);
|
1877
1828
|
});
|
1878
1829
|
abortListeners.clear();
|
1879
1830
|
}
|
1880
1831
|
null !== request.destination &&
|
1881
1832
|
flushCompletedChunks(request, request.destination);
|
1882
|
-
} catch (error$
|
1883
|
-
logRecoverableError(request, error$
|
1833
|
+
} catch (error$23) {
|
1834
|
+
logRecoverableError(request, error$23), fatalError(request, error$23);
|
1884
1835
|
}
|
1885
1836
|
}
|
1886
1837
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -2291,8 +2242,8 @@ function parseReadableStream(response, reference, type) {
|
|
2291
2242
|
(previousBlockedChunk = chunk));
|
2292
2243
|
} else {
|
2293
2244
|
chunk = previousBlockedChunk;
|
2294
|
-
var chunk$
|
2295
|
-
chunk$
|
2245
|
+
var chunk$26 = createPendingChunk(response);
|
2246
|
+
chunk$26.then(
|
2296
2247
|
function (v) {
|
2297
2248
|
return controller.enqueue(v);
|
2298
2249
|
},
|
@@ -2300,10 +2251,10 @@ function parseReadableStream(response, reference, type) {
|
|
2300
2251
|
return controller.error(e);
|
2301
2252
|
}
|
2302
2253
|
);
|
2303
|
-
previousBlockedChunk = chunk$
|
2254
|
+
previousBlockedChunk = chunk$26;
|
2304
2255
|
chunk.then(function () {
|
2305
|
-
previousBlockedChunk === chunk$
|
2306
|
-
resolveModelChunk(chunk$
|
2256
|
+
previousBlockedChunk === chunk$26 && (previousBlockedChunk = null);
|
2257
|
+
resolveModelChunk(chunk$26, json, -1);
|
2307
2258
|
});
|
2308
2259
|
}
|
2309
2260
|
},
|
@@ -2661,12 +2612,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
2661
2612
|
"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."
|
2662
2613
|
);
|
2663
2614
|
pendingFiles++;
|
2664
|
-
var
|
2615
|
+
var JSCompiler_object_inline_chunks_216 = [];
|
2665
2616
|
value.on("data", function (chunk) {
|
2666
|
-
|
2617
|
+
JSCompiler_object_inline_chunks_216.push(chunk);
|
2667
2618
|
});
|
2668
2619
|
value.on("end", function () {
|
2669
|
-
var blob = new Blob(
|
2620
|
+
var blob = new Blob(JSCompiler_object_inline_chunks_216, {
|
2670
2621
|
type: mimeType
|
2671
2622
|
});
|
2672
2623
|
response._formData.append(name, blob, filename);
|
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-6230622a1a-20240610",
|
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-6230622a1a-20240610",
|
81
|
+
"react-dom": "19.0.0-rc-6230622a1a-20240610",
|
82
82
|
"webpack": "^5.59.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|