react-server-dom-webpack 19.2.0-canary-ab859e31-20250606 → 19.2.0-canary-280ff6fe-20250606

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.
@@ -2786,10 +2786,10 @@
2786
2786
  return hook.checkDCE ? !0 : !1;
2787
2787
  })({
2788
2788
  bundleType: 1,
2789
- version: "19.2.0-canary-ab859e31-20250606",
2789
+ version: "19.2.0-canary-280ff6fe-20250606",
2790
2790
  rendererPackageName: "react-server-dom-webpack",
2791
2791
  currentDispatcherRef: ReactSharedInternals,
2792
- reconcilerVersion: "19.2.0-canary-ab859e31-20250606",
2792
+ reconcilerVersion: "19.2.0-canary-280ff6fe-20250606",
2793
2793
  getCurrentComponentInfo: function () {
2794
2794
  return currentOwnerInDEV;
2795
2795
  }
@@ -2593,6 +2593,85 @@
2593
2593
  resolveModel(response, id, row);
2594
2594
  }
2595
2595
  }
2596
+ function processBinaryChunk(response, chunk) {
2597
+ for (
2598
+ var i = 0,
2599
+ rowState = response._rowState,
2600
+ rowID = response._rowID,
2601
+ rowTag = response._rowTag,
2602
+ rowLength = response._rowLength,
2603
+ buffer = response._buffer,
2604
+ chunkLength = chunk.length;
2605
+ i < chunkLength;
2606
+
2607
+ ) {
2608
+ var lastIdx = -1;
2609
+ switch (rowState) {
2610
+ case 0:
2611
+ lastIdx = chunk[i++];
2612
+ 58 === lastIdx
2613
+ ? (rowState = 1)
2614
+ : (rowID =
2615
+ (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2616
+ continue;
2617
+ case 1:
2618
+ rowState = chunk[i];
2619
+ 84 === rowState ||
2620
+ 65 === rowState ||
2621
+ 79 === rowState ||
2622
+ 111 === rowState ||
2623
+ 85 === rowState ||
2624
+ 83 === rowState ||
2625
+ 115 === rowState ||
2626
+ 76 === rowState ||
2627
+ 108 === rowState ||
2628
+ 71 === rowState ||
2629
+ 103 === rowState ||
2630
+ 77 === rowState ||
2631
+ 109 === rowState ||
2632
+ 86 === rowState
2633
+ ? ((rowTag = rowState), (rowState = 2), i++)
2634
+ : (64 < rowState && 91 > rowState) ||
2635
+ 35 === rowState ||
2636
+ 114 === rowState ||
2637
+ 120 === rowState
2638
+ ? ((rowTag = rowState), (rowState = 3), i++)
2639
+ : ((rowTag = 0), (rowState = 3));
2640
+ continue;
2641
+ case 2:
2642
+ lastIdx = chunk[i++];
2643
+ 44 === lastIdx
2644
+ ? (rowState = 4)
2645
+ : (rowLength =
2646
+ (rowLength << 4) |
2647
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2648
+ continue;
2649
+ case 3:
2650
+ lastIdx = chunk.indexOf(10, i);
2651
+ break;
2652
+ case 4:
2653
+ (lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
2654
+ }
2655
+ var offset = chunk.byteOffset + i;
2656
+ if (-1 < lastIdx)
2657
+ (rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
2658
+ processFullBinaryRow(response, rowID, rowTag, buffer, rowLength),
2659
+ (i = lastIdx),
2660
+ 3 === rowState && i++,
2661
+ (rowLength = rowID = rowTag = rowState = 0),
2662
+ (buffer.length = 0);
2663
+ else {
2664
+ chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
2665
+ buffer.push(chunk);
2666
+ rowLength -= chunk.byteLength;
2667
+ break;
2668
+ }
2669
+ }
2670
+ response._rowState = rowState;
2671
+ response._rowID = rowID;
2672
+ response._rowTag = rowTag;
2673
+ response._rowLength = rowLength;
2674
+ }
2596
2675
  function createFromJSONCallback(response) {
2597
2676
  return function (key, value) {
2598
2677
  if ("string" === typeof value)
@@ -2703,6 +2782,46 @@
2703
2782
  return value;
2704
2783
  };
2705
2784
  }
2785
+ function close(response) {
2786
+ reportGlobalError(response, Error("Connection closed."));
2787
+ }
2788
+ function noServerCall$1() {
2789
+ throw Error(
2790
+ "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."
2791
+ );
2792
+ }
2793
+ function createResponseFromOptions(options) {
2794
+ return new ResponseInstance(
2795
+ options.serverConsumerManifest.moduleMap,
2796
+ options.serverConsumerManifest.serverModuleMap,
2797
+ options.serverConsumerManifest.moduleLoading,
2798
+ noServerCall$1,
2799
+ options.encodeFormAction,
2800
+ "string" === typeof options.nonce ? options.nonce : void 0,
2801
+ options && options.temporaryReferences
2802
+ ? options.temporaryReferences
2803
+ : void 0,
2804
+ options && options.findSourceMapURL ? options.findSourceMapURL : void 0,
2805
+ options ? !0 === options.replayConsoleLogs : !1,
2806
+ options && options.environmentName ? options.environmentName : void 0
2807
+ );
2808
+ }
2809
+ function startReadingFromStream(response, stream) {
2810
+ function progress(_ref) {
2811
+ var value = _ref.value;
2812
+ if (_ref.done) close(response);
2813
+ else
2814
+ return (
2815
+ processBinaryChunk(response, value),
2816
+ reader.read().then(progress).catch(error)
2817
+ );
2818
+ }
2819
+ function error(e) {
2820
+ reportGlobalError(response, e);
2821
+ }
2822
+ var reader = stream.getReader();
2823
+ reader.read().then(progress).catch(error);
2824
+ }
2706
2825
  function noServerCall() {
2707
2826
  throw Error(
2708
2827
  "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."
@@ -2882,6 +3001,18 @@
2882
3001
  replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[
2883
3002
  "react-stack-bottom-frame"
2884
3003
  ].bind(replayConsoleWithCallStack);
3004
+ exports.createFromFetch = function (promiseForResponse, options) {
3005
+ var response = createResponseFromOptions(options);
3006
+ promiseForResponse.then(
3007
+ function (r) {
3008
+ startReadingFromStream(response, r.body);
3009
+ },
3010
+ function (e) {
3011
+ reportGlobalError(response, e);
3012
+ }
3013
+ );
3014
+ return getChunk(response, 0);
3015
+ };
2885
3016
  exports.createFromNodeStream = function (
2886
3017
  stream,
2887
3018
  serverConsumerManifest,
@@ -2987,102 +3118,50 @@
2987
3118
  response._rowID = rowID;
2988
3119
  response._rowTag = rowTag;
2989
3120
  response._rowLength = rowLength;
2990
- } else {
2991
- rowLength = 0;
2992
- chunkLength = response._rowState;
2993
- rowID = response._rowID;
2994
- i = response._rowTag;
2995
- rowState = response._rowLength;
2996
- buffer = response._buffer;
2997
- for (rowTag = chunk.length; rowLength < rowTag; ) {
2998
- lastIdx = -1;
2999
- switch (chunkLength) {
3000
- case 0:
3001
- lastIdx = chunk[rowLength++];
3002
- 58 === lastIdx
3003
- ? (chunkLength = 1)
3004
- : (rowID =
3005
- (rowID << 4) |
3006
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
3007
- continue;
3008
- case 1:
3009
- chunkLength = chunk[rowLength];
3010
- 84 === chunkLength ||
3011
- 65 === chunkLength ||
3012
- 79 === chunkLength ||
3013
- 111 === chunkLength ||
3014
- 85 === chunkLength ||
3015
- 83 === chunkLength ||
3016
- 115 === chunkLength ||
3017
- 76 === chunkLength ||
3018
- 108 === chunkLength ||
3019
- 71 === chunkLength ||
3020
- 103 === chunkLength ||
3021
- 77 === chunkLength ||
3022
- 109 === chunkLength ||
3023
- 86 === chunkLength
3024
- ? ((i = chunkLength), (chunkLength = 2), rowLength++)
3025
- : (64 < chunkLength && 91 > chunkLength) ||
3026
- 35 === chunkLength ||
3027
- 114 === chunkLength ||
3028
- 120 === chunkLength
3029
- ? ((i = chunkLength), (chunkLength = 3), rowLength++)
3030
- : ((i = 0), (chunkLength = 3));
3031
- continue;
3032
- case 2:
3033
- lastIdx = chunk[rowLength++];
3034
- 44 === lastIdx
3035
- ? (chunkLength = 4)
3036
- : (rowState =
3037
- (rowState << 4) |
3038
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
3039
- continue;
3040
- case 3:
3041
- lastIdx = chunk.indexOf(10, rowLength);
3042
- break;
3043
- case 4:
3044
- (lastIdx = rowLength + rowState),
3045
- lastIdx > chunk.length && (lastIdx = -1);
3046
- }
3047
- var offset = chunk.byteOffset + rowLength;
3048
- if (-1 < lastIdx)
3049
- (rowState = new Uint8Array(
3050
- chunk.buffer,
3051
- offset,
3052
- lastIdx - rowLength
3053
- )),
3054
- processFullBinaryRow(response, rowID, i, buffer, rowState),
3055
- (rowLength = lastIdx),
3056
- 3 === chunkLength && rowLength++,
3057
- (rowState = rowID = i = chunkLength = 0),
3058
- (buffer.length = 0);
3059
- else {
3060
- chunk = new Uint8Array(
3061
- chunk.buffer,
3062
- offset,
3063
- chunk.byteLength - rowLength
3064
- );
3065
- buffer.push(chunk);
3066
- rowState -= chunk.byteLength;
3067
- break;
3068
- }
3069
- }
3070
- response._rowState = chunkLength;
3071
- response._rowID = rowID;
3072
- response._rowTag = i;
3073
- response._rowLength = rowState;
3074
- }
3121
+ } else processBinaryChunk(response, chunk);
3075
3122
  });
3076
3123
  stream.on("error", function (error) {
3077
3124
  reportGlobalError(response, error);
3078
3125
  });
3079
3126
  stream.on("end", function () {
3080
- reportGlobalError(response, Error("Connection closed."));
3127
+ return close(response);
3081
3128
  });
3082
3129
  return getChunk(response, 0);
3083
3130
  };
3131
+ exports.createFromReadableStream = function (stream, options) {
3132
+ options = createResponseFromOptions(options);
3133
+ startReadingFromStream(options, stream);
3134
+ return getChunk(options, 0);
3135
+ };
3084
3136
  exports.createServerReference = function (id) {
3085
- return createServerReference$1(id, noServerCall);
3137
+ return createServerReference$1(id, noServerCall$1);
3138
+ };
3139
+ exports.createTemporaryReferenceSet = function () {
3140
+ return new Map();
3141
+ };
3142
+ exports.encodeReply = function (value, options) {
3143
+ return new Promise(function (resolve, reject) {
3144
+ var abort = processReply(
3145
+ value,
3146
+ "",
3147
+ options && options.temporaryReferences
3148
+ ? options.temporaryReferences
3149
+ : void 0,
3150
+ resolve,
3151
+ reject
3152
+ );
3153
+ if (options && options.signal) {
3154
+ var signal = options.signal;
3155
+ if (signal.aborted) abort(signal.reason);
3156
+ else {
3157
+ var listener = function () {
3158
+ abort(signal.reason);
3159
+ signal.removeEventListener("abort", listener);
3160
+ };
3161
+ signal.addEventListener("abort", listener);
3162
+ }
3163
+ }
3164
+ });
3086
3165
  };
3087
3166
  exports.registerServerReference = function (
3088
3167
  reference,
@@ -1647,6 +1647,84 @@ function processFullStringRow(response, id, tag, row) {
1647
1647
  );
1648
1648
  }
1649
1649
  }
1650
+ function processBinaryChunk(response, chunk) {
1651
+ for (
1652
+ var i = 0,
1653
+ rowState = response._rowState,
1654
+ rowID = response._rowID,
1655
+ rowTag = response._rowTag,
1656
+ rowLength = response._rowLength,
1657
+ buffer = response._buffer,
1658
+ chunkLength = chunk.length;
1659
+ i < chunkLength;
1660
+
1661
+ ) {
1662
+ var lastIdx = -1;
1663
+ switch (rowState) {
1664
+ case 0:
1665
+ lastIdx = chunk[i++];
1666
+ 58 === lastIdx
1667
+ ? (rowState = 1)
1668
+ : (rowID =
1669
+ (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1670
+ continue;
1671
+ case 1:
1672
+ rowState = chunk[i];
1673
+ 84 === rowState ||
1674
+ 65 === rowState ||
1675
+ 79 === rowState ||
1676
+ 111 === rowState ||
1677
+ 85 === rowState ||
1678
+ 83 === rowState ||
1679
+ 115 === rowState ||
1680
+ 76 === rowState ||
1681
+ 108 === rowState ||
1682
+ 71 === rowState ||
1683
+ 103 === rowState ||
1684
+ 77 === rowState ||
1685
+ 109 === rowState ||
1686
+ 86 === rowState
1687
+ ? ((rowTag = rowState), (rowState = 2), i++)
1688
+ : (64 < rowState && 91 > rowState) ||
1689
+ 35 === rowState ||
1690
+ 114 === rowState ||
1691
+ 120 === rowState
1692
+ ? ((rowTag = rowState), (rowState = 3), i++)
1693
+ : ((rowTag = 0), (rowState = 3));
1694
+ continue;
1695
+ case 2:
1696
+ lastIdx = chunk[i++];
1697
+ 44 === lastIdx
1698
+ ? (rowState = 4)
1699
+ : (rowLength =
1700
+ (rowLength << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1701
+ continue;
1702
+ case 3:
1703
+ lastIdx = chunk.indexOf(10, i);
1704
+ break;
1705
+ case 4:
1706
+ (lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
1707
+ }
1708
+ var offset = chunk.byteOffset + i;
1709
+ if (-1 < lastIdx)
1710
+ (rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
1711
+ processFullBinaryRow(response, rowID, rowTag, buffer, rowLength),
1712
+ (i = lastIdx),
1713
+ 3 === rowState && i++,
1714
+ (rowLength = rowID = rowTag = rowState = 0),
1715
+ (buffer.length = 0);
1716
+ else {
1717
+ chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
1718
+ buffer.push(chunk);
1719
+ rowLength -= chunk.byteLength;
1720
+ break;
1721
+ }
1722
+ }
1723
+ response._rowState = rowState;
1724
+ response._rowID = rowID;
1725
+ response._rowTag = rowTag;
1726
+ response._rowLength = rowLength;
1727
+ }
1650
1728
  function createFromJSONCallback(response) {
1651
1729
  return function (key, value) {
1652
1730
  if ("string" === typeof value)
@@ -1687,11 +1765,60 @@ function createFromJSONCallback(response) {
1687
1765
  return value;
1688
1766
  };
1689
1767
  }
1768
+ function close(response) {
1769
+ reportGlobalError(response, Error("Connection closed."));
1770
+ }
1771
+ function noServerCall$1() {
1772
+ throw Error(
1773
+ "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."
1774
+ );
1775
+ }
1776
+ function createResponseFromOptions(options) {
1777
+ return new ResponseInstance(
1778
+ options.serverConsumerManifest.moduleMap,
1779
+ options.serverConsumerManifest.serverModuleMap,
1780
+ options.serverConsumerManifest.moduleLoading,
1781
+ noServerCall$1,
1782
+ options.encodeFormAction,
1783
+ "string" === typeof options.nonce ? options.nonce : void 0,
1784
+ options && options.temporaryReferences
1785
+ ? options.temporaryReferences
1786
+ : void 0
1787
+ );
1788
+ }
1789
+ function startReadingFromStream(response, stream) {
1790
+ function progress(_ref) {
1791
+ var value = _ref.value;
1792
+ if (_ref.done) close(response);
1793
+ else
1794
+ return (
1795
+ processBinaryChunk(response, value),
1796
+ reader.read().then(progress).catch(error)
1797
+ );
1798
+ }
1799
+ function error(e) {
1800
+ reportGlobalError(response, e);
1801
+ }
1802
+ var reader = stream.getReader();
1803
+ reader.read().then(progress).catch(error);
1804
+ }
1690
1805
  function noServerCall() {
1691
1806
  throw Error(
1692
1807
  "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."
1693
1808
  );
1694
1809
  }
1810
+ exports.createFromFetch = function (promiseForResponse, options) {
1811
+ var response = createResponseFromOptions(options);
1812
+ promiseForResponse.then(
1813
+ function (r) {
1814
+ startReadingFromStream(response, r.body);
1815
+ },
1816
+ function (e) {
1817
+ reportGlobalError(response, e);
1818
+ }
1819
+ );
1820
+ return getChunk(response, 0);
1821
+ };
1695
1822
  exports.createFromNodeStream = function (
1696
1823
  stream,
1697
1824
  serverConsumerManifest,
@@ -1793,101 +1920,50 @@ exports.createFromNodeStream = function (
1793
1920
  response._rowID = rowID;
1794
1921
  response._rowTag = rowTag;
1795
1922
  response._rowLength = rowLength;
1796
- } else {
1797
- rowLength = 0;
1798
- chunkLength = response._rowState;
1799
- rowID = response._rowID;
1800
- i = response._rowTag;
1801
- rowState = response._rowLength;
1802
- buffer = response._buffer;
1803
- for (rowTag = chunk.length; rowLength < rowTag; ) {
1804
- lastIdx = -1;
1805
- switch (chunkLength) {
1806
- case 0:
1807
- lastIdx = chunk[rowLength++];
1808
- 58 === lastIdx
1809
- ? (chunkLength = 1)
1810
- : (rowID =
1811
- (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1812
- continue;
1813
- case 1:
1814
- chunkLength = chunk[rowLength];
1815
- 84 === chunkLength ||
1816
- 65 === chunkLength ||
1817
- 79 === chunkLength ||
1818
- 111 === chunkLength ||
1819
- 85 === chunkLength ||
1820
- 83 === chunkLength ||
1821
- 115 === chunkLength ||
1822
- 76 === chunkLength ||
1823
- 108 === chunkLength ||
1824
- 71 === chunkLength ||
1825
- 103 === chunkLength ||
1826
- 77 === chunkLength ||
1827
- 109 === chunkLength ||
1828
- 86 === chunkLength
1829
- ? ((i = chunkLength), (chunkLength = 2), rowLength++)
1830
- : (64 < chunkLength && 91 > chunkLength) ||
1831
- 35 === chunkLength ||
1832
- 114 === chunkLength ||
1833
- 120 === chunkLength
1834
- ? ((i = chunkLength), (chunkLength = 3), rowLength++)
1835
- : ((i = 0), (chunkLength = 3));
1836
- continue;
1837
- case 2:
1838
- lastIdx = chunk[rowLength++];
1839
- 44 === lastIdx
1840
- ? (chunkLength = 4)
1841
- : (rowState =
1842
- (rowState << 4) |
1843
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1844
- continue;
1845
- case 3:
1846
- lastIdx = chunk.indexOf(10, rowLength);
1847
- break;
1848
- case 4:
1849
- (lastIdx = rowLength + rowState),
1850
- lastIdx > chunk.length && (lastIdx = -1);
1851
- }
1852
- var offset = chunk.byteOffset + rowLength;
1853
- if (-1 < lastIdx)
1854
- (rowState = new Uint8Array(
1855
- chunk.buffer,
1856
- offset,
1857
- lastIdx - rowLength
1858
- )),
1859
- processFullBinaryRow(response, rowID, i, buffer, rowState),
1860
- (rowLength = lastIdx),
1861
- 3 === chunkLength && rowLength++,
1862
- (rowState = rowID = i = chunkLength = 0),
1863
- (buffer.length = 0);
1864
- else {
1865
- chunk = new Uint8Array(
1866
- chunk.buffer,
1867
- offset,
1868
- chunk.byteLength - rowLength
1869
- );
1870
- buffer.push(chunk);
1871
- rowState -= chunk.byteLength;
1872
- break;
1873
- }
1874
- }
1875
- response._rowState = chunkLength;
1876
- response._rowID = rowID;
1877
- response._rowTag = i;
1878
- response._rowLength = rowState;
1879
- }
1923
+ } else processBinaryChunk(response, chunk);
1880
1924
  });
1881
1925
  stream.on("error", function (error) {
1882
1926
  reportGlobalError(response, error);
1883
1927
  });
1884
1928
  stream.on("end", function () {
1885
- reportGlobalError(response, Error("Connection closed."));
1929
+ return close(response);
1886
1930
  });
1887
1931
  return getChunk(response, 0);
1888
1932
  };
1933
+ exports.createFromReadableStream = function (stream, options) {
1934
+ options = createResponseFromOptions(options);
1935
+ startReadingFromStream(options, stream);
1936
+ return getChunk(options, 0);
1937
+ };
1889
1938
  exports.createServerReference = function (id) {
1890
- return createServerReference$1(id, noServerCall);
1939
+ return createServerReference$1(id, noServerCall$1);
1940
+ };
1941
+ exports.createTemporaryReferenceSet = function () {
1942
+ return new Map();
1943
+ };
1944
+ exports.encodeReply = function (value, options) {
1945
+ return new Promise(function (resolve, reject) {
1946
+ var abort = processReply(
1947
+ value,
1948
+ "",
1949
+ options && options.temporaryReferences
1950
+ ? options.temporaryReferences
1951
+ : void 0,
1952
+ resolve,
1953
+ reject
1954
+ );
1955
+ if (options && options.signal) {
1956
+ var signal = options.signal;
1957
+ if (signal.aborted) abort(signal.reason);
1958
+ else {
1959
+ var listener = function () {
1960
+ abort(signal.reason);
1961
+ signal.removeEventListener("abort", listener);
1962
+ };
1963
+ signal.addEventListener("abort", listener);
1964
+ }
1965
+ }
1966
+ });
1891
1967
  };
1892
1968
  exports.registerServerReference = function (reference, id, encodeFormAction) {
1893
1969
  registerBoundServerReference(reference, id, null, encodeFormAction);