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
@@ -960,6 +960,11 @@ function getOrCreateServerContext(globalName) {
|
|
960
960
|
return ContextRegistry[globalName];
|
961
961
|
}
|
962
962
|
|
963
|
+
var ROW_ID = 0;
|
964
|
+
var ROW_TAG = 1;
|
965
|
+
var ROW_LENGTH = 2;
|
966
|
+
var ROW_CHUNK_BY_NEWLINE = 3;
|
967
|
+
var ROW_CHUNK_BY_LENGTH = 4;
|
963
968
|
var PENDING = 'pending';
|
964
969
|
var BLOCKED = 'blocked';
|
965
970
|
var RESOLVED_MODEL = 'resolved_model';
|
@@ -1125,6 +1130,11 @@ function createResolvedModuleChunk(response, value) {
|
|
1125
1130
|
return new Chunk(RESOLVED_MODULE, value, null, response);
|
1126
1131
|
}
|
1127
1132
|
|
1133
|
+
function createInitializedTextChunk(response, value) {
|
1134
|
+
// $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
|
1135
|
+
return new Chunk(INITIALIZED, value, null, response);
|
1136
|
+
}
|
1137
|
+
|
1128
1138
|
function resolveModelChunk(chunk, value) {
|
1129
1139
|
if (chunk.status !== PENDING) {
|
1130
1140
|
// We already resolved. We didn't expect to see this.
|
@@ -1536,9 +1546,13 @@ function createResponse(bundlerConfig, callServer) {
|
|
1536
1546
|
_bundlerConfig: bundlerConfig,
|
1537
1547
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1538
1548
|
_chunks: chunks,
|
1539
|
-
_partialRow: '',
|
1540
1549
|
_stringDecoder: createStringDecoder(),
|
1541
|
-
_fromJSON: null
|
1550
|
+
_fromJSON: null,
|
1551
|
+
_rowState: 0,
|
1552
|
+
_rowID: 0,
|
1553
|
+
_rowTag: 0,
|
1554
|
+
_rowLength: 0,
|
1555
|
+
_buffer: []
|
1542
1556
|
}; // Don't inline this call because it causes closure to outline the call above.
|
1543
1557
|
|
1544
1558
|
response._fromJSON = createFromJSONCallback(response);
|
@@ -1556,6 +1570,13 @@ function resolveModel(response, id, model) {
|
|
1556
1570
|
}
|
1557
1571
|
}
|
1558
1572
|
|
1573
|
+
function resolveText(response, id, text) {
|
1574
|
+
var chunks = response._chunks; // We assume that we always reference large strings after they've been
|
1575
|
+
// emitted.
|
1576
|
+
|
1577
|
+
chunks.set(id, createInitializedTextChunk(response, text));
|
1578
|
+
}
|
1579
|
+
|
1559
1580
|
function resolveModule(response, id, model) {
|
1560
1581
|
var chunks = response._chunks;
|
1561
1582
|
var chunk = chunks.get(id);
|
@@ -1619,35 +1640,44 @@ function resolveHint(response, code, model) {
|
|
1619
1640
|
dispatchHint(code, hintModel);
|
1620
1641
|
}
|
1621
1642
|
|
1622
|
-
function processFullRow(response,
|
1623
|
-
|
1624
|
-
|
1643
|
+
function processFullRow(response, id, tag, buffer, lastChunk) {
|
1644
|
+
var row = '';
|
1645
|
+
var stringDecoder = response._stringDecoder;
|
1646
|
+
|
1647
|
+
for (var i = 0; i < buffer.length; i++) {
|
1648
|
+
var chunk = buffer[i];
|
1649
|
+
row += readPartialStringChunk(stringDecoder, chunk);
|
1625
1650
|
}
|
1626
1651
|
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
// }
|
1652
|
+
if (typeof lastChunk === 'string') {
|
1653
|
+
row += lastChunk;
|
1654
|
+
} else {
|
1655
|
+
row += readFinalStringChunk(stringDecoder, lastChunk);
|
1656
|
+
}
|
1633
1657
|
|
1634
1658
|
switch (tag) {
|
1635
|
-
case
|
1659
|
+
case 73
|
1660
|
+
/* "I" */
|
1661
|
+
:
|
1636
1662
|
{
|
1637
|
-
resolveModule(response, id, row
|
1663
|
+
resolveModule(response, id, row);
|
1638
1664
|
return;
|
1639
1665
|
}
|
1640
1666
|
|
1641
|
-
case
|
1667
|
+
case 72
|
1668
|
+
/* "H" */
|
1669
|
+
:
|
1642
1670
|
{
|
1643
|
-
var code = row[
|
1644
|
-
resolveHint(response, code, row.slice(
|
1671
|
+
var code = row[0];
|
1672
|
+
resolveHint(response, code, row.slice(1));
|
1645
1673
|
return;
|
1646
1674
|
}
|
1647
1675
|
|
1648
|
-
case
|
1676
|
+
case 69
|
1677
|
+
/* "E" */
|
1678
|
+
:
|
1649
1679
|
{
|
1650
|
-
var errorInfo = JSON.parse(row
|
1680
|
+
var errorInfo = JSON.parse(row);
|
1651
1681
|
|
1652
1682
|
{
|
1653
1683
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -1656,28 +1686,145 @@ function processFullRow(response, row) {
|
|
1656
1686
|
return;
|
1657
1687
|
}
|
1658
1688
|
|
1689
|
+
case 84
|
1690
|
+
/* "T" */
|
1691
|
+
:
|
1692
|
+
{
|
1693
|
+
resolveText(response, id, row);
|
1694
|
+
return;
|
1695
|
+
}
|
1696
|
+
|
1659
1697
|
default:
|
1660
1698
|
{
|
1661
1699
|
// We assume anything else is JSON.
|
1662
|
-
resolveModel(response, id, row
|
1700
|
+
resolveModel(response, id, row);
|
1663
1701
|
return;
|
1664
1702
|
}
|
1665
1703
|
}
|
1666
1704
|
}
|
1667
1705
|
|
1668
1706
|
function processBinaryChunk(response, chunk) {
|
1669
|
-
var
|
1670
|
-
var
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1707
|
+
var i = 0;
|
1708
|
+
var rowState = response._rowState;
|
1709
|
+
var rowID = response._rowID;
|
1710
|
+
var rowTag = response._rowTag;
|
1711
|
+
var rowLength = response._rowLength;
|
1712
|
+
var buffer = response._buffer;
|
1713
|
+
var chunkLength = chunk.length;
|
1714
|
+
|
1715
|
+
while (i < chunkLength) {
|
1716
|
+
var lastIdx = -1;
|
1717
|
+
|
1718
|
+
switch (rowState) {
|
1719
|
+
case ROW_ID:
|
1720
|
+
{
|
1721
|
+
var byte = chunk[i++];
|
1722
|
+
|
1723
|
+
if (byte === 58
|
1724
|
+
/* ":" */
|
1725
|
+
) {
|
1726
|
+
// Finished the rowID, next we'll parse the tag.
|
1727
|
+
rowState = ROW_TAG;
|
1728
|
+
} else {
|
1729
|
+
rowID = rowID << 4 | (byte > 96 ? byte - 87 : byte - 48);
|
1730
|
+
}
|
1731
|
+
|
1732
|
+
continue;
|
1733
|
+
}
|
1734
|
+
|
1735
|
+
case ROW_TAG:
|
1736
|
+
{
|
1737
|
+
var resolvedRowTag = chunk[i];
|
1738
|
+
|
1739
|
+
if (resolvedRowTag === 84
|
1740
|
+
/* "T" */
|
1741
|
+
) {
|
1742
|
+
rowTag = resolvedRowTag;
|
1743
|
+
rowState = ROW_LENGTH;
|
1744
|
+
i++;
|
1745
|
+
} else if (resolvedRowTag > 64 && resolvedRowTag < 91
|
1746
|
+
/* "A"-"Z" */
|
1747
|
+
) {
|
1748
|
+
rowTag = resolvedRowTag;
|
1749
|
+
rowState = ROW_CHUNK_BY_NEWLINE;
|
1750
|
+
i++;
|
1751
|
+
} else {
|
1752
|
+
rowTag = 0;
|
1753
|
+
rowState = ROW_CHUNK_BY_NEWLINE; // This was an unknown tag so it was probably part of the data.
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
continue;
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
case ROW_LENGTH:
|
1760
|
+
{
|
1761
|
+
var _byte = chunk[i++];
|
1762
|
+
|
1763
|
+
if (_byte === 44
|
1764
|
+
/* "," */
|
1765
|
+
) {
|
1766
|
+
// Finished the rowLength, next we'll buffer up to that length.
|
1767
|
+
rowState = ROW_CHUNK_BY_LENGTH;
|
1768
|
+
} else {
|
1769
|
+
rowLength = rowLength << 4 | (_byte > 96 ? _byte - 87 : _byte - 48);
|
1770
|
+
}
|
1771
|
+
|
1772
|
+
continue;
|
1773
|
+
}
|
1774
|
+
|
1775
|
+
case ROW_CHUNK_BY_NEWLINE:
|
1776
|
+
{
|
1777
|
+
// We're looking for a newline
|
1778
|
+
lastIdx = chunk.indexOf(10
|
1779
|
+
/* "\n" */
|
1780
|
+
, i);
|
1781
|
+
break;
|
1782
|
+
}
|
1783
|
+
|
1784
|
+
case ROW_CHUNK_BY_LENGTH:
|
1785
|
+
{
|
1786
|
+
// We're looking for the remaining byte length
|
1787
|
+
if (i + rowLength <= chunk.length) {
|
1788
|
+
lastIdx = i + rowLength;
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
break;
|
1792
|
+
}
|
1793
|
+
}
|
1794
|
+
|
1795
|
+
if (lastIdx > -1) {
|
1796
|
+
// We found the last chunk of the row
|
1797
|
+
var offset = chunk.byteOffset + i;
|
1798
|
+
var length = lastIdx - i;
|
1799
|
+
var lastChunk = new Uint8Array(chunk.buffer, offset, length);
|
1800
|
+
processFullRow(response, rowID, rowTag, buffer, lastChunk); // Reset state machine for a new row
|
1801
|
+
|
1802
|
+
rowState = ROW_ID;
|
1803
|
+
rowTag = 0;
|
1804
|
+
rowID = 0;
|
1805
|
+
rowLength = 0;
|
1806
|
+
buffer.length = 0;
|
1807
|
+
i = lastIdx + 1;
|
1808
|
+
} else {
|
1809
|
+
// The rest of this row is in a future chunk. We stash the rest of the
|
1810
|
+
// current chunk until we can process the full row.
|
1811
|
+
var _offset = chunk.byteOffset + i;
|
1812
|
+
|
1813
|
+
var _length = chunk.byteLength - i;
|
1814
|
+
|
1815
|
+
var remainingSlice = new Uint8Array(chunk.buffer, _offset, _length);
|
1816
|
+
buffer.push(remainingSlice); // Update how many bytes we're still waiting for. If we're looking for
|
1817
|
+
// a newline, this doesn't hurt since we'll just ignore it.
|
1818
|
+
|
1819
|
+
rowLength -= remainingSlice.byteLength;
|
1820
|
+
break;
|
1821
|
+
}
|
1678
1822
|
}
|
1679
1823
|
|
1680
|
-
response.
|
1824
|
+
response._rowState = rowState;
|
1825
|
+
response._rowID = rowID;
|
1826
|
+
response._rowTag = rowTag;
|
1827
|
+
response._rowLength = rowLength;
|
1681
1828
|
}
|
1682
1829
|
|
1683
1830
|
function parseModel(response, json) {
|
@@ -7,29 +7,29 @@
|
|
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 q=require("react-dom"),
|
11
|
-
function
|
12
|
-
var
|
13
|
-
function J(a,b,c,d){function
|
14
|
-
1]&&this[
|
15
|
-
if(Symbol.for(
|
16
|
-
function
|
17
|
-
function L(a){var b=I.get(this);if(!b)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var c=null;if(null!==b.bound){c=K.get(b);c||(c=
|
18
|
-
var M=
|
10
|
+
'use strict';var q=require("react-dom"),r=require("react"),u={stream:!0};function v(a,b){if(a){var c=a[b.id];if(a=c[b.name])c=a.name;else{a=c["*"];if(!a)throw Error('Could not find the module "'+b.id+'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.');c=b.name}return{id:a.id,chunks:a.chunks,name:c,async:!!b.async}}return b}var w=new Map,x=new Map;function y(){}
|
11
|
+
function z(a){for(var b=a.chunks,c=[],d=0;d<b.length;d++){var g=b[d],h=w.get(g);if(void 0===h){h=__webpack_chunk_load__(g);c.push(h);var n=w.set.bind(w,g,null);h.then(n,y);w.set(g,h)}else null!==h&&c.push(h)}if(a.async){if(b=x.get(a.id))return"fulfilled"===b.status?null:b;var e=Promise.all(c).then(function(){return __webpack_require__(a.id)});e.then(function(l){e.status="fulfilled";e.value=l},function(l){e.status="rejected";e.reason=l});x.set(a.id,e);return e}return 0<c.length?Promise.all(c):null}
|
12
|
+
var A=q.__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"),F=Symbol.iterator;function G(a){if(null===a||"object"!==typeof a)return null;a=F&&a[F]||a["@@iterator"];return"function"===typeof a?a:null}var aa=Array.isArray,I=new WeakMap;function ba(a){return Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN"}
|
13
|
+
function J(a,b,c,d){function g(l,f){if(null===f)return null;if("object"===typeof f){if("function"===typeof f.then){null===e&&(e=new FormData);n++;var k=h++;f.then(function(p){p=JSON.stringify(p,g);var t=e;t.append(b+k,p);n--;0===n&&c(t)},function(p){d(p)});return"$@"+k.toString(16)}if(f instanceof FormData){null===e&&(e=new FormData);var m=e;l=h++;var E=b+l+"_";f.forEach(function(p,t){m.append(E+t,p)});return"$K"+l.toString(16)}return!aa(f)&&G(f)?Array.from(f):f}if("string"===typeof f){if("Z"===f[f.length-
|
14
|
+
1]&&this[l]instanceof Date)return"$D"+f;f="$"===f[0]?"$"+f:f;return f}if("boolean"===typeof f)return f;if("number"===typeof f)return ba(f);if("undefined"===typeof f)return"$undefined";if("function"===typeof f){f=I.get(f);if(void 0!==f)return f=JSON.stringify(f,g),null===e&&(e=new FormData),l=h++,e.set(b+l,f),"$F"+l.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 f){l=f.description;
|
15
|
+
if(Symbol.for(l)!==f)throw Error("Only global symbols received from Symbol.for(...) can be passed to Server Functions. The symbol Symbol.for("+(f.description+") cannot be found among global symbols."));return"$S"+l}if("bigint"===typeof f)return"$n"+f.toString(10);throw Error("Type "+typeof f+" is not supported as an argument to a Server Function.");}var h=1,n=0,e=null;a=JSON.stringify(a,g);null===e?c(a):(e.set(b+"0",a),0===n&&c(e))}var K=new WeakMap;
|
16
|
+
function ca(a){var b,c,d=new Promise(function(g,h){b=g;c=h});J(a,"",function(g){if("string"===typeof g){var h=new FormData;h.append("0",g);g=h}d.status="fulfilled";d.value=g;b(g)},function(g){d.status="rejected";d.reason=g;c(g)});return d}
|
17
|
+
function L(a){var b=I.get(this);if(!b)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var c=null;if(null!==b.bound){c=K.get(b);c||(c=ca(b),K.set(b,c));if("rejected"===c.status)throw c.reason;if("fulfilled"!==c.status)throw c;b=c.value;var d=new FormData;b.forEach(function(g,h){d.append("$ACTION_"+a+":"+h,g)});c=d;b="$ACTION_REF_"+a}else b="$ACTION_ID_"+b.id;return{name:b,method:"POST",encType:"multipart/form-data",data:c}}
|
18
|
+
var M=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function N(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}N.prototype=Object.create(Promise.prototype);
|
19
19
|
N.prototype.then=function(a,b){switch(this.status){case "resolved_model":O(this);break;case "resolved_module":P(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};
|
20
|
-
function
|
20
|
+
function da(a){switch(a.status){case "resolved_model":O(a);break;case "resolved_module":P(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function Q(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function R(a,b,c){switch(a.status){case "fulfilled":Q(b,a.value);break;case "pending":case "blocked":a.value=b;a.reason=c;break;case "rejected":c&&Q(c,a.reason)}}
|
21
21
|
function S(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&Q(c,b)}}function T(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(P(a),R(a,c,d))}}var U=null,V=null;
|
22
|
-
function O(a){var b=U,c=V;U=a;V=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==V&&0<V.deps?(V.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(
|
23
|
-
function P(a){try{var b=a.value;if(b.async){var c=x.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var
|
24
|
-
function
|
25
|
-
function
|
26
|
-
function
|
27
|
-
}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=X(a,d);switch(a.status){case "resolved_model":O(a);break;case "resolved_module":P(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=U,a.then(
|
28
|
-
function
|
29
|
-
function
|
30
|
-
function
|
31
|
-
function Z(a,b){function c(
|
32
|
-
case "C":
|
33
|
-
null,k,
|
34
|
-
exports.createFromFetch=function(a,b){var c=Y(null,b&&b.callServer?b.callServer:void 0);a.then(function(d){Z(c,d.body)},function(d){W(c,d)});return X(c,0)};exports.createFromReadableStream=function(a,b){b=Y(null,b&&b.callServer?b.callServer:void 0);Z(b,a);return X(b,0)};
|
35
|
-
exports.encodeReply=function(a){return new Promise(function(b,c){J(a,"",b,c)})};
|
22
|
+
function O(a){var b=U,c=V;U=a;V=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==V&&0<V.deps?(V.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(g){a.status="rejected",a.reason=g}finally{U=b,V=c}}
|
23
|
+
function P(a){try{var b=a.value;if(b.async){var c=x.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var g="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=g}catch(h){a.status="rejected",a.reason=h}}function W(a,b){a._chunks.forEach(function(c){"pending"===c.status&&S(c,b)})}function X(a,b){var c=a._chunks,d=c.get(b);d||(d=new N("pending",null,null,a),c.set(b,d));return d}
|
24
|
+
function ea(a,b,c){if(V){var d=V;d.deps++}else d=V={deps:1,value:null};return function(g){b[c]=g;d.deps--;0===d.deps&&"blocked"===a.status&&(g=a.value,a.status="fulfilled",a.value=d.value,null!==g&&Q(g,d.value))}}function fa(a){return function(b){return S(a,b)}}
|
25
|
+
function ha(a,b){function c(){var g=Array.prototype.slice.call(arguments),h=b.bound;return h?"fulfilled"===h.status?d(b.id,h.value.concat(g)):Promise.resolve(h).then(function(n){return d(b.id,n.concat(g))}):d(b.id,g)}var d=a._callServer;c.$$FORM_ACTION=L;I.set(c,b);return c}
|
26
|
+
function ia(a,b,c,d){if("$"===d[0]){if("$"===d)return B;switch(d[1]){case "$":return d.slice(1);case "L":return b=parseInt(d.slice(2),16),a=X(a,b),{$$typeof:C,_payload:a,_init:da};case "@":return b=parseInt(d.slice(2),16),X(a,b);case "S":return Symbol.for(d.slice(2));case "P":return a=d.slice(2),M[a]||(M[a]=r.createServerContext(a,D)),M[a].Provider;case "F":b=parseInt(d.slice(2),16);b=X(a,b);switch(b.status){case "resolved_model":O(b)}switch(b.status){case "fulfilled":return ha(a,b.value);default:throw b.reason;
|
27
|
+
}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=X(a,d);switch(a.status){case "resolved_model":O(a);break;case "resolved_module":P(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=U,a.then(ea(d,b,c),fa(d)),null;default:throw a.reason;}}}return d}
|
28
|
+
function ja(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function Y(a,b){var c=new Map;a={_bundlerConfig:a,_callServer:void 0!==b?b:ja,_chunks:c,_stringDecoder:new TextDecoder,_fromJSON:null,_rowState:0,_rowID:0,_rowTag:0,_rowLength:0,_buffer:[]};a._fromJSON=ka(a);return a}
|
29
|
+
function la(a,b,c){var d=a._chunks,g=d.get(b);c=JSON.parse(c,a._fromJSON);var h=v(a._bundlerConfig,c);if(c=z(h)){if(g){var n=g;n.status="blocked"}else n=new N("blocked",null,null,a),d.set(b,n);c.then(function(){return T(n,h)},function(e){return S(n,e)})}else g?T(g,h):d.set(b,new N("resolved_module",h,null,a))}
|
30
|
+
function ka(a){return function(b,c){return"string"===typeof c?ia(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===B?{$$typeof:B,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}
|
31
|
+
function Z(a,b){function c(h){var n=h.value;if(h.done)W(a,Error("Connection closed."));else{var e=0,l=a._rowState,f=a._rowID,k=a._rowTag,m=a._rowLength;h=a._buffer;for(var E=n.length;e<E;){var p=-1;switch(l){case 0:p=n[e++];58===p?l=1:f=f<<4|(96<p?p-87:p-48);continue;case 1:p=n[e];84===p?(k=p,l=2,e++):64<p&&91>p?(k=p,l=3,e++):(k=0,l=3);continue;case 2:p=n[e++];44===p?l=4:m=m<<4|(96<p?p-87:p-48);continue;case 3:p=n.indexOf(10,e);break;case 4:e+m<=n.length&&(p=e+m)}if(-1<p){e=new Uint8Array(n.buffer,
|
32
|
+
n.byteOffset+e,p-e);m=a;l=k;k="";for(var t=m._stringDecoder,H=0;H<h.length;H++)k+=t.decode(h[H],u);k="string"===typeof e?k+e:k+t.decode(e);switch(l){case 73:la(m,f,k);break;case 72:f=k[0];k=k.slice(1);m=JSON.parse(k,m._fromJSON);k=void 0;if(l=A.current)switch("string"===typeof m?e=m:(e=m[0],k=m[1]),f){case "D":l.prefetchDNS(e,k);break;case "C":l.preconnect(e,k);break;case "L":l.preload(e,k);break;case "I":l.preinit(e,k)}break;case 69:k=JSON.parse(k);e=k.digest;k=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.");
|
33
|
+
k.stack="Error: "+k.message;k.digest=e;e=m._chunks;(l=e.get(f))?S(l,k):e.set(f,new N("rejected",null,k,m));break;case 84:m._chunks.set(f,new N("fulfilled",k,null,m));break;default:e=m._chunks,(l=e.get(f))?(m=l,f=k,"pending"===m.status&&(k=m.value,e=m.reason,m.status="resolved_model",m.value=f,null!==k&&(O(m),R(m,k,e)))):e.set(f,new N("resolved_model",k,null,m))}m=f=k=l=0;h.length=0;e=p+1}else{n=new Uint8Array(n.buffer,n.byteOffset+e,n.byteLength-e);h.push(n);m-=n.byteLength;break}}a._rowState=l;a._rowID=
|
34
|
+
f;a._rowTag=k;a._rowLength=m;return g.read().then(c).catch(d)}}function d(h){W(a,h)}var g=b.getReader();g.read().then(c).catch(d)}exports.createFromFetch=function(a,b){var c=Y(null,b&&b.callServer?b.callServer:void 0);a.then(function(d){Z(c,d.body)},function(d){W(c,d)});return X(c,0)};exports.createFromReadableStream=function(a,b){b=Y(null,b&&b.callServer?b.callServer:void 0);Z(b,a);return X(b,0)};
|
35
|
+
exports.createServerReference=function(a,b){function c(){var d=Array.prototype.slice.call(arguments);return b(a,d)}c.$$FORM_ACTION=L;I.set(c,{id:a,bound:null});return c};exports.encodeReply=function(a){return new Promise(function(b,c){J(a,"",b,c)})};
|
@@ -944,6 +944,11 @@ function getOrCreateServerContext(globalName) {
|
|
944
944
|
return ContextRegistry[globalName];
|
945
945
|
}
|
946
946
|
|
947
|
+
var ROW_ID = 0;
|
948
|
+
var ROW_TAG = 1;
|
949
|
+
var ROW_LENGTH = 2;
|
950
|
+
var ROW_CHUNK_BY_NEWLINE = 3;
|
951
|
+
var ROW_CHUNK_BY_LENGTH = 4;
|
947
952
|
var PENDING = 'pending';
|
948
953
|
var BLOCKED = 'blocked';
|
949
954
|
var RESOLVED_MODEL = 'resolved_model';
|
@@ -1109,6 +1114,11 @@ function createResolvedModuleChunk(response, value) {
|
|
1109
1114
|
return new Chunk(RESOLVED_MODULE, value, null, response);
|
1110
1115
|
}
|
1111
1116
|
|
1117
|
+
function createInitializedTextChunk(response, value) {
|
1118
|
+
// $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
|
1119
|
+
return new Chunk(INITIALIZED, value, null, response);
|
1120
|
+
}
|
1121
|
+
|
1112
1122
|
function resolveModelChunk(chunk, value) {
|
1113
1123
|
if (chunk.status !== PENDING) {
|
1114
1124
|
// We already resolved. We didn't expect to see this.
|
@@ -1520,9 +1530,13 @@ function createResponse(bundlerConfig, callServer) {
|
|
1520
1530
|
_bundlerConfig: bundlerConfig,
|
1521
1531
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1522
1532
|
_chunks: chunks,
|
1523
|
-
_partialRow: '',
|
1524
1533
|
_stringDecoder: createStringDecoder(),
|
1525
|
-
_fromJSON: null
|
1534
|
+
_fromJSON: null,
|
1535
|
+
_rowState: 0,
|
1536
|
+
_rowID: 0,
|
1537
|
+
_rowTag: 0,
|
1538
|
+
_rowLength: 0,
|
1539
|
+
_buffer: []
|
1526
1540
|
}; // Don't inline this call because it causes closure to outline the call above.
|
1527
1541
|
|
1528
1542
|
response._fromJSON = createFromJSONCallback(response);
|
@@ -1540,6 +1554,13 @@ function resolveModel(response, id, model) {
|
|
1540
1554
|
}
|
1541
1555
|
}
|
1542
1556
|
|
1557
|
+
function resolveText(response, id, text) {
|
1558
|
+
var chunks = response._chunks; // We assume that we always reference large strings after they've been
|
1559
|
+
// emitted.
|
1560
|
+
|
1561
|
+
chunks.set(id, createInitializedTextChunk(response, text));
|
1562
|
+
}
|
1563
|
+
|
1543
1564
|
function resolveModule(response, id, model) {
|
1544
1565
|
var chunks = response._chunks;
|
1545
1566
|
var chunk = chunks.get(id);
|
@@ -1603,35 +1624,44 @@ function resolveHint(response, code, model) {
|
|
1603
1624
|
dispatchHint(code, hintModel);
|
1604
1625
|
}
|
1605
1626
|
|
1606
|
-
function processFullRow(response,
|
1607
|
-
|
1608
|
-
|
1627
|
+
function processFullRow(response, id, tag, buffer, lastChunk) {
|
1628
|
+
var row = '';
|
1629
|
+
var stringDecoder = response._stringDecoder;
|
1630
|
+
|
1631
|
+
for (var i = 0; i < buffer.length; i++) {
|
1632
|
+
var chunk = buffer[i];
|
1633
|
+
row += readPartialStringChunk(stringDecoder, chunk);
|
1609
1634
|
}
|
1610
1635
|
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
// }
|
1636
|
+
if (typeof lastChunk === 'string') {
|
1637
|
+
row += lastChunk;
|
1638
|
+
} else {
|
1639
|
+
row += readFinalStringChunk(stringDecoder, lastChunk);
|
1640
|
+
}
|
1617
1641
|
|
1618
1642
|
switch (tag) {
|
1619
|
-
case
|
1643
|
+
case 73
|
1644
|
+
/* "I" */
|
1645
|
+
:
|
1620
1646
|
{
|
1621
|
-
resolveModule(response, id, row
|
1647
|
+
resolveModule(response, id, row);
|
1622
1648
|
return;
|
1623
1649
|
}
|
1624
1650
|
|
1625
|
-
case
|
1651
|
+
case 72
|
1652
|
+
/* "H" */
|
1653
|
+
:
|
1626
1654
|
{
|
1627
|
-
var code = row[
|
1628
|
-
resolveHint(response, code, row.slice(
|
1655
|
+
var code = row[0];
|
1656
|
+
resolveHint(response, code, row.slice(1));
|
1629
1657
|
return;
|
1630
1658
|
}
|
1631
1659
|
|
1632
|
-
case
|
1660
|
+
case 69
|
1661
|
+
/* "E" */
|
1662
|
+
:
|
1633
1663
|
{
|
1634
|
-
var errorInfo = JSON.parse(row
|
1664
|
+
var errorInfo = JSON.parse(row);
|
1635
1665
|
|
1636
1666
|
{
|
1637
1667
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -1640,28 +1670,145 @@ function processFullRow(response, row) {
|
|
1640
1670
|
return;
|
1641
1671
|
}
|
1642
1672
|
|
1673
|
+
case 84
|
1674
|
+
/* "T" */
|
1675
|
+
:
|
1676
|
+
{
|
1677
|
+
resolveText(response, id, row);
|
1678
|
+
return;
|
1679
|
+
}
|
1680
|
+
|
1643
1681
|
default:
|
1644
1682
|
{
|
1645
1683
|
// We assume anything else is JSON.
|
1646
|
-
resolveModel(response, id, row
|
1684
|
+
resolveModel(response, id, row);
|
1647
1685
|
return;
|
1648
1686
|
}
|
1649
1687
|
}
|
1650
1688
|
}
|
1651
1689
|
|
1652
1690
|
function processBinaryChunk(response, chunk) {
|
1653
|
-
var
|
1654
|
-
var
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1691
|
+
var i = 0;
|
1692
|
+
var rowState = response._rowState;
|
1693
|
+
var rowID = response._rowID;
|
1694
|
+
var rowTag = response._rowTag;
|
1695
|
+
var rowLength = response._rowLength;
|
1696
|
+
var buffer = response._buffer;
|
1697
|
+
var chunkLength = chunk.length;
|
1698
|
+
|
1699
|
+
while (i < chunkLength) {
|
1700
|
+
var lastIdx = -1;
|
1701
|
+
|
1702
|
+
switch (rowState) {
|
1703
|
+
case ROW_ID:
|
1704
|
+
{
|
1705
|
+
var byte = chunk[i++];
|
1706
|
+
|
1707
|
+
if (byte === 58
|
1708
|
+
/* ":" */
|
1709
|
+
) {
|
1710
|
+
// Finished the rowID, next we'll parse the tag.
|
1711
|
+
rowState = ROW_TAG;
|
1712
|
+
} else {
|
1713
|
+
rowID = rowID << 4 | (byte > 96 ? byte - 87 : byte - 48);
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
continue;
|
1717
|
+
}
|
1718
|
+
|
1719
|
+
case ROW_TAG:
|
1720
|
+
{
|
1721
|
+
var resolvedRowTag = chunk[i];
|
1722
|
+
|
1723
|
+
if (resolvedRowTag === 84
|
1724
|
+
/* "T" */
|
1725
|
+
) {
|
1726
|
+
rowTag = resolvedRowTag;
|
1727
|
+
rowState = ROW_LENGTH;
|
1728
|
+
i++;
|
1729
|
+
} else if (resolvedRowTag > 64 && resolvedRowTag < 91
|
1730
|
+
/* "A"-"Z" */
|
1731
|
+
) {
|
1732
|
+
rowTag = resolvedRowTag;
|
1733
|
+
rowState = ROW_CHUNK_BY_NEWLINE;
|
1734
|
+
i++;
|
1735
|
+
} else {
|
1736
|
+
rowTag = 0;
|
1737
|
+
rowState = ROW_CHUNK_BY_NEWLINE; // This was an unknown tag so it was probably part of the data.
|
1738
|
+
}
|
1739
|
+
|
1740
|
+
continue;
|
1741
|
+
}
|
1742
|
+
|
1743
|
+
case ROW_LENGTH:
|
1744
|
+
{
|
1745
|
+
var _byte = chunk[i++];
|
1746
|
+
|
1747
|
+
if (_byte === 44
|
1748
|
+
/* "," */
|
1749
|
+
) {
|
1750
|
+
// Finished the rowLength, next we'll buffer up to that length.
|
1751
|
+
rowState = ROW_CHUNK_BY_LENGTH;
|
1752
|
+
} else {
|
1753
|
+
rowLength = rowLength << 4 | (_byte > 96 ? _byte - 87 : _byte - 48);
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
continue;
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
case ROW_CHUNK_BY_NEWLINE:
|
1760
|
+
{
|
1761
|
+
// We're looking for a newline
|
1762
|
+
lastIdx = chunk.indexOf(10
|
1763
|
+
/* "\n" */
|
1764
|
+
, i);
|
1765
|
+
break;
|
1766
|
+
}
|
1767
|
+
|
1768
|
+
case ROW_CHUNK_BY_LENGTH:
|
1769
|
+
{
|
1770
|
+
// We're looking for the remaining byte length
|
1771
|
+
if (i + rowLength <= chunk.length) {
|
1772
|
+
lastIdx = i + rowLength;
|
1773
|
+
}
|
1774
|
+
|
1775
|
+
break;
|
1776
|
+
}
|
1777
|
+
}
|
1778
|
+
|
1779
|
+
if (lastIdx > -1) {
|
1780
|
+
// We found the last chunk of the row
|
1781
|
+
var offset = chunk.byteOffset + i;
|
1782
|
+
var length = lastIdx - i;
|
1783
|
+
var lastChunk = new Uint8Array(chunk.buffer, offset, length);
|
1784
|
+
processFullRow(response, rowID, rowTag, buffer, lastChunk); // Reset state machine for a new row
|
1785
|
+
|
1786
|
+
rowState = ROW_ID;
|
1787
|
+
rowTag = 0;
|
1788
|
+
rowID = 0;
|
1789
|
+
rowLength = 0;
|
1790
|
+
buffer.length = 0;
|
1791
|
+
i = lastIdx + 1;
|
1792
|
+
} else {
|
1793
|
+
// The rest of this row is in a future chunk. We stash the rest of the
|
1794
|
+
// current chunk until we can process the full row.
|
1795
|
+
var _offset = chunk.byteOffset + i;
|
1796
|
+
|
1797
|
+
var _length = chunk.byteLength - i;
|
1798
|
+
|
1799
|
+
var remainingSlice = new Uint8Array(chunk.buffer, _offset, _length);
|
1800
|
+
buffer.push(remainingSlice); // Update how many bytes we're still waiting for. If we're looking for
|
1801
|
+
// a newline, this doesn't hurt since we'll just ignore it.
|
1802
|
+
|
1803
|
+
rowLength -= remainingSlice.byteLength;
|
1804
|
+
break;
|
1805
|
+
}
|
1662
1806
|
}
|
1663
1807
|
|
1664
|
-
response.
|
1808
|
+
response._rowState = rowState;
|
1809
|
+
response._rowID = rowID;
|
1810
|
+
response._rowTag = rowTag;
|
1811
|
+
response._rowLength = rowLength;
|
1665
1812
|
}
|
1666
1813
|
|
1667
1814
|
function parseModel(response, json) {
|