react-server-dom-webpack 19.0.0-rc-9c6806964f-20240703 → 19.0.0-rc-f38c22b244-20240704
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 +88 -81
- package/cjs/react-server-dom-webpack-client.browser.production.js +36 -34
- package/cjs/react-server-dom-webpack-client.edge.development.js +88 -81
- package/cjs/react-server-dom-webpack-client.edge.production.js +36 -34
- package/cjs/react-server-dom-webpack-client.node.development.js +226 -126
- package/cjs/react-server-dom-webpack-client.node.production.js +176 -79
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +226 -126
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +176 -79
- package/cjs/react-server-dom-webpack-server.browser.development.js +273 -299
- package/cjs/react-server-dom-webpack-server.browser.production.js +20 -19
- package/cjs/react-server-dom-webpack-server.edge.development.js +283 -301
- package/cjs/react-server-dom-webpack-server.edge.production.js +20 -19
- package/cjs/react-server-dom-webpack-server.node.development.js +285 -303
- package/cjs/react-server-dom-webpack-server.node.production.js +23 -23
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +285 -303
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +23 -23
- package/package.json +3 -3
@@ -1320,7 +1320,7 @@ function resolveTypedArray(
|
|
1320
1320
|
);
|
1321
1321
|
resolveBuffer(response, id, constructor);
|
1322
1322
|
}
|
1323
|
-
function
|
1323
|
+
function processFullBinaryRow(response, id, tag, buffer, chunk) {
|
1324
1324
|
switch (tag) {
|
1325
1325
|
case 65:
|
1326
1326
|
resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);
|
@@ -1373,6 +1373,9 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
1373
1373
|
)
|
1374
1374
|
row += stringDecoder.decode(buffer[i], decoderOptions);
|
1375
1375
|
row += stringDecoder.decode(chunk);
|
1376
|
+
processFullStringRow(response, id, tag, row);
|
1377
|
+
}
|
1378
|
+
function processFullStringRow(response, id, tag, row) {
|
1376
1379
|
switch (tag) {
|
1377
1380
|
case 73:
|
1378
1381
|
resolveModule(response, id, row);
|
@@ -1429,14 +1432,15 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
1429
1432
|
row.stack = "Error: " + row.message;
|
1430
1433
|
row.digest = tag;
|
1431
1434
|
tag = response._chunks;
|
1432
|
-
|
1433
|
-
|
1435
|
+
var chunk = tag.get(id);
|
1436
|
+
chunk
|
1437
|
+
? triggerErrorOnChunk(chunk, row)
|
1434
1438
|
: tag.set(id, new Chunk("rejected", null, row, response));
|
1435
1439
|
break;
|
1436
1440
|
case 84:
|
1437
1441
|
tag = response._chunks;
|
1438
|
-
(
|
1439
|
-
?
|
1442
|
+
(chunk = tag.get(id)) && "pending" !== chunk.status
|
1443
|
+
? chunk.reason.enqueueValue(row)
|
1440
1444
|
: tag.set(id, new Chunk("fulfilled", row, null, response));
|
1441
1445
|
break;
|
1442
1446
|
case 68:
|
@@ -1463,8 +1467,8 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
1463
1467
|
break;
|
1464
1468
|
default:
|
1465
1469
|
(tag = response._chunks),
|
1466
|
-
(
|
1467
|
-
? resolveModelChunk(
|
1470
|
+
(chunk = tag.get(id))
|
1471
|
+
? resolveModelChunk(chunk, row)
|
1468
1472
|
: tag.set(id, new Chunk("resolved_model", row, null, response));
|
1469
1473
|
}
|
1470
1474
|
}
|
@@ -1518,82 +1522,175 @@ exports.createFromNodeStream = function (stream, ssrManifest, options) {
|
|
1518
1522
|
void 0
|
1519
1523
|
);
|
1520
1524
|
stream.on("data", function (chunk) {
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1525
|
+
if ("string" === typeof chunk) {
|
1526
|
+
for (
|
1527
|
+
var i = 0,
|
1528
|
+
rowState = response._rowState,
|
1529
|
+
rowID = response._rowID,
|
1530
|
+
rowTag = response._rowTag,
|
1531
|
+
rowLength = response._rowLength,
|
1532
|
+
buffer = response._buffer,
|
1533
|
+
chunkLength = chunk.length;
|
1534
|
+
i < chunkLength;
|
1530
1535
|
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1536
|
+
) {
|
1537
|
+
var lastIdx = -1;
|
1538
|
+
switch (rowState) {
|
1539
|
+
case 0:
|
1540
|
+
lastIdx = chunk.charCodeAt(i++);
|
1541
|
+
58 === lastIdx
|
1542
|
+
? (rowState = 1)
|
1543
|
+
: (rowID =
|
1544
|
+
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
1545
|
+
continue;
|
1546
|
+
case 1:
|
1547
|
+
rowState = chunk.charCodeAt(i);
|
1548
|
+
84 === rowState ||
|
1549
|
+
65 === rowState ||
|
1550
|
+
79 === rowState ||
|
1551
|
+
111 === rowState ||
|
1552
|
+
85 === rowState ||
|
1553
|
+
83 === rowState ||
|
1554
|
+
115 === rowState ||
|
1555
|
+
76 === rowState ||
|
1556
|
+
108 === rowState ||
|
1557
|
+
71 === rowState ||
|
1558
|
+
103 === rowState ||
|
1559
|
+
77 === rowState ||
|
1560
|
+
109 === rowState ||
|
1561
|
+
86 === rowState
|
1562
|
+
? ((rowTag = rowState), (rowState = 2), i++)
|
1563
|
+
: (64 < rowState && 91 > rowState) ||
|
1564
|
+
114 === rowState ||
|
1565
|
+
120 === rowState
|
1566
|
+
? ((rowTag = rowState), (rowState = 3), i++)
|
1567
|
+
: ((rowTag = 0), (rowState = 3));
|
1568
|
+
continue;
|
1569
|
+
case 2:
|
1570
|
+
lastIdx = chunk.charCodeAt(i++);
|
1571
|
+
44 === lastIdx
|
1572
|
+
? (rowState = 4)
|
1573
|
+
: (rowLength =
|
1574
|
+
(rowLength << 4) |
|
1575
|
+
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
1576
|
+
continue;
|
1577
|
+
case 3:
|
1578
|
+
lastIdx = chunk.indexOf("\n", i);
|
1579
|
+
break;
|
1580
|
+
case 4:
|
1581
|
+
if (84 !== rowTag)
|
1582
|
+
throw Error(
|
1583
|
+
"Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams."
|
1584
|
+
);
|
1585
|
+
if (rowLength < chunk.length || chunk.length > 3 * rowLength)
|
1586
|
+
throw Error(
|
1587
|
+
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
1588
|
+
);
|
1589
|
+
lastIdx = chunk.length;
|
1590
|
+
}
|
1591
|
+
if (-1 < lastIdx) {
|
1592
|
+
if (0 < buffer.length)
|
1593
|
+
throw Error(
|
1594
|
+
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
1595
|
+
);
|
1596
|
+
i = chunk.slice(i, lastIdx);
|
1597
|
+
processFullStringRow(response, rowID, rowTag, i);
|
1598
|
+
i = lastIdx;
|
1599
|
+
3 === rowState && i++;
|
1600
|
+
rowLength = rowID = rowTag = rowState = 0;
|
1601
|
+
buffer.length = 0;
|
1602
|
+
} else if (chunk.length !== i)
|
1603
|
+
throw Error(
|
1604
|
+
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
1605
|
+
);
|
1577
1606
|
}
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1607
|
+
response._rowState = rowState;
|
1608
|
+
response._rowID = rowID;
|
1609
|
+
response._rowTag = rowTag;
|
1610
|
+
response._rowLength = rowLength;
|
1611
|
+
} else {
|
1612
|
+
rowLength = 0;
|
1613
|
+
chunkLength = response._rowState;
|
1614
|
+
rowID = response._rowID;
|
1615
|
+
i = response._rowTag;
|
1616
|
+
rowState = response._rowLength;
|
1617
|
+
buffer = response._buffer;
|
1618
|
+
for (rowTag = chunk.length; rowLength < rowTag; ) {
|
1619
|
+
lastIdx = -1;
|
1620
|
+
switch (chunkLength) {
|
1621
|
+
case 0:
|
1622
|
+
lastIdx = chunk[rowLength++];
|
1623
|
+
58 === lastIdx
|
1624
|
+
? (chunkLength = 1)
|
1625
|
+
: (rowID =
|
1626
|
+
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
1627
|
+
continue;
|
1628
|
+
case 1:
|
1629
|
+
chunkLength = chunk[rowLength];
|
1630
|
+
84 === chunkLength ||
|
1631
|
+
65 === chunkLength ||
|
1632
|
+
79 === chunkLength ||
|
1633
|
+
111 === chunkLength ||
|
1634
|
+
85 === chunkLength ||
|
1635
|
+
83 === chunkLength ||
|
1636
|
+
115 === chunkLength ||
|
1637
|
+
76 === chunkLength ||
|
1638
|
+
108 === chunkLength ||
|
1639
|
+
71 === chunkLength ||
|
1640
|
+
103 === chunkLength ||
|
1641
|
+
77 === chunkLength ||
|
1642
|
+
109 === chunkLength ||
|
1643
|
+
86 === chunkLength
|
1644
|
+
? ((i = chunkLength), (chunkLength = 2), rowLength++)
|
1645
|
+
: (64 < chunkLength && 91 > chunkLength) ||
|
1646
|
+
114 === chunkLength ||
|
1647
|
+
120 === chunkLength
|
1648
|
+
? ((i = chunkLength), (chunkLength = 3), rowLength++)
|
1649
|
+
: ((i = 0), (chunkLength = 3));
|
1650
|
+
continue;
|
1651
|
+
case 2:
|
1652
|
+
lastIdx = chunk[rowLength++];
|
1653
|
+
44 === lastIdx
|
1654
|
+
? (chunkLength = 4)
|
1655
|
+
: (rowState =
|
1656
|
+
(rowState << 4) |
|
1657
|
+
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
1658
|
+
continue;
|
1659
|
+
case 3:
|
1660
|
+
lastIdx = chunk.indexOf(10, rowLength);
|
1661
|
+
break;
|
1662
|
+
case 4:
|
1663
|
+
(lastIdx = rowLength + rowState),
|
1664
|
+
lastIdx > chunk.length && (lastIdx = -1);
|
1665
|
+
}
|
1666
|
+
var offset = chunk.byteOffset + rowLength;
|
1667
|
+
if (-1 < lastIdx)
|
1668
|
+
(rowState = new Uint8Array(
|
1669
|
+
chunk.buffer,
|
1670
|
+
offset,
|
1671
|
+
lastIdx - rowLength
|
1672
|
+
)),
|
1673
|
+
processFullBinaryRow(response, rowID, i, buffer, rowState),
|
1674
|
+
(rowLength = lastIdx),
|
1675
|
+
3 === chunkLength && rowLength++,
|
1676
|
+
(rowState = rowID = i = chunkLength = 0),
|
1677
|
+
(buffer.length = 0);
|
1678
|
+
else {
|
1679
|
+
chunk = new Uint8Array(
|
1680
|
+
chunk.buffer,
|
1681
|
+
offset,
|
1682
|
+
chunk.byteLength - rowLength
|
1683
|
+
);
|
1684
|
+
buffer.push(chunk);
|
1685
|
+
rowState -= chunk.byteLength;
|
1686
|
+
break;
|
1687
|
+
}
|
1591
1688
|
}
|
1689
|
+
response._rowState = chunkLength;
|
1690
|
+
response._rowID = rowID;
|
1691
|
+
response._rowTag = i;
|
1692
|
+
response._rowLength = rowState;
|
1592
1693
|
}
|
1593
|
-
response._rowState = rowState;
|
1594
|
-
response._rowID = rowID;
|
1595
|
-
response._rowTag = rowTag;
|
1596
|
-
response._rowLength = rowLength;
|
1597
1694
|
});
|
1598
1695
|
stream.on("error", function (error) {
|
1599
1696
|
reportGlobalError(response, error);
|