react-server-dom-webpack 18.3.0-canary-ce6842d8f-20230610 → 18.3.0-canary-88df88f94-20230613
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 +176 -29
- package/cjs/react-server-dom-webpack-client.browser.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-client.edge.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.edge.production.min.js +23 -23
- package/cjs/react-server-dom-webpack-client.node.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.node.production.min.js +25 -24
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +24 -23
- package/cjs/react-server-dom-webpack-server.browser.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +46 -46
- package/cjs/react-server-dom-webpack-server.edge.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +49 -49
- package/cjs/react-server-dom-webpack-server.node.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.production.min.js +37 -37
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +56 -56
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.browser.development.js +176 -29
- package/umd/react-server-dom-webpack-client.browser.production.min.js +21 -20
- package/umd/react-server-dom-webpack-server.browser.development.js +32 -8
- package/umd/react-server-dom-webpack-server.browser.production.min.js +43 -42
@@ -894,6 +894,11 @@ function getOrCreateServerContext(globalName) {
|
|
894
894
|
return ContextRegistry[globalName];
|
895
895
|
}
|
896
896
|
|
897
|
+
var ROW_ID = 0;
|
898
|
+
var ROW_TAG = 1;
|
899
|
+
var ROW_LENGTH = 2;
|
900
|
+
var ROW_CHUNK_BY_NEWLINE = 3;
|
901
|
+
var ROW_CHUNK_BY_LENGTH = 4;
|
897
902
|
var PENDING = 'pending';
|
898
903
|
var BLOCKED = 'blocked';
|
899
904
|
var RESOLVED_MODEL = 'resolved_model';
|
@@ -1059,6 +1064,11 @@ function createResolvedModuleChunk(response, value) {
|
|
1059
1064
|
return new Chunk(RESOLVED_MODULE, value, null, response);
|
1060
1065
|
}
|
1061
1066
|
|
1067
|
+
function createInitializedTextChunk(response, value) {
|
1068
|
+
// $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
|
1069
|
+
return new Chunk(INITIALIZED, value, null, response);
|
1070
|
+
}
|
1071
|
+
|
1062
1072
|
function resolveModelChunk(chunk, value) {
|
1063
1073
|
if (chunk.status !== PENDING) {
|
1064
1074
|
// We already resolved. We didn't expect to see this.
|
@@ -1470,9 +1480,13 @@ function createResponse(bundlerConfig, callServer) {
|
|
1470
1480
|
_bundlerConfig: bundlerConfig,
|
1471
1481
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1472
1482
|
_chunks: chunks,
|
1473
|
-
_partialRow: '',
|
1474
1483
|
_stringDecoder: createStringDecoder(),
|
1475
|
-
_fromJSON: null
|
1484
|
+
_fromJSON: null,
|
1485
|
+
_rowState: 0,
|
1486
|
+
_rowID: 0,
|
1487
|
+
_rowTag: 0,
|
1488
|
+
_rowLength: 0,
|
1489
|
+
_buffer: []
|
1476
1490
|
}; // Don't inline this call because it causes closure to outline the call above.
|
1477
1491
|
|
1478
1492
|
response._fromJSON = createFromJSONCallback(response);
|
@@ -1490,6 +1504,13 @@ function resolveModel(response, id, model) {
|
|
1490
1504
|
}
|
1491
1505
|
}
|
1492
1506
|
|
1507
|
+
function resolveText(response, id, text) {
|
1508
|
+
var chunks = response._chunks; // We assume that we always reference large strings after they've been
|
1509
|
+
// emitted.
|
1510
|
+
|
1511
|
+
chunks.set(id, createInitializedTextChunk(response, text));
|
1512
|
+
}
|
1513
|
+
|
1493
1514
|
function resolveModule(response, id, model) {
|
1494
1515
|
var chunks = response._chunks;
|
1495
1516
|
var chunk = chunks.get(id);
|
@@ -1553,35 +1574,44 @@ function resolveHint(response, code, model) {
|
|
1553
1574
|
dispatchHint(code, hintModel);
|
1554
1575
|
}
|
1555
1576
|
|
1556
|
-
function processFullRow(response,
|
1557
|
-
|
1558
|
-
|
1577
|
+
function processFullRow(response, id, tag, buffer, lastChunk) {
|
1578
|
+
var row = '';
|
1579
|
+
var stringDecoder = response._stringDecoder;
|
1580
|
+
|
1581
|
+
for (var i = 0; i < buffer.length; i++) {
|
1582
|
+
var chunk = buffer[i];
|
1583
|
+
row += readPartialStringChunk(stringDecoder, chunk);
|
1559
1584
|
}
|
1560
1585
|
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
// }
|
1586
|
+
if (typeof lastChunk === 'string') {
|
1587
|
+
row += lastChunk;
|
1588
|
+
} else {
|
1589
|
+
row += readFinalStringChunk(stringDecoder, lastChunk);
|
1590
|
+
}
|
1567
1591
|
|
1568
1592
|
switch (tag) {
|
1569
|
-
case
|
1593
|
+
case 73
|
1594
|
+
/* "I" */
|
1595
|
+
:
|
1570
1596
|
{
|
1571
|
-
resolveModule(response, id, row
|
1597
|
+
resolveModule(response, id, row);
|
1572
1598
|
return;
|
1573
1599
|
}
|
1574
1600
|
|
1575
|
-
case
|
1601
|
+
case 72
|
1602
|
+
/* "H" */
|
1603
|
+
:
|
1576
1604
|
{
|
1577
|
-
var code = row[
|
1578
|
-
resolveHint(response, code, row.slice(
|
1605
|
+
var code = row[0];
|
1606
|
+
resolveHint(response, code, row.slice(1));
|
1579
1607
|
return;
|
1580
1608
|
}
|
1581
1609
|
|
1582
|
-
case
|
1610
|
+
case 69
|
1611
|
+
/* "E" */
|
1612
|
+
:
|
1583
1613
|
{
|
1584
|
-
var errorInfo = JSON.parse(row
|
1614
|
+
var errorInfo = JSON.parse(row);
|
1585
1615
|
|
1586
1616
|
{
|
1587
1617
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -1590,28 +1620,145 @@ function processFullRow(response, row) {
|
|
1590
1620
|
return;
|
1591
1621
|
}
|
1592
1622
|
|
1623
|
+
case 84
|
1624
|
+
/* "T" */
|
1625
|
+
:
|
1626
|
+
{
|
1627
|
+
resolveText(response, id, row);
|
1628
|
+
return;
|
1629
|
+
}
|
1630
|
+
|
1593
1631
|
default:
|
1594
1632
|
{
|
1595
1633
|
// We assume anything else is JSON.
|
1596
|
-
resolveModel(response, id, row
|
1634
|
+
resolveModel(response, id, row);
|
1597
1635
|
return;
|
1598
1636
|
}
|
1599
1637
|
}
|
1600
1638
|
}
|
1601
1639
|
|
1602
1640
|
function processBinaryChunk(response, chunk) {
|
1603
|
-
var
|
1604
|
-
var
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1641
|
+
var i = 0;
|
1642
|
+
var rowState = response._rowState;
|
1643
|
+
var rowID = response._rowID;
|
1644
|
+
var rowTag = response._rowTag;
|
1645
|
+
var rowLength = response._rowLength;
|
1646
|
+
var buffer = response._buffer;
|
1647
|
+
var chunkLength = chunk.length;
|
1648
|
+
|
1649
|
+
while (i < chunkLength) {
|
1650
|
+
var lastIdx = -1;
|
1651
|
+
|
1652
|
+
switch (rowState) {
|
1653
|
+
case ROW_ID:
|
1654
|
+
{
|
1655
|
+
var byte = chunk[i++];
|
1656
|
+
|
1657
|
+
if (byte === 58
|
1658
|
+
/* ":" */
|
1659
|
+
) {
|
1660
|
+
// Finished the rowID, next we'll parse the tag.
|
1661
|
+
rowState = ROW_TAG;
|
1662
|
+
} else {
|
1663
|
+
rowID = rowID << 4 | (byte > 96 ? byte - 87 : byte - 48);
|
1664
|
+
}
|
1665
|
+
|
1666
|
+
continue;
|
1667
|
+
}
|
1668
|
+
|
1669
|
+
case ROW_TAG:
|
1670
|
+
{
|
1671
|
+
var resolvedRowTag = chunk[i];
|
1672
|
+
|
1673
|
+
if (resolvedRowTag === 84
|
1674
|
+
/* "T" */
|
1675
|
+
) {
|
1676
|
+
rowTag = resolvedRowTag;
|
1677
|
+
rowState = ROW_LENGTH;
|
1678
|
+
i++;
|
1679
|
+
} else if (resolvedRowTag > 64 && resolvedRowTag < 91
|
1680
|
+
/* "A"-"Z" */
|
1681
|
+
) {
|
1682
|
+
rowTag = resolvedRowTag;
|
1683
|
+
rowState = ROW_CHUNK_BY_NEWLINE;
|
1684
|
+
i++;
|
1685
|
+
} else {
|
1686
|
+
rowTag = 0;
|
1687
|
+
rowState = ROW_CHUNK_BY_NEWLINE; // This was an unknown tag so it was probably part of the data.
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
continue;
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
case ROW_LENGTH:
|
1694
|
+
{
|
1695
|
+
var _byte = chunk[i++];
|
1696
|
+
|
1697
|
+
if (_byte === 44
|
1698
|
+
/* "," */
|
1699
|
+
) {
|
1700
|
+
// Finished the rowLength, next we'll buffer up to that length.
|
1701
|
+
rowState = ROW_CHUNK_BY_LENGTH;
|
1702
|
+
} else {
|
1703
|
+
rowLength = rowLength << 4 | (_byte > 96 ? _byte - 87 : _byte - 48);
|
1704
|
+
}
|
1705
|
+
|
1706
|
+
continue;
|
1707
|
+
}
|
1708
|
+
|
1709
|
+
case ROW_CHUNK_BY_NEWLINE:
|
1710
|
+
{
|
1711
|
+
// We're looking for a newline
|
1712
|
+
lastIdx = chunk.indexOf(10
|
1713
|
+
/* "\n" */
|
1714
|
+
, i);
|
1715
|
+
break;
|
1716
|
+
}
|
1717
|
+
|
1718
|
+
case ROW_CHUNK_BY_LENGTH:
|
1719
|
+
{
|
1720
|
+
// We're looking for the remaining byte length
|
1721
|
+
if (i + rowLength <= chunk.length) {
|
1722
|
+
lastIdx = i + rowLength;
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
break;
|
1726
|
+
}
|
1727
|
+
}
|
1728
|
+
|
1729
|
+
if (lastIdx > -1) {
|
1730
|
+
// We found the last chunk of the row
|
1731
|
+
var offset = chunk.byteOffset + i;
|
1732
|
+
var length = lastIdx - i;
|
1733
|
+
var lastChunk = new Uint8Array(chunk.buffer, offset, length);
|
1734
|
+
processFullRow(response, rowID, rowTag, buffer, lastChunk); // Reset state machine for a new row
|
1735
|
+
|
1736
|
+
rowState = ROW_ID;
|
1737
|
+
rowTag = 0;
|
1738
|
+
rowID = 0;
|
1739
|
+
rowLength = 0;
|
1740
|
+
buffer.length = 0;
|
1741
|
+
i = lastIdx + 1;
|
1742
|
+
} else {
|
1743
|
+
// The rest of this row is in a future chunk. We stash the rest of the
|
1744
|
+
// current chunk until we can process the full row.
|
1745
|
+
var _offset = chunk.byteOffset + i;
|
1746
|
+
|
1747
|
+
var _length = chunk.byteLength - i;
|
1748
|
+
|
1749
|
+
var remainingSlice = new Uint8Array(chunk.buffer, _offset, _length);
|
1750
|
+
buffer.push(remainingSlice); // Update how many bytes we're still waiting for. If we're looking for
|
1751
|
+
// a newline, this doesn't hurt since we'll just ignore it.
|
1752
|
+
|
1753
|
+
rowLength -= remainingSlice.byteLength;
|
1754
|
+
break;
|
1755
|
+
}
|
1612
1756
|
}
|
1613
1757
|
|
1614
|
-
response.
|
1758
|
+
response._rowState = rowState;
|
1759
|
+
response._rowID = rowID;
|
1760
|
+
response._rowTag = rowTag;
|
1761
|
+
response._rowLength = rowLength;
|
1615
1762
|
}
|
1616
1763
|
|
1617
1764
|
function parseModel(response, json) {
|
@@ -7,26 +7,27 @@
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var n=require("util"),
|
11
|
-
function
|
12
|
-
function
|
13
|
-
function
|
14
|
-
1]&&this[h]instanceof Date)return"$D"+
|
15
|
-
if(Symbol.for(h)!==
|
16
|
-
function
|
17
|
-
function
|
18
|
-
var
|
19
|
-
|
20
|
-
function aa(a){switch(a.status){case "resolved_model":
|
21
|
-
function
|
22
|
-
function
|
23
|
-
function
|
24
|
-
function da(a,c){function b(){var
|
25
|
-
function ea(a,c,b,d){if("$"===d[0]){if("$"===d)return
|
26
|
-
}case "I":return Infinity;case "-":return"$-0"===d?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(d.slice(2)));case "n":return BigInt(d.slice(2));default:d=parseInt(d.slice(1),16);a=Y(a,d);switch(a.status){case "resolved_model":
|
27
|
-
function fa(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function ha(a,c){var b=new Map;a={_bundlerConfig:a,_callServer:void 0!==c?c:fa,_chunks:b,
|
28
|
-
function ja(a,c,b){var d=a._chunks,
|
29
|
-
function ia(a){return function(c,b){return"string"===typeof b?ea(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===
|
30
|
-
exports.createFromNodeStream=function(a,c){var b=ha(c,Z);a.on("data",function(d){for(var
|
31
|
-
h);break;case "
|
32
|
-
f.
|
10
|
+
'use strict';var n=require("util"),p=require("react-dom"),t=require("react"),u={stream:!0};function x(a,c){var b=a[c.id];if(a=b[c.name])c=a.name;else{a=b["*"];if(!a)throw Error('Could not find the module "'+c.id+'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.');c=c.name}return{specifier:a.specifier,name:c}}var y=new Map;
|
11
|
+
function z(a){var c=y.get(a.specifier);if(c)return"fulfilled"===c.status?null:c;var b=import(a.specifier);b.then(function(d){b.status="fulfilled";b.value=d},function(d){b.status="rejected";b.reason=d});y.set(a.specifier,b);return b}var A=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,B=Symbol.for("react.element"),C=Symbol.for("react.lazy"),D=Symbol.for("react.default_value"),E=Symbol.iterator;
|
12
|
+
function F(a){if(null===a||"object"!==typeof a)return null;a=E&&a[E]||a["@@iterator"];return"function"===typeof a?a:null}var G=Array.isArray,H=new WeakMap;function I(a){return Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN"}
|
13
|
+
function J(a,c,b,d){function e(h,g){if(null===g)return null;if("object"===typeof g){if("function"===typeof g.then){null===f&&(f=new FormData);l++;var v=k++;g.then(function(q){q=JSON.stringify(q,e);var w=f;w.append(c+v,q);l--;0===l&&b(w)},function(q){d(q)});return"$@"+v.toString(16)}if(g instanceof FormData){null===f&&(f=new FormData);var m=f;h=k++;var r=c+h+"_";g.forEach(function(q,w){m.append(r+w,q)});return"$K"+h.toString(16)}return!G(g)&&F(g)?Array.from(g):g}if("string"===typeof g){if("Z"===g[g.length-
|
14
|
+
1]&&this[h]instanceof Date)return"$D"+g;g="$"===g[0]?"$"+g:g;return g}if("boolean"===typeof g)return g;if("number"===typeof g)return I(g);if("undefined"===typeof g)return"$undefined";if("function"===typeof g){g=H.get(g);if(void 0!==g)return g=JSON.stringify(g,e),null===f&&(f=new FormData),h=k++,f.set(c+h,g),"$F"+h.toString(16);throw Error("Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.");}if("symbol"===typeof g){h=g.description;
|
15
|
+
if(Symbol.for(h)!==g)throw Error("Only global symbols received from Symbol.for(...) can be passed to Server Functions. The symbol Symbol.for("+(g.description+") cannot be found among global symbols."));return"$S"+h}if("bigint"===typeof g)return"$n"+g.toString(10);throw Error("Type "+typeof g+" is not supported as an argument to a Server Function.");}var k=1,l=0,f=null;a=JSON.stringify(a,e);null===f?b(a):(f.set(c+"0",a),0===l&&b(f))}var K=new WeakMap;
|
16
|
+
function L(a){var c,b,d=new Promise(function(e,k){c=e;b=k});J(a,"",function(e){if("string"===typeof e){var k=new FormData;k.append("0",e);e=k}d.status="fulfilled";d.value=e;c(e)},function(e){d.status="rejected";d.reason=e;b(e)});return d}
|
17
|
+
function M(a){var c=H.get(this);if(!c)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var b=null;if(null!==c.bound){b=K.get(c);b||(b=L(c),K.set(c,b));if("rejected"===b.status)throw b.reason;if("fulfilled"!==b.status)throw b;c=b.value;var d=new FormData;c.forEach(function(e,k){d.append("$ACTION_"+a+":"+k,e)});b=d;c="$ACTION_REF_"+a}else c="$ACTION_ID_"+c.id;return{name:c,method:"POST",encType:"multipart/form-data",data:b}}
|
18
|
+
var N=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function O(a,c,b,d){this.status=a;this.value=c;this.reason=b;this._response=d}O.prototype=Object.create(Promise.prototype);
|
19
|
+
O.prototype.then=function(a,c){switch(this.status){case "resolved_model":P(this);break;case "resolved_module":Q(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));c&&(null===this.reason&&(this.reason=[]),this.reason.push(c));break;default:c(this.reason)}};
|
20
|
+
function aa(a){switch(a.status){case "resolved_model":P(a);break;case "resolved_module":Q(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function R(a,c){for(var b=0;b<a.length;b++)(0,a[b])(c)}function S(a,c,b){switch(a.status){case "fulfilled":R(c,a.value);break;case "pending":case "blocked":a.value=c;a.reason=b;break;case "rejected":b&&R(b,a.reason)}}
|
21
|
+
function T(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.reason;a.status="rejected";a.reason=c;null!==b&&R(b,c)}}function U(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.value,d=a.reason;a.status="resolved_module";a.value=c;null!==b&&(Q(a),S(a,b,d))}}var V=null,W=null;
|
22
|
+
function P(a){var c=V,b=W;V=a;W=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==W&&0<W.deps?(W.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{V=c,W=b}}function Q(a){try{var c=a.value,b=y.get(c.specifier);if("fulfilled"===b.status)var d=b.value;else throw b.reason;var e="*"===c.name?d:""===c.name?d.default:d[c.name];a.status="fulfilled";a.value=e}catch(k){a.status="rejected",a.reason=k}}
|
23
|
+
function X(a,c){a._chunks.forEach(function(b){"pending"===b.status&&T(b,c)})}function Y(a,c){var b=a._chunks,d=b.get(c);d||(d=new O("pending",null,null,a),b.set(c,d));return d}function ba(a,c,b){if(W){var d=W;d.deps++}else d=W={deps:1,value:null};return function(e){c[b]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&R(e,d.value))}}function ca(a){return function(c){return T(a,c)}}
|
24
|
+
function da(a,c){function b(){var e=Array.prototype.slice.call(arguments),k=c.bound;return k?"fulfilled"===k.status?d(c.id,k.value.concat(e)):Promise.resolve(k).then(function(l){return d(c.id,l.concat(e))}):d(c.id,e)}var d=a._callServer;b.$$FORM_ACTION=M;H.set(b,c);return b}
|
25
|
+
function ea(a,c,b,d){if("$"===d[0]){if("$"===d)return B;switch(d[1]){case "$":return d.slice(1);case "L":return c=parseInt(d.slice(2),16),a=Y(a,c),{$$typeof:C,_payload:a,_init:aa};case "@":return c=parseInt(d.slice(2),16),Y(a,c);case "S":return Symbol.for(d.slice(2));case "P":return a=d.slice(2),N[a]||(N[a]=t.createServerContext(a,D)),N[a].Provider;case "F":c=parseInt(d.slice(2),16);c=Y(a,c);switch(c.status){case "resolved_model":P(c)}switch(c.status){case "fulfilled":return da(a,c.value);default:throw c.reason;
|
26
|
+
}case "I":return Infinity;case "-":return"$-0"===d?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(d.slice(2)));case "n":return BigInt(d.slice(2));default:d=parseInt(d.slice(1),16);a=Y(a,d);switch(a.status){case "resolved_model":P(a);break;case "resolved_module":Q(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=V,a.then(ba(d,c,b),ca(d)),null;default:throw a.reason;}}}return d}
|
27
|
+
function fa(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function ha(a,c){var b=new Map;a={_bundlerConfig:a,_callServer:void 0!==c?c:fa,_chunks:b,_stringDecoder:new n.TextDecoder,_fromJSON:null,_rowState:0,_rowID:0,_rowTag:0,_rowLength:0,_buffer:[]};a._fromJSON=ia(a);return a}
|
28
|
+
function ja(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var k=x(a._bundlerConfig,b);if(b=z(k)){if(e){var l=e;l.status="blocked"}else l=new O("blocked",null,null,a),d.set(c,l);b.then(function(){return U(l,k)},function(f){return T(l,f)})}else e?U(e,k):d.set(c,new O("resolved_module",k,null,a))}
|
29
|
+
function ia(a){return function(c,b){return"string"===typeof b?ea(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===B?{$$typeof:B,type:b[1],key:b[2],ref:null,props:b[3],_owner:null}:b,c):b}}function Z(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
|
30
|
+
exports.createFromNodeStream=function(a,c){var b=ha(c,Z);a.on("data",function(d){for(var e=0,k=b._rowState,l=b._rowID,f=b._rowTag,h=b._rowLength,g=b._buffer,v=d.length;e<v;){var m=-1;switch(k){case 0:m=d[e++];58===m?k=1:l=l<<4|(96<m?m-87:m-48);continue;case 1:m=d[e];84===m?(f=m,k=2,e++):64<m&&91>m?(f=m,k=3,e++):(f=0,k=3);continue;case 2:m=d[e++];44===m?k=4:h=h<<4|(96<m?m-87:m-48);continue;case 3:m=d.indexOf(10,e);break;case 4:e+h<=d.length&&(m=e+h)}if(-1<m){h=new Uint8Array(d.buffer,d.byteOffset+
|
31
|
+
e,m-e);e=f;f="";k=b._stringDecoder;for(var r=0;r<g.length;r++)f+=k.decode(g[r],u);f="string"===typeof h?f+h:f+k.decode(h);switch(e){case 73:ja(b,l,f);break;case 72:l=f[0];f=f.slice(1);f=JSON.parse(f,b._fromJSON);h=void 0;if(k=A.current)switch("string"===typeof f?e=f:(e=f[0],h=f[1]),l){case "D":k.prefetchDNS(e,h);break;case "C":k.preconnect(e,h);break;case "L":k.preload(e,h);break;case "I":k.preinit(e,h)}break;case 69:f=JSON.parse(f);h=f.digest;f=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
|
32
|
+
f.stack="Error: "+f.message;f.digest=h;h=b._chunks;(e=h.get(l))?T(e,f):h.set(l,new O("rejected",null,f,b));break;case 84:b._chunks.set(l,new O("fulfilled",f,null,b));break;default:h=b._chunks,(e=h.get(l))?(l=e,"pending"===l.status&&(h=l.value,e=l.reason,l.status="resolved_model",l.value=f,null!==h&&(P(l),S(l,h,e)))):h.set(l,new O("resolved_model",f,null,b))}h=l=f=k=0;g.length=0;e=m+1}else{d=new Uint8Array(d.buffer,d.byteOffset+e,d.byteLength-e);g.push(d);h-=d.byteLength;break}}b._rowState=k;b._rowID=
|
33
|
+
l;b._rowTag=f;b._rowLength=h});a.on("error",function(d){X(b,d)});a.on("end",function(){X(b,Error("Connection closed."))});return Y(b,0)};exports.createServerReference=function(){return Z};
|
@@ -136,6 +136,9 @@ function stringToChunk(content) {
|
|
136
136
|
return textEncoder.encode(content);
|
137
137
|
}
|
138
138
|
var precomputedChunkSet = new Set() ;
|
139
|
+
function byteLengthOfChunk(chunk) {
|
140
|
+
return chunk.byteLength;
|
141
|
+
}
|
139
142
|
function closeWithError(destination, error) {
|
140
143
|
// $FlowFixMe[method-unbinding]
|
141
144
|
if (typeof destination.error === 'function') {
|
@@ -1182,7 +1185,7 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
1182
1185
|
pingedTasks: pingedTasks,
|
1183
1186
|
completedImportChunks: [],
|
1184
1187
|
completedHintChunks: [],
|
1185
|
-
|
1188
|
+
completedRegularChunks: [],
|
1186
1189
|
completedErrorChunks: [],
|
1187
1190
|
writtenSymbols: new Map(),
|
1188
1191
|
writtenClientReferences: new Map(),
|
@@ -1629,11 +1632,20 @@ function serializeServerReference(request, parent, key, serverReference) {
|
|
1629
1632
|
var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
|
1630
1633
|
|
1631
1634
|
var processedChunk = processModelChunk(request, metadataId, serverReferenceMetadata);
|
1632
|
-
request.
|
1635
|
+
request.completedRegularChunks.push(processedChunk);
|
1633
1636
|
writtenServerReferences.set(serverReference, metadataId);
|
1634
1637
|
return serializeServerReferenceID(metadataId);
|
1635
1638
|
}
|
1636
1639
|
|
1640
|
+
function serializeLargeTextString(request, text) {
|
1641
|
+
request.pendingChunks += 2;
|
1642
|
+
var textId = request.nextChunkId++;
|
1643
|
+
var textChunk = stringToChunk(text);
|
1644
|
+
var headerChunk = processTextHeader(request, textId, text, byteLengthOfChunk(textChunk));
|
1645
|
+
request.completedRegularChunks.push(headerChunk, textChunk);
|
1646
|
+
return serializeByValueID(textId);
|
1647
|
+
}
|
1648
|
+
|
1637
1649
|
function escapeStringValue(value) {
|
1638
1650
|
if (value[0] === '$') {
|
1639
1651
|
// We need to escape $ prefixed strings since we use those to encode
|
@@ -1825,6 +1837,13 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1825
1837
|
}
|
1826
1838
|
}
|
1827
1839
|
|
1840
|
+
if (value.length >= 1024) {
|
1841
|
+
// For large strings, we encode them outside the JSON payload so that we
|
1842
|
+
// don't have to double encode and double parse the strings. This can also
|
1843
|
+
// be more compact in case the string has a lot of escaped characters.
|
1844
|
+
return serializeLargeTextString(request, value);
|
1845
|
+
}
|
1846
|
+
|
1828
1847
|
return escapeStringValue(value);
|
1829
1848
|
}
|
1830
1849
|
|
@@ -1963,7 +1982,7 @@ function emitSymbolChunk(request, id, name) {
|
|
1963
1982
|
function emitProviderChunk(request, id, contextName) {
|
1964
1983
|
var contextReference = serializeProviderReference(contextName);
|
1965
1984
|
var processedChunk = processReferenceChunk(request, id, contextReference);
|
1966
|
-
request.
|
1985
|
+
request.completedRegularChunks.push(processedChunk);
|
1967
1986
|
}
|
1968
1987
|
|
1969
1988
|
function retryTask(request, task) {
|
@@ -2003,7 +2022,7 @@ function retryTask(request, task) {
|
|
2003
2022
|
}
|
2004
2023
|
|
2005
2024
|
var processedChunk = processModelChunk(request, task.id, value);
|
2006
|
-
request.
|
2025
|
+
request.completedRegularChunks.push(processedChunk);
|
2007
2026
|
request.abortableTasks.delete(task);
|
2008
2027
|
task.status = COMPLETED;
|
2009
2028
|
} catch (thrownValue) {
|
@@ -2114,12 +2133,12 @@ function flushCompletedChunks(request, destination) {
|
|
2114
2133
|
|
2115
2134
|
hintChunks.splice(0, i); // Next comes model data.
|
2116
2135
|
|
2117
|
-
var
|
2136
|
+
var regularChunks = request.completedRegularChunks;
|
2118
2137
|
i = 0;
|
2119
2138
|
|
2120
|
-
for (; i <
|
2139
|
+
for (; i < regularChunks.length; i++) {
|
2121
2140
|
request.pendingChunks--;
|
2122
|
-
var _chunk2 =
|
2141
|
+
var _chunk2 = regularChunks[i];
|
2123
2142
|
|
2124
2143
|
var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
|
2125
2144
|
|
@@ -2130,7 +2149,7 @@ function flushCompletedChunks(request, destination) {
|
|
2130
2149
|
}
|
2131
2150
|
}
|
2132
2151
|
|
2133
|
-
|
2152
|
+
regularChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
|
2134
2153
|
// any error messages and prioritize display of other parts of
|
2135
2154
|
// the page.
|
2136
2155
|
|
@@ -2316,6 +2335,11 @@ function processHintChunk(request, id, code, model) {
|
|
2316
2335
|
return stringToChunk(row);
|
2317
2336
|
}
|
2318
2337
|
|
2338
|
+
function processTextHeader(request, id, text, binaryLength) {
|
2339
|
+
var row = id.toString(16) + ':T' + binaryLength.toString(16) + ',';
|
2340
|
+
return stringToChunk(row);
|
2341
|
+
}
|
2342
|
+
|
2319
2343
|
// eslint-disable-next-line no-unused-vars
|
2320
2344
|
function resolveServerReference(bundlerConfig, id) {
|
2321
2345
|
var name = '';
|