react-server-dom-webpack 19.2.0-canary-5d87cd22-20250704 → 19.2.0-canary-befc1246-20250708

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.
@@ -880,7 +880,7 @@
880
880
  "\n//# sourceURL=rsc://React/" +
881
881
  encodeURIComponent(environmentName) +
882
882
  "/" +
883
- filename +
883
+ encodeURI(filename) +
884
884
  "?s" +
885
885
  fakeServerFunctionIdx++),
886
886
  (col += "\n//# sourceMappingURL=" + sourceMap))
@@ -1126,6 +1126,17 @@
1126
1126
  this.reason = reason;
1127
1127
  this._debugInfo = null;
1128
1128
  }
1129
+ function unwrapWeakResponse(weakResponse) {
1130
+ weakResponse = weakResponse.weak.deref();
1131
+ if (void 0 === weakResponse)
1132
+ throw Error(
1133
+ "We did not expect to receive new data after GC:ing the response."
1134
+ );
1135
+ return weakResponse;
1136
+ }
1137
+ function cleanupDebugChannel(debugChannel) {
1138
+ debugChannel("");
1139
+ }
1129
1140
  function readChunk(chunk) {
1130
1141
  switch (chunk.status) {
1131
1142
  case "resolved_model":
@@ -1145,9 +1156,27 @@
1145
1156
  throw chunk.reason;
1146
1157
  }
1147
1158
  }
1148
- function createPendingChunk() {
1159
+ function getRoot(weakResponse) {
1160
+ weakResponse = unwrapWeakResponse(weakResponse);
1161
+ return getChunk(weakResponse, 0);
1162
+ }
1163
+ function createPendingChunk(response) {
1164
+ 0 === response._pendingChunks++ &&
1165
+ ((response._weakResponse.response = response),
1166
+ null !== response._pendingInitialRender &&
1167
+ (clearTimeout(response._pendingInitialRender),
1168
+ (response._pendingInitialRender = null)));
1149
1169
  return new ReactPromise("pending", null, null);
1150
1170
  }
1171
+ function releasePendingChunk(response, chunk) {
1172
+ "pending" === chunk.status &&
1173
+ 0 === --response._pendingChunks &&
1174
+ ((response._weakResponse.response = null),
1175
+ (response._pendingInitialRender = setTimeout(
1176
+ flushInitialRenderPerformance.bind(null, response),
1177
+ 100
1178
+ )));
1179
+ }
1151
1180
  function wakeChunk(listeners, value) {
1152
1181
  for (var i = 0; i < listeners.length; i++) {
1153
1182
  var listener = listeners[i];
@@ -1223,15 +1252,14 @@
1223
1252
  rejectListeners && rejectChunk(rejectListeners, chunk.reason);
1224
1253
  }
1225
1254
  }
1226
- function triggerErrorOnChunk(chunk, error) {
1227
- if ("pending" !== chunk.status && "blocked" !== chunk.status)
1228
- chunk.reason.error(error);
1229
- else {
1230
- var listeners = chunk.reason;
1231
- chunk.status = "rejected";
1232
- chunk.reason = error;
1233
- null !== listeners && rejectChunk(listeners, error);
1234
- }
1255
+ function triggerErrorOnChunk(response, chunk, error) {
1256
+ "pending" !== chunk.status && "blocked" !== chunk.status
1257
+ ? chunk.reason.error(error)
1258
+ : (releasePendingChunk(response, chunk),
1259
+ (response = chunk.reason),
1260
+ (chunk.status = "rejected"),
1261
+ (chunk.reason = error),
1262
+ null !== response && rejectChunk(response, error));
1235
1263
  }
1236
1264
  function createResolvedIteratorResultChunk(response, value, done) {
1237
1265
  return new ReactPromise(
@@ -1254,6 +1282,7 @@
1254
1282
  function resolveModelChunk(response, chunk, value) {
1255
1283
  if ("pending" !== chunk.status) chunk.reason.enqueueModel(value);
1256
1284
  else {
1285
+ releasePendingChunk(response, chunk);
1257
1286
  var resolveListeners = chunk.value,
1258
1287
  rejectListeners = chunk.reason;
1259
1288
  chunk.status = "resolved_model";
@@ -1264,15 +1293,16 @@
1264
1293
  wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
1265
1294
  }
1266
1295
  }
1267
- function resolveModuleChunk(chunk, value) {
1296
+ function resolveModuleChunk(response, chunk, value) {
1268
1297
  if ("pending" === chunk.status || "blocked" === chunk.status) {
1269
- var resolveListeners = chunk.value,
1270
- rejectListeners = chunk.reason;
1298
+ releasePendingChunk(response, chunk);
1299
+ response = chunk.value;
1300
+ var rejectListeners = chunk.reason;
1271
1301
  chunk.status = "resolved_module";
1272
1302
  chunk.value = value;
1273
- null !== resolveListeners &&
1303
+ null !== response &&
1274
1304
  (initializeModuleChunk(chunk),
1275
- wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
1305
+ wakeChunkIfInitialized(chunk, response, rejectListeners));
1276
1306
  }
1277
1307
  }
1278
1308
  function initializeModelChunk(chunk) {
@@ -1315,15 +1345,19 @@
1315
1345
  (chunk.status = "rejected"), (chunk.reason = error);
1316
1346
  }
1317
1347
  }
1318
- function reportGlobalError(response, error) {
1319
- response._closed = !0;
1320
- response._closedReason = error;
1321
- response._chunks.forEach(function (chunk) {
1322
- "pending" === chunk.status && triggerErrorOnChunk(chunk, error);
1323
- });
1324
- var debugChannel = response._debugChannel;
1325
- void 0 !== debugChannel &&
1326
- (debugChannel(""), (response._debugChannel = void 0));
1348
+ function reportGlobalError(weakResponse, error) {
1349
+ if (void 0 !== weakResponse.weak.deref()) {
1350
+ var response = unwrapWeakResponse(weakResponse);
1351
+ response._closed = !0;
1352
+ response._closedReason = error;
1353
+ response._chunks.forEach(function (chunk) {
1354
+ "pending" === chunk.status &&
1355
+ triggerErrorOnChunk(response, chunk, error);
1356
+ });
1357
+ weakResponse = response._debugChannel;
1358
+ void 0 !== weakResponse &&
1359
+ (weakResponse(""), (response._debugChannel = void 0));
1360
+ }
1327
1361
  }
1328
1362
  function nullRefGetter() {
1329
1363
  return null;
@@ -1399,7 +1433,7 @@
1399
1433
  chunk ||
1400
1434
  ((chunk = response._closed
1401
1435
  ? new ReactPromise("rejected", null, response._closedReason)
1402
- : createPendingChunk()),
1436
+ : createPendingChunk(response)),
1403
1437
  chunks.set(id, chunk));
1404
1438
  return chunk;
1405
1439
  }
@@ -1485,31 +1519,31 @@
1485
1519
  }
1486
1520
  function rejectReference(reference, error) {
1487
1521
  var handler = reference.handler;
1488
- if (
1489
- !handler.errored &&
1490
- ((reference = handler.value),
1491
- (handler.errored = !0),
1492
- (handler.value = error),
1493
- (handler = handler.chunk),
1494
- null !== handler && "blocked" === handler.status)
1495
- ) {
1496
- if (
1497
- "object" === typeof reference &&
1498
- null !== reference &&
1499
- reference.$$typeof === REACT_ELEMENT_TYPE
1500
- ) {
1501
- var erroredComponent = {
1502
- name: getComponentNameFromType(reference.type) || "",
1503
- owner: reference._owner
1504
- };
1505
- erroredComponent.debugStack = reference._debugStack;
1506
- supportsCreateTask &&
1507
- (erroredComponent.debugTask = reference._debugTask);
1508
- (handler._debugInfo || (handler._debugInfo = [])).push(
1509
- erroredComponent
1510
- );
1522
+ reference = reference.response;
1523
+ if (!handler.errored) {
1524
+ var blockedValue = handler.value;
1525
+ handler.errored = !0;
1526
+ handler.value = error;
1527
+ handler = handler.chunk;
1528
+ if (null !== handler && "blocked" === handler.status) {
1529
+ if (
1530
+ "object" === typeof blockedValue &&
1531
+ null !== blockedValue &&
1532
+ blockedValue.$$typeof === REACT_ELEMENT_TYPE
1533
+ ) {
1534
+ var erroredComponent = {
1535
+ name: getComponentNameFromType(blockedValue.type) || "",
1536
+ owner: blockedValue._owner
1537
+ };
1538
+ erroredComponent.debugStack = blockedValue._debugStack;
1539
+ supportsCreateTask &&
1540
+ (erroredComponent.debugTask = blockedValue._debugTask);
1541
+ (handler._debugInfo || (handler._debugInfo = [])).push(
1542
+ erroredComponent
1543
+ );
1544
+ }
1545
+ triggerErrorOnChunk(reference, handler, error);
1511
1546
  }
1512
- triggerErrorOnChunk(handler, error);
1513
1547
  }
1514
1548
  }
1515
1549
  function waitForReference(
@@ -1649,7 +1683,7 @@
1649
1683
  erroredComponent
1650
1684
  );
1651
1685
  }
1652
- triggerErrorOnChunk(chunk, error);
1686
+ triggerErrorOnChunk(response, chunk, error);
1653
1687
  }
1654
1688
  }
1655
1689
  }
@@ -1796,6 +1830,23 @@
1796
1830
  function applyConstructor(response, model, parentObject) {
1797
1831
  Object.setPrototypeOf(parentObject, model.prototype);
1798
1832
  }
1833
+ function defineLazyGetter(response, chunk, parentObject, key) {
1834
+ Object.defineProperty(parentObject, key, {
1835
+ get: function () {
1836
+ "resolved_model" === chunk.status && initializeModelChunk(chunk);
1837
+ switch (chunk.status) {
1838
+ case "fulfilled":
1839
+ return chunk.value;
1840
+ case "rejected":
1841
+ throw chunk.reason;
1842
+ }
1843
+ return "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.";
1844
+ },
1845
+ enumerable: !0,
1846
+ configurable: !1
1847
+ });
1848
+ return null;
1849
+ }
1799
1850
  function extractIterator(response, model) {
1800
1851
  return model[Symbol.iterator]();
1801
1852
  }
@@ -1834,15 +1885,13 @@
1834
1885
  case "S":
1835
1886
  return Symbol.for(value.slice(2));
1836
1887
  case "F":
1837
- return (
1838
- (value = value.slice(2)),
1839
- getOutlinedModel(
1840
- response,
1841
- value,
1842
- parentObject,
1843
- key,
1844
- loadServerReference
1845
- )
1888
+ var ref = value.slice(2);
1889
+ return getOutlinedModel(
1890
+ response,
1891
+ ref,
1892
+ parentObject,
1893
+ key,
1894
+ loadServerReference
1846
1895
  );
1847
1896
  case "T":
1848
1897
  parentObject = "$" + value.slice(2);
@@ -1854,36 +1903,30 @@
1854
1903
  return response.get(parentObject);
1855
1904
  case "Q":
1856
1905
  return (
1857
- (value = value.slice(2)),
1858
- getOutlinedModel(response, value, parentObject, key, createMap)
1906
+ (ref = value.slice(2)),
1907
+ getOutlinedModel(response, ref, parentObject, key, createMap)
1859
1908
  );
1860
1909
  case "W":
1861
1910
  return (
1862
- (value = value.slice(2)),
1863
- getOutlinedModel(response, value, parentObject, key, createSet)
1911
+ (ref = value.slice(2)),
1912
+ getOutlinedModel(response, ref, parentObject, key, createSet)
1864
1913
  );
1865
1914
  case "B":
1866
1915
  return (
1867
- (value = value.slice(2)),
1868
- getOutlinedModel(response, value, parentObject, key, createBlob)
1916
+ (ref = value.slice(2)),
1917
+ getOutlinedModel(response, ref, parentObject, key, createBlob)
1869
1918
  );
1870
1919
  case "K":
1871
1920
  return (
1872
- (value = value.slice(2)),
1873
- getOutlinedModel(
1874
- response,
1875
- value,
1876
- parentObject,
1877
- key,
1878
- createFormData
1879
- )
1921
+ (ref = value.slice(2)),
1922
+ getOutlinedModel(response, ref, parentObject, key, createFormData)
1880
1923
  );
1881
1924
  case "Z":
1882
1925
  return (
1883
- (value = value.slice(2)),
1926
+ (ref = value.slice(2)),
1884
1927
  getOutlinedModel(
1885
1928
  response,
1886
- value,
1929
+ ref,
1887
1930
  parentObject,
1888
1931
  key,
1889
1932
  resolveErrorDev
@@ -1891,10 +1934,10 @@
1891
1934
  );
1892
1935
  case "i":
1893
1936
  return (
1894
- (value = value.slice(2)),
1937
+ (ref = value.slice(2)),
1895
1938
  getOutlinedModel(
1896
1939
  response,
1897
- value,
1940
+ ref,
1898
1941
  parentObject,
1899
1942
  key,
1900
1943
  extractIterator
@@ -1914,10 +1957,10 @@
1914
1957
  return BigInt(value.slice(2));
1915
1958
  case "P":
1916
1959
  return (
1917
- (value = value.slice(2)),
1960
+ (ref = value.slice(2)),
1918
1961
  getOutlinedModel(
1919
1962
  response,
1920
- value,
1963
+ ref,
1921
1964
  parentObject,
1922
1965
  key,
1923
1966
  applyConstructor
@@ -1963,23 +2006,27 @@
1963
2006
  return function () {};
1964
2007
  }
1965
2008
  case "Y":
1966
- return (
1967
- 2 < value.length &&
1968
- (response = response._debugChannel) &&
1969
- ((value = value.slice(2)), response("R:" + value)),
1970
- Object.defineProperty(parentObject, key, {
1971
- get: function () {
1972
- return "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.";
1973
- },
1974
- enumerable: !0,
1975
- configurable: !1
1976
- }),
1977
- null
1978
- );
2009
+ if (2 < value.length && (ref = response._debugChannel)) {
2010
+ value = value.slice(2);
2011
+ var _id2 = parseInt(value, 16);
2012
+ response._chunks.has(_id2) || ref("Q:" + value);
2013
+ ref = getChunk(response, _id2);
2014
+ return "fulfilled" === ref.status
2015
+ ? ref.value
2016
+ : defineLazyGetter(response, ref, parentObject, key);
2017
+ }
2018
+ Object.defineProperty(parentObject, key, {
2019
+ get: function () {
2020
+ return "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.";
2021
+ },
2022
+ enumerable: !0,
2023
+ configurable: !1
2024
+ });
2025
+ return null;
1979
2026
  default:
1980
2027
  return (
1981
- (value = value.slice(1)),
1982
- getOutlinedModel(response, value, parentObject, key, createModel)
2028
+ (ref = value.slice(1)),
2029
+ getOutlinedModel(response, ref, parentObject, key, createModel)
1983
2030
  );
1984
2031
  }
1985
2032
  }
@@ -2018,6 +2065,8 @@
2018
2065
  this._closed = !1;
2019
2066
  this._closedReason = null;
2020
2067
  this._tempRefs = temporaryReferences;
2068
+ this._pendingChunks = 0;
2069
+ this._weakResponse = { weak: new WeakRef(this), response: this };
2021
2070
  this._debugRootOwner = bundlerConfig =
2022
2071
  void 0 === ReactSharedInteralsServer ||
2023
2072
  null === ReactSharedInteralsServer.A
@@ -2034,17 +2083,22 @@
2034
2083
  this._debugChannel = debugChannel;
2035
2084
  this._replayConsole = replayConsole;
2036
2085
  this._rootEnvironmentName = environmentName;
2086
+ debugChannel &&
2087
+ (null === debugChannelRegistry
2088
+ ? (debugChannel(""), (this._debugChannel = void 0))
2089
+ : debugChannelRegistry.register(this, debugChannel));
2037
2090
  this._fromJSON = createFromJSONCallback(this);
2038
2091
  }
2039
2092
  function resolveDebugHalt(response, id) {
2040
- response = response._chunks;
2041
- var chunk = response.get(id);
2042
- chunk || response.set(id, (chunk = createPendingChunk()));
2093
+ var chunks = response._chunks,
2094
+ chunk = chunks.get(id);
2095
+ chunk || chunks.set(id, (chunk = createPendingChunk(response)));
2043
2096
  if ("pending" === chunk.status || "blocked" === chunk.status)
2044
- (id = chunk),
2045
- (id.status = "halted"),
2046
- (id.value = null),
2047
- (id.reason = null);
2097
+ releasePendingChunk(response, chunk),
2098
+ (response = chunk),
2099
+ (response.status = "halted"),
2100
+ (response.value = null),
2101
+ (response.reason = null);
2048
2102
  }
2049
2103
  function resolveModel(response, id, model) {
2050
2104
  var chunks = response._chunks,
@@ -2054,18 +2108,20 @@
2054
2108
  : chunks.set(id, new ReactPromise("resolved_model", model, response));
2055
2109
  }
2056
2110
  function resolveText(response, id, text) {
2057
- response = response._chunks;
2058
- var chunk = response.get(id);
2111
+ var chunks = response._chunks,
2112
+ chunk = chunks.get(id);
2059
2113
  chunk && "pending" !== chunk.status
2060
2114
  ? chunk.reason.enqueueValue(text)
2061
- : response.set(id, new ReactPromise("fulfilled", text, null));
2115
+ : (chunk && releasePendingChunk(response, chunk),
2116
+ chunks.set(id, new ReactPromise("fulfilled", text, null)));
2062
2117
  }
2063
2118
  function resolveBuffer(response, id, buffer) {
2064
- response = response._chunks;
2065
- var chunk = response.get(id);
2119
+ var chunks = response._chunks,
2120
+ chunk = chunks.get(id);
2066
2121
  chunk && "pending" !== chunk.status
2067
2122
  ? chunk.reason.enqueueValue(buffer)
2068
- : response.set(id, new ReactPromise("fulfilled", buffer, null));
2123
+ : (chunk && releasePendingChunk(response, chunk),
2124
+ chunks.set(id, new ReactPromise("fulfilled", buffer, null)));
2069
2125
  }
2070
2126
  function resolveModule(response, id, model) {
2071
2127
  var chunks = response._chunks,
@@ -2080,39 +2136,41 @@
2080
2136
  model[1],
2081
2137
  response._nonce
2082
2138
  );
2083
- if ((response = preloadModule(clientReference))) {
2139
+ if ((model = preloadModule(clientReference))) {
2084
2140
  if (chunk) {
2141
+ releasePendingChunk(response, chunk);
2085
2142
  var blockedChunk = chunk;
2086
2143
  blockedChunk.status = "blocked";
2087
2144
  } else
2088
2145
  (blockedChunk = new ReactPromise("blocked", null, null)),
2089
2146
  chunks.set(id, blockedChunk);
2090
- response.then(
2147
+ model.then(
2091
2148
  function () {
2092
- return resolveModuleChunk(blockedChunk, clientReference);
2149
+ return resolveModuleChunk(response, blockedChunk, clientReference);
2093
2150
  },
2094
2151
  function (error) {
2095
- return triggerErrorOnChunk(blockedChunk, error);
2152
+ return triggerErrorOnChunk(response, blockedChunk, error);
2096
2153
  }
2097
2154
  );
2098
2155
  } else
2099
2156
  chunk
2100
- ? resolveModuleChunk(chunk, clientReference)
2157
+ ? resolveModuleChunk(response, chunk, clientReference)
2101
2158
  : chunks.set(
2102
2159
  id,
2103
2160
  new ReactPromise("resolved_module", clientReference, null)
2104
2161
  );
2105
2162
  }
2106
2163
  function resolveStream(response, id, stream, controller) {
2107
- var chunks = response._chunks;
2108
- response = chunks.get(id);
2109
- response
2110
- ? "pending" === response.status &&
2111
- ((id = response.value),
2112
- (response.status = "fulfilled"),
2113
- (response.value = stream),
2114
- (response.reason = controller),
2115
- null !== id && wakeChunk(id, response.value))
2164
+ var chunks = response._chunks,
2165
+ chunk = chunks.get(id);
2166
+ chunk
2167
+ ? "pending" === chunk.status &&
2168
+ (releasePendingChunk(response, chunk),
2169
+ (response = chunk.value),
2170
+ (chunk.status = "fulfilled"),
2171
+ (chunk.value = stream),
2172
+ (chunk.reason = controller),
2173
+ null !== response && wakeChunk(response, chunk.value))
2116
2174
  : chunks.set(id, new ReactPromise("fulfilled", stream, controller));
2117
2175
  }
2118
2176
  function startReadableStream(response, id, type) {
@@ -2149,8 +2207,8 @@
2149
2207
  (previousBlockedChunk = chunk));
2150
2208
  } else {
2151
2209
  chunk = previousBlockedChunk;
2152
- var _chunk2 = createPendingChunk();
2153
- _chunk2.then(
2210
+ var _chunk3 = createPendingChunk(response);
2211
+ _chunk3.then(
2154
2212
  function (v) {
2155
2213
  return controller.enqueue(v);
2156
2214
  },
@@ -2158,10 +2216,10 @@
2158
2216
  return controller.error(e);
2159
2217
  }
2160
2218
  );
2161
- previousBlockedChunk = _chunk2;
2219
+ previousBlockedChunk = _chunk3;
2162
2220
  chunk.then(function () {
2163
- previousBlockedChunk === _chunk2 && (previousBlockedChunk = null);
2164
- resolveModelChunk(response, _chunk2, json);
2221
+ previousBlockedChunk === _chunk3 && (previousBlockedChunk = null);
2222
+ resolveModelChunk(response, _chunk3, json);
2165
2223
  });
2166
2224
  }
2167
2225
  },
@@ -2214,7 +2272,7 @@
2214
2272
  { done: !0, value: void 0 },
2215
2273
  null
2216
2274
  );
2217
- buffer[nextReadIndex] = createPendingChunk();
2275
+ buffer[nextReadIndex] = createPendingChunk(response);
2218
2276
  }
2219
2277
  return buffer[nextReadIndex++];
2220
2278
  });
@@ -2287,11 +2345,11 @@
2287
2345
  closed = !0;
2288
2346
  for (
2289
2347
  nextWriteIndex === buffer.length &&
2290
- (buffer[nextWriteIndex] = createPendingChunk());
2348
+ (buffer[nextWriteIndex] = createPendingChunk(response));
2291
2349
  nextWriteIndex < buffer.length;
2292
2350
 
2293
2351
  )
2294
- triggerErrorOnChunk(buffer[nextWriteIndex++], error);
2352
+ triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);
2295
2353
  }
2296
2354
  }
2297
2355
  );
@@ -2696,6 +2754,7 @@
2696
2754
  );
2697
2755
  resolveBuffer(response, id, constructor);
2698
2756
  }
2757
+ function flushInitialRenderPerformance() {}
2699
2758
  function processFullBinaryRow(response, id, tag, buffer, chunk) {
2700
2759
  switch (tag) {
2701
2760
  case 65:
@@ -2766,7 +2825,7 @@
2766
2825
  row = response._chunks;
2767
2826
  var chunk = row.get(id);
2768
2827
  chunk
2769
- ? triggerErrorOnChunk(chunk, tag)
2828
+ ? triggerErrorOnChunk(response, chunk, tag)
2770
2829
  : row.set(id, new ReactPromise("rejected", null, tag));
2771
2830
  break;
2772
2831
  case 84:
@@ -2910,96 +2969,99 @@
2910
2969
  options ? !0 === options.replayConsoleLogs : !1,
2911
2970
  options && options.environmentName ? options.environmentName : void 0,
2912
2971
  void 0
2913
- );
2972
+ )._weakResponse;
2914
2973
  }
2915
2974
  function startReadingFromStream(response, stream) {
2916
2975
  function progress(_ref) {
2917
2976
  var value = _ref.value;
2918
2977
  if (_ref.done) reportGlobalError(response, Error("Connection closed."));
2919
2978
  else {
2920
- var i = 0,
2921
- rowState = response._rowState;
2922
- _ref = response._rowID;
2923
- for (
2924
- var rowTag = response._rowTag,
2925
- rowLength = response._rowLength,
2926
- buffer = response._buffer,
2927
- chunkLength = value.length;
2928
- i < chunkLength;
2979
+ if (void 0 !== response.weak.deref()) {
2980
+ _ref = unwrapWeakResponse(response);
2981
+ for (
2982
+ var i = 0,
2983
+ rowState = _ref._rowState,
2984
+ rowID = _ref._rowID,
2985
+ rowTag = _ref._rowTag,
2986
+ rowLength = _ref._rowLength,
2987
+ buffer = _ref._buffer,
2988
+ chunkLength = value.length;
2989
+ i < chunkLength;
2929
2990
 
2930
- ) {
2931
- var lastIdx = -1;
2932
- switch (rowState) {
2933
- case 0:
2934
- lastIdx = value[i++];
2935
- 58 === lastIdx
2936
- ? (rowState = 1)
2937
- : (_ref =
2938
- (_ref << 4) |
2939
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2940
- continue;
2941
- case 1:
2942
- rowState = value[i];
2943
- 84 === rowState ||
2944
- 65 === rowState ||
2945
- 79 === rowState ||
2946
- 111 === rowState ||
2947
- 85 === rowState ||
2948
- 83 === rowState ||
2949
- 115 === rowState ||
2950
- 76 === rowState ||
2951
- 108 === rowState ||
2952
- 71 === rowState ||
2953
- 103 === rowState ||
2954
- 77 === rowState ||
2955
- 109 === rowState ||
2956
- 86 === rowState
2957
- ? ((rowTag = rowState), (rowState = 2), i++)
2958
- : (64 < rowState && 91 > rowState) ||
2959
- 35 === rowState ||
2960
- 114 === rowState ||
2961
- 120 === rowState
2962
- ? ((rowTag = rowState), (rowState = 3), i++)
2963
- : ((rowTag = 0), (rowState = 3));
2964
- continue;
2965
- case 2:
2966
- lastIdx = value[i++];
2967
- 44 === lastIdx
2968
- ? (rowState = 4)
2969
- : (rowLength =
2970
- (rowLength << 4) |
2971
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2972
- continue;
2973
- case 3:
2974
- lastIdx = value.indexOf(10, i);
2991
+ ) {
2992
+ var lastIdx = -1;
2993
+ switch (rowState) {
2994
+ case 0:
2995
+ lastIdx = value[i++];
2996
+ 58 === lastIdx
2997
+ ? (rowState = 1)
2998
+ : (rowID =
2999
+ (rowID << 4) |
3000
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
3001
+ continue;
3002
+ case 1:
3003
+ rowState = value[i];
3004
+ 84 === rowState ||
3005
+ 65 === rowState ||
3006
+ 79 === rowState ||
3007
+ 111 === rowState ||
3008
+ 85 === rowState ||
3009
+ 83 === rowState ||
3010
+ 115 === rowState ||
3011
+ 76 === rowState ||
3012
+ 108 === rowState ||
3013
+ 71 === rowState ||
3014
+ 103 === rowState ||
3015
+ 77 === rowState ||
3016
+ 109 === rowState ||
3017
+ 86 === rowState
3018
+ ? ((rowTag = rowState), (rowState = 2), i++)
3019
+ : (64 < rowState && 91 > rowState) ||
3020
+ 35 === rowState ||
3021
+ 114 === rowState ||
3022
+ 120 === rowState
3023
+ ? ((rowTag = rowState), (rowState = 3), i++)
3024
+ : ((rowTag = 0), (rowState = 3));
3025
+ continue;
3026
+ case 2:
3027
+ lastIdx = value[i++];
3028
+ 44 === lastIdx
3029
+ ? (rowState = 4)
3030
+ : (rowLength =
3031
+ (rowLength << 4) |
3032
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
3033
+ continue;
3034
+ case 3:
3035
+ lastIdx = value.indexOf(10, i);
3036
+ break;
3037
+ case 4:
3038
+ (lastIdx = i + rowLength),
3039
+ lastIdx > value.length && (lastIdx = -1);
3040
+ }
3041
+ var offset = value.byteOffset + i;
3042
+ if (-1 < lastIdx)
3043
+ (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),
3044
+ processFullBinaryRow(_ref, rowID, rowTag, buffer, rowLength),
3045
+ (i = lastIdx),
3046
+ 3 === rowState && i++,
3047
+ (rowLength = rowID = rowTag = rowState = 0),
3048
+ (buffer.length = 0);
3049
+ else {
3050
+ value = new Uint8Array(
3051
+ value.buffer,
3052
+ offset,
3053
+ value.byteLength - i
3054
+ );
3055
+ buffer.push(value);
3056
+ rowLength -= value.byteLength;
2975
3057
  break;
2976
- case 4:
2977
- (lastIdx = i + rowLength),
2978
- lastIdx > value.length && (lastIdx = -1);
2979
- }
2980
- var offset = value.byteOffset + i;
2981
- if (-1 < lastIdx)
2982
- (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),
2983
- processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),
2984
- (i = lastIdx),
2985
- 3 === rowState && i++,
2986
- (rowLength = _ref = rowTag = rowState = 0),
2987
- (buffer.length = 0);
2988
- else {
2989
- value = new Uint8Array(
2990
- value.buffer,
2991
- offset,
2992
- value.byteLength - i
2993
- );
2994
- buffer.push(value);
2995
- rowLength -= value.byteLength;
2996
- break;
3058
+ }
2997
3059
  }
3060
+ _ref._rowState = rowState;
3061
+ _ref._rowID = rowID;
3062
+ _ref._rowTag = rowTag;
3063
+ _ref._rowLength = rowLength;
2998
3064
  }
2999
- response._rowState = rowState;
3000
- response._rowID = _ref;
3001
- response._rowTag = rowTag;
3002
- response._rowLength = rowLength;
3003
3065
  return reader.read().then(progress).catch(error);
3004
3066
  }
3005
3067
  }
@@ -3082,7 +3144,11 @@
3082
3144
  "function" === typeof reject && reject(this.reason);
3083
3145
  }
3084
3146
  };
3085
- var initializingHandler = null,
3147
+ var debugChannelRegistry =
3148
+ "function" === typeof FinalizationRegistry
3149
+ ? new FinalizationRegistry(cleanupDebugChannel)
3150
+ : null,
3151
+ initializingHandler = null,
3086
3152
  supportsCreateTask = !!console.createTask,
3087
3153
  fakeFunctionCache = new Map(),
3088
3154
  fakeFunctionIdx = 0,
@@ -3191,12 +3257,12 @@
3191
3257
  reportGlobalError(response, e);
3192
3258
  }
3193
3259
  );
3194
- return getChunk(response, 0);
3260
+ return getRoot(response);
3195
3261
  };
3196
3262
  exports.createFromReadableStream = function (stream, options) {
3197
3263
  options = createResponseFromOptions(options);
3198
3264
  startReadingFromStream(options, stream);
3199
- return getChunk(options, 0);
3265
+ return getRoot(options);
3200
3266
  };
3201
3267
  exports.createServerReference = function (id) {
3202
3268
  return createServerReference$1(id, noServerCall);