react-server-dom-webpack 19.0.0-rc-a960b92c-20240819 → 19.0.0-rc-eb3ad065-20240822

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.
@@ -1025,7 +1025,7 @@
1025
1025
  retryTask(request, task);
1026
1026
  return 1 === task.status
1027
1027
  ? serializeByValueID(task.id)
1028
- : serializeLazyID(task.id);
1028
+ : "$L" + task.id.toString(16);
1029
1029
  }
1030
1030
  function renderElement(request, task, type, key, ref, props) {
1031
1031
  if (null !== ref && void 0 !== ref)
@@ -1093,9 +1093,13 @@
1093
1093
  pingedTasks.push(task);
1094
1094
  1 === pingedTasks.length &&
1095
1095
  ((request.flushScheduled = null !== request.destination),
1096
- scheduleMicrotask(function () {
1097
- return performWork(request);
1098
- }));
1096
+ 21 === request.type
1097
+ ? scheduleMicrotask(function () {
1098
+ return performWork(request);
1099
+ })
1100
+ : setTimeout(function () {
1101
+ return performWork(request);
1102
+ }, 0));
1099
1103
  }
1100
1104
  function createTask(
1101
1105
  request,
@@ -1157,9 +1161,6 @@
1157
1161
  function serializeByValueID(id) {
1158
1162
  return "$" + id.toString(16);
1159
1163
  }
1160
- function serializeLazyID(id) {
1161
- return "$L" + id.toString(16);
1162
- }
1163
1164
  function serializeNumber(number) {
1164
1165
  return Number.isFinite(number)
1165
1166
  ? 0 === number && -Infinity === 1 / number
@@ -1189,7 +1190,7 @@
1189
1190
  existingId = writtenClientReferences.get(clientReferenceKey);
1190
1191
  if (void 0 !== existingId)
1191
1192
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1192
- ? serializeLazyID(existingId)
1193
+ ? "$L" + existingId.toString(16)
1193
1194
  : serializeByValueID(existingId);
1194
1195
  try {
1195
1196
  var config = request.bundlerConfig,
@@ -1221,7 +1222,7 @@
1221
1222
  request.completedImportChunks.push(processedChunk);
1222
1223
  writtenClientReferences.set(clientReferenceKey, importId);
1223
1224
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1224
- ? serializeLazyID(importId)
1225
+ ? "$L" + importId.toString(16)
1225
1226
  : serializeByValueID(importId);
1226
1227
  } catch (x) {
1227
1228
  return (
@@ -1369,6 +1370,12 @@
1369
1370
  null !== parent &&
1370
1371
  (parent.$$typeof === REACT_ELEMENT_TYPE ||
1371
1372
  parent.$$typeof === REACT_LAZY_TYPE);
1373
+ if (11 === request.status)
1374
+ return (
1375
+ (task.status = 3),
1376
+ (task = request.fatalError),
1377
+ parent ? "$L" + task.toString(16) : serializeByValueID(task)
1378
+ );
1372
1379
  key =
1373
1380
  thrownValue === SuspenseException
1374
1381
  ? getSuspendedThenable()
@@ -1377,35 +1384,24 @@
1377
1384
  "object" === typeof key &&
1378
1385
  null !== key &&
1379
1386
  "function" === typeof key.then
1380
- ) {
1381
- if (11 === request.status)
1382
- return (
1383
- (task.status = 3),
1384
- (task = request.fatalError),
1385
- parent ? serializeLazyID(task) : serializeByValueID(task)
1386
- );
1387
- request = createTask(
1388
- request,
1389
- task.model,
1390
- task.keyPath,
1391
- task.implicitSlot,
1392
- request.abortableTasks,
1393
- task.debugOwner
1394
- );
1395
- value = request.ping;
1396
- key.then(value, value);
1397
- request.thenableState = getThenableStateAfterSuspending();
1398
- task.keyPath = prevKeyPath;
1399
- task.implicitSlot = prevImplicitSlot;
1400
- return parent
1401
- ? serializeLazyID(request.id)
1402
- : serializeByValueID(request.id);
1403
- }
1404
- if (11 === request.status)
1387
+ )
1405
1388
  return (
1406
- (task.status = 3),
1407
- (task = request.fatalError),
1408
- parent ? serializeLazyID(task) : serializeByValueID(task)
1389
+ (request = createTask(
1390
+ request,
1391
+ task.model,
1392
+ task.keyPath,
1393
+ task.implicitSlot,
1394
+ request.abortableTasks,
1395
+ task.debugOwner
1396
+ )),
1397
+ (value = request.ping),
1398
+ key.then(value, value),
1399
+ (request.thenableState = getThenableStateAfterSuspending()),
1400
+ (task.keyPath = prevKeyPath),
1401
+ (task.implicitSlot = prevImplicitSlot),
1402
+ parent
1403
+ ? "$L" + request.id.toString(16)
1404
+ : serializeByValueID(request.id)
1409
1405
  );
1410
1406
  task.keyPath = prevKeyPath;
1411
1407
  task.implicitSlot = prevImplicitSlot;
@@ -1414,7 +1410,7 @@
1414
1410
  task = logRecoverableError(request, key, task);
1415
1411
  emitErrorChunk(request, prevKeyPath, task, key);
1416
1412
  return parent
1417
- ? serializeLazyID(prevKeyPath)
1413
+ ? "$L" + prevKeyPath.toString(16)
1418
1414
  : serializeByValueID(prevKeyPath);
1419
1415
  }
1420
1416
  }
@@ -2094,36 +2090,31 @@
2094
2090
  request.abortableTasks.delete(task);
2095
2091
  task.status = 1;
2096
2092
  } catch (thrownValue) {
2097
- var x =
2098
- thrownValue === SuspenseException
2099
- ? getSuspendedThenable()
2100
- : thrownValue;
2101
- if (
2102
- "object" === typeof x &&
2103
- null !== x &&
2104
- "function" === typeof x.then
2105
- )
2106
- if (11 === request.status) {
2107
- request.abortableTasks.delete(task);
2108
- task.status = 3;
2109
- var model = stringify(serializeByValueID(request.fatalError));
2110
- emitModelChunk(request, task.id, model);
2111
- } else {
2093
+ if (11 === request.status) {
2094
+ request.abortableTasks.delete(task);
2095
+ task.status = 3;
2096
+ var model = stringify(serializeByValueID(request.fatalError));
2097
+ emitModelChunk(request, task.id, model);
2098
+ } else {
2099
+ var x =
2100
+ thrownValue === SuspenseException
2101
+ ? getSuspendedThenable()
2102
+ : thrownValue;
2103
+ if (
2104
+ "object" === typeof x &&
2105
+ null !== x &&
2106
+ "function" === typeof x.then
2107
+ ) {
2112
2108
  task.status = 0;
2113
2109
  task.thenableState = getThenableStateAfterSuspending();
2114
2110
  var ping = task.ping;
2115
2111
  x.then(ping, ping);
2112
+ } else {
2113
+ request.abortableTasks.delete(task);
2114
+ task.status = 4;
2115
+ var digest = logRecoverableError(request, x, task);
2116
+ emitErrorChunk(request, task.id, digest, x);
2116
2117
  }
2117
- else if (11 === request.status) {
2118
- request.abortableTasks.delete(task);
2119
- task.status = 3;
2120
- var _model = stringify(serializeByValueID(request.fatalError));
2121
- emitModelChunk(request, task.id, _model);
2122
- } else {
2123
- request.abortableTasks.delete(task);
2124
- task.status = 4;
2125
- var digest = logRecoverableError(request, x, task);
2126
- emitErrorChunk(request, task.id, digest, x);
2127
2118
  }
2128
2119
  } finally {
2129
2120
  debugID = prevDebugID;
@@ -2229,13 +2220,21 @@
2229
2220
  }
2230
2221
  function startWork(request) {
2231
2222
  request.flushScheduled = null !== request.destination;
2232
- supportsRequestStorage
2233
- ? setTimeout(function () {
2234
- return requestStorage.run(request, performWork, request);
2235
- }, 0)
2236
- : setTimeout(function () {
2237
- return performWork(request);
2238
- }, 0);
2223
+ 21 === request.type
2224
+ ? supportsRequestStorage
2225
+ ? scheduleMicrotask(function () {
2226
+ requestStorage.run(request, performWork, request);
2227
+ })
2228
+ : scheduleMicrotask(function () {
2229
+ return performWork(request);
2230
+ })
2231
+ : supportsRequestStorage
2232
+ ? setTimeout(function () {
2233
+ return requestStorage.run(request, performWork, request);
2234
+ }, 0)
2235
+ : setTimeout(function () {
2236
+ return performWork(request);
2237
+ }, 0);
2239
2238
  }
2240
2239
  function enqueueFlush(request) {
2241
2240
  !1 === request.flushScheduled &&
@@ -2253,8 +2252,6 @@
2253
2252
  10 === request.status && (request.status = 11);
2254
2253
  var abortableTasks = request.abortableTasks;
2255
2254
  if (0 < abortableTasks.size) {
2256
- var errorId = request.nextChunkId++;
2257
- request.fatalError = errorId;
2258
2255
  var error =
2259
2256
  void 0 === reason
2260
2257
  ? Error(
@@ -2267,13 +2264,15 @@
2267
2264
  "The render was aborted by the server with a promise."
2268
2265
  )
2269
2266
  : reason,
2270
- digest = logRecoverableError(request, error, null);
2267
+ digest = logRecoverableError(request, error, null),
2268
+ _errorId2 = request.nextChunkId++;
2269
+ request.fatalError = _errorId2;
2271
2270
  request.pendingChunks++;
2272
- emitErrorChunk(request, errorId, digest, error);
2271
+ emitErrorChunk(request, _errorId2, digest, error);
2273
2272
  abortableTasks.forEach(function (task) {
2274
2273
  if (5 !== task.status) {
2275
2274
  task.status = 3;
2276
- var ref = serializeByValueID(errorId);
2275
+ var ref = serializeByValueID(_errorId2);
2277
2276
  task = encodeReferenceChunk(request, task.id, ref);
2278
2277
  request.completedErrorChunks.push(task);
2279
2278
  }
@@ -1123,9 +1123,13 @@ function pingTask(request, task) {
1123
1123
  pingedTasks.push(task);
1124
1124
  1 === pingedTasks.length &&
1125
1125
  ((request.flushScheduled = null !== request.destination),
1126
- scheduleMicrotask(function () {
1127
- return performWork(request);
1128
- }));
1126
+ 21 === request.type
1127
+ ? scheduleMicrotask(function () {
1128
+ return performWork(request);
1129
+ })
1130
+ : setTimeout(function () {
1131
+ return performWork(request);
1132
+ }, 0));
1129
1133
  }
1130
1134
  function createTask(request, model, keyPath, implicitSlot, abortSet) {
1131
1135
  request.pendingChunks++;
@@ -1163,54 +1167,48 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1163
1167
  null !== parentPropertyName &&
1164
1168
  (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
1165
1169
  parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
1166
- (value =
1170
+ 11 === request.status)
1171
+ )
1172
+ (task.status = 3),
1173
+ (prevKeyPath = request.fatalError),
1174
+ (JSCompiler_inline_result = parentPropertyName
1175
+ ? "$L" + prevKeyPath.toString(16)
1176
+ : serializeByValueID(prevKeyPath));
1177
+ else if (
1178
+ ((value =
1167
1179
  thrownValue === SuspenseException
1168
1180
  ? getSuspendedThenable()
1169
1181
  : thrownValue),
1170
1182
  "object" === typeof value &&
1171
1183
  null !== value &&
1172
1184
  "function" === typeof value.then)
1173
- )
1174
- if (11 === request.status)
1175
- (task.status = 3),
1176
- (prevKeyPath = request.fatalError),
1177
- (JSCompiler_inline_result = parentPropertyName
1178
- ? "$L" + prevKeyPath.toString(16)
1179
- : serializeByValueID(prevKeyPath));
1180
- else {
1181
- JSCompiler_inline_result = createTask(
1182
- request,
1183
- task.model,
1184
- task.keyPath,
1185
- task.implicitSlot,
1186
- request.abortableTasks
1187
- );
1188
- var ping = JSCompiler_inline_result.ping;
1189
- value.then(ping, ping);
1190
- JSCompiler_inline_result.thenableState =
1191
- getThenableStateAfterSuspending();
1192
- task.keyPath = prevKeyPath;
1193
- task.implicitSlot = prevImplicitSlot;
1194
- JSCompiler_inline_result = parentPropertyName
1195
- ? "$L" + JSCompiler_inline_result.id.toString(16)
1196
- : serializeByValueID(JSCompiler_inline_result.id);
1197
- }
1198
- else
1199
- 11 === request.status
1200
- ? ((task.status = 3),
1201
- (prevKeyPath = request.fatalError),
1202
- (JSCompiler_inline_result = parentPropertyName
1203
- ? "$L" + prevKeyPath.toString(16)
1204
- : serializeByValueID(prevKeyPath)))
1205
- : ((task.keyPath = prevKeyPath),
1206
- (task.implicitSlot = prevImplicitSlot),
1207
- request.pendingChunks++,
1208
- (prevKeyPath = request.nextChunkId++),
1209
- (prevImplicitSlot = logRecoverableError(request, value, task)),
1210
- emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1211
- (JSCompiler_inline_result = parentPropertyName
1212
- ? "$L" + prevKeyPath.toString(16)
1213
- : serializeByValueID(prevKeyPath)));
1185
+ ) {
1186
+ JSCompiler_inline_result = createTask(
1187
+ request,
1188
+ task.model,
1189
+ task.keyPath,
1190
+ task.implicitSlot,
1191
+ request.abortableTasks
1192
+ );
1193
+ var ping = JSCompiler_inline_result.ping;
1194
+ value.then(ping, ping);
1195
+ JSCompiler_inline_result.thenableState =
1196
+ getThenableStateAfterSuspending();
1197
+ task.keyPath = prevKeyPath;
1198
+ task.implicitSlot = prevImplicitSlot;
1199
+ JSCompiler_inline_result = parentPropertyName
1200
+ ? "$L" + JSCompiler_inline_result.id.toString(16)
1201
+ : serializeByValueID(JSCompiler_inline_result.id);
1202
+ } else
1203
+ (task.keyPath = prevKeyPath),
1204
+ (task.implicitSlot = prevImplicitSlot),
1205
+ request.pendingChunks++,
1206
+ (prevKeyPath = request.nextChunkId++),
1207
+ (prevImplicitSlot = logRecoverableError(request, value, task)),
1208
+ emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1209
+ (JSCompiler_inline_result = parentPropertyName
1210
+ ? "$L" + prevKeyPath.toString(16)
1211
+ : serializeByValueID(prevKeyPath));
1214
1212
  }
1215
1213
  return JSCompiler_inline_result;
1216
1214
  },
@@ -1750,32 +1748,31 @@ function retryTask(request, task) {
1750
1748
  request.abortableTasks.delete(task);
1751
1749
  task.status = 1;
1752
1750
  } catch (thrownValue) {
1753
- var x =
1754
- thrownValue === SuspenseException
1755
- ? getSuspendedThenable()
1756
- : thrownValue;
1757
- if ("object" === typeof x && null !== x && "function" === typeof x.then)
1758
- if (11 === request.status) {
1759
- request.abortableTasks.delete(task);
1760
- task.status = 3;
1761
- var model = stringify(serializeByValueID(request.fatalError));
1762
- emitModelChunk(request, task.id, model);
1763
- } else {
1751
+ if (11 === request.status) {
1752
+ request.abortableTasks.delete(task);
1753
+ task.status = 3;
1754
+ var model = stringify(serializeByValueID(request.fatalError));
1755
+ emitModelChunk(request, task.id, model);
1756
+ } else {
1757
+ var x =
1758
+ thrownValue === SuspenseException
1759
+ ? getSuspendedThenable()
1760
+ : thrownValue;
1761
+ if (
1762
+ "object" === typeof x &&
1763
+ null !== x &&
1764
+ "function" === typeof x.then
1765
+ ) {
1764
1766
  task.status = 0;
1765
1767
  task.thenableState = getThenableStateAfterSuspending();
1766
1768
  var ping = task.ping;
1767
1769
  x.then(ping, ping);
1770
+ } else {
1771
+ request.abortableTasks.delete(task);
1772
+ task.status = 4;
1773
+ var digest = logRecoverableError(request, x, task);
1774
+ emitErrorChunk(request, task.id, digest);
1768
1775
  }
1769
- else if (11 === request.status) {
1770
- request.abortableTasks.delete(task);
1771
- task.status = 3;
1772
- var model$19 = stringify(serializeByValueID(request.fatalError));
1773
- emitModelChunk(request, task.id, model$19);
1774
- } else {
1775
- request.abortableTasks.delete(task);
1776
- task.status = 4;
1777
- var digest = logRecoverableError(request, x, task);
1778
- emitErrorChunk(request, task.id, digest);
1779
1776
  }
1780
1777
  } finally {
1781
1778
  }
@@ -1846,13 +1843,21 @@ function flushCompletedChunks(request, destination) {
1846
1843
  }
1847
1844
  function startWork(request) {
1848
1845
  request.flushScheduled = null !== request.destination;
1849
- supportsRequestStorage
1850
- ? setTimeout(function () {
1851
- return requestStorage.run(request, performWork, request);
1852
- }, 0)
1853
- : setTimeout(function () {
1854
- return performWork(request);
1855
- }, 0);
1846
+ 21 === request.type
1847
+ ? supportsRequestStorage
1848
+ ? scheduleMicrotask(function () {
1849
+ requestStorage.run(request, performWork, request);
1850
+ })
1851
+ : scheduleMicrotask(function () {
1852
+ return performWork(request);
1853
+ })
1854
+ : supportsRequestStorage
1855
+ ? setTimeout(function () {
1856
+ return requestStorage.run(request, performWork, request);
1857
+ }, 0)
1858
+ : setTimeout(function () {
1859
+ return performWork(request);
1860
+ }, 0);
1856
1861
  }
1857
1862
  function enqueueFlush(request) {
1858
1863
  !1 === request.flushScheduled &&
@@ -1870,8 +1875,6 @@ function abort(request, reason) {
1870
1875
  10 === request.status && (request.status = 11);
1871
1876
  var abortableTasks = request.abortableTasks;
1872
1877
  if (0 < abortableTasks.size) {
1873
- var errorId = request.nextChunkId++;
1874
- request.fatalError = errorId;
1875
1878
  var error =
1876
1879
  void 0 === reason
1877
1880
  ? Error("The render was aborted by the server without a reason.")
@@ -1880,7 +1883,9 @@ function abort(request, reason) {
1880
1883
  "function" === typeof reason.then
1881
1884
  ? Error("The render was aborted by the server with a promise.")
1882
1885
  : reason,
1883
- digest = logRecoverableError(request, error, null);
1886
+ digest = logRecoverableError(request, error, null),
1887
+ errorId = request.nextChunkId++;
1888
+ request.fatalError = errorId;
1884
1889
  request.pendingChunks++;
1885
1890
  emitErrorChunk(request, errorId, digest, error);
1886
1891
  abortableTasks.forEach(function (task) {
@@ -1897,7 +1902,7 @@ function abort(request, reason) {
1897
1902
  }
1898
1903
  var abortListeners = request.abortListeners;
1899
1904
  if (0 < abortListeners.size) {
1900
- var error$26 =
1905
+ var error$23 =
1901
1906
  void 0 === reason
1902
1907
  ? Error("The render was aborted by the server without a reason.")
1903
1908
  : "object" === typeof reason &&
@@ -1906,14 +1911,14 @@ function abort(request, reason) {
1906
1911
  ? Error("The render was aborted by the server with a promise.")
1907
1912
  : reason;
1908
1913
  abortListeners.forEach(function (callback) {
1909
- return callback(error$26);
1914
+ return callback(error$23);
1910
1915
  });
1911
1916
  abortListeners.clear();
1912
1917
  }
1913
1918
  null !== request.destination &&
1914
1919
  flushCompletedChunks(request, request.destination);
1915
- } catch (error$27) {
1916
- logRecoverableError(request, error$27, null), fatalError(request, error$27);
1920
+ } catch (error$24) {
1921
+ logRecoverableError(request, error$24, null), fatalError(request, error$24);
1917
1922
  }
1918
1923
  }
1919
1924
  function resolveServerReference(bundlerConfig, id) {
@@ -2356,8 +2361,8 @@ function parseReadableStream(response, reference, type) {
2356
2361
  (previousBlockedChunk = chunk));
2357
2362
  } else {
2358
2363
  chunk = previousBlockedChunk;
2359
- var chunk$30 = createPendingChunk(response);
2360
- chunk$30.then(
2364
+ var chunk$27 = createPendingChunk(response);
2365
+ chunk$27.then(
2361
2366
  function (v) {
2362
2367
  return controller.enqueue(v);
2363
2368
  },
@@ -2365,10 +2370,10 @@ function parseReadableStream(response, reference, type) {
2365
2370
  return controller.error(e);
2366
2371
  }
2367
2372
  );
2368
- previousBlockedChunk = chunk$30;
2373
+ previousBlockedChunk = chunk$27;
2369
2374
  chunk.then(function () {
2370
- previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
2371
- resolveModelChunk(chunk$30, json, -1);
2375
+ previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
2376
+ resolveModelChunk(chunk$27, json, -1);
2372
2377
  });
2373
2378
  }
2374
2379
  },