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.
@@ -1013,7 +1013,7 @@
1013
1013
  retryTask(request, task);
1014
1014
  return 1 === task.status
1015
1015
  ? serializeByValueID(task.id)
1016
- : serializeLazyID(task.id);
1016
+ : "$L" + task.id.toString(16);
1017
1017
  }
1018
1018
  function renderElement(request, task, type, key, ref, props) {
1019
1019
  if (null !== ref && void 0 !== ref)
@@ -1081,9 +1081,13 @@
1081
1081
  pingedTasks.push(task);
1082
1082
  1 === pingedTasks.length &&
1083
1083
  ((request.flushScheduled = null !== request.destination),
1084
- scheduleMicrotask(function () {
1085
- return performWork(request);
1086
- }));
1084
+ 21 === request.type
1085
+ ? scheduleMicrotask(function () {
1086
+ return performWork(request);
1087
+ })
1088
+ : scheduleWork(function () {
1089
+ return performWork(request);
1090
+ }));
1087
1091
  }
1088
1092
  function createTask(
1089
1093
  request,
@@ -1145,9 +1149,6 @@
1145
1149
  function serializeByValueID(id) {
1146
1150
  return "$" + id.toString(16);
1147
1151
  }
1148
- function serializeLazyID(id) {
1149
- return "$L" + id.toString(16);
1150
- }
1151
1152
  function serializeNumber(number) {
1152
1153
  return Number.isFinite(number)
1153
1154
  ? 0 === number && -Infinity === 1 / number
@@ -1177,7 +1178,7 @@
1177
1178
  existingId = writtenClientReferences.get(clientReferenceKey);
1178
1179
  if (void 0 !== existingId)
1179
1180
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1180
- ? serializeLazyID(existingId)
1181
+ ? "$L" + existingId.toString(16)
1181
1182
  : serializeByValueID(existingId);
1182
1183
  try {
1183
1184
  var config = request.bundlerConfig,
@@ -1209,7 +1210,7 @@
1209
1210
  request.completedImportChunks.push(processedChunk);
1210
1211
  writtenClientReferences.set(clientReferenceKey, importId);
1211
1212
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1212
- ? serializeLazyID(importId)
1213
+ ? "$L" + importId.toString(16)
1213
1214
  : serializeByValueID(importId);
1214
1215
  } catch (x) {
1215
1216
  return (
@@ -1357,6 +1358,12 @@
1357
1358
  null !== parent &&
1358
1359
  (parent.$$typeof === REACT_ELEMENT_TYPE ||
1359
1360
  parent.$$typeof === REACT_LAZY_TYPE);
1361
+ if (11 === request.status)
1362
+ return (
1363
+ (task.status = 3),
1364
+ (task = request.fatalError),
1365
+ parent ? "$L" + task.toString(16) : serializeByValueID(task)
1366
+ );
1360
1367
  key =
1361
1368
  thrownValue === SuspenseException
1362
1369
  ? getSuspendedThenable()
@@ -1365,35 +1372,24 @@
1365
1372
  "object" === typeof key &&
1366
1373
  null !== key &&
1367
1374
  "function" === typeof key.then
1368
- ) {
1369
- if (11 === request.status)
1370
- return (
1371
- (task.status = 3),
1372
- (task = request.fatalError),
1373
- parent ? serializeLazyID(task) : serializeByValueID(task)
1374
- );
1375
- request = createTask(
1376
- request,
1377
- task.model,
1378
- task.keyPath,
1379
- task.implicitSlot,
1380
- request.abortableTasks,
1381
- task.debugOwner
1382
- );
1383
- value = request.ping;
1384
- key.then(value, value);
1385
- request.thenableState = getThenableStateAfterSuspending();
1386
- task.keyPath = prevKeyPath;
1387
- task.implicitSlot = prevImplicitSlot;
1388
- return parent
1389
- ? serializeLazyID(request.id)
1390
- : serializeByValueID(request.id);
1391
- }
1392
- if (11 === request.status)
1375
+ )
1393
1376
  return (
1394
- (task.status = 3),
1395
- (task = request.fatalError),
1396
- parent ? serializeLazyID(task) : serializeByValueID(task)
1377
+ (request = createTask(
1378
+ request,
1379
+ task.model,
1380
+ task.keyPath,
1381
+ task.implicitSlot,
1382
+ request.abortableTasks,
1383
+ task.debugOwner
1384
+ )),
1385
+ (value = request.ping),
1386
+ key.then(value, value),
1387
+ (request.thenableState = getThenableStateAfterSuspending()),
1388
+ (task.keyPath = prevKeyPath),
1389
+ (task.implicitSlot = prevImplicitSlot),
1390
+ parent
1391
+ ? "$L" + request.id.toString(16)
1392
+ : serializeByValueID(request.id)
1397
1393
  );
1398
1394
  task.keyPath = prevKeyPath;
1399
1395
  task.implicitSlot = prevImplicitSlot;
@@ -1402,7 +1398,7 @@
1402
1398
  task = logRecoverableError(request, key, task);
1403
1399
  emitErrorChunk(request, prevKeyPath, task, key);
1404
1400
  return parent
1405
- ? serializeLazyID(prevKeyPath)
1401
+ ? "$L" + prevKeyPath.toString(16)
1406
1402
  : serializeByValueID(prevKeyPath);
1407
1403
  }
1408
1404
  }
@@ -2071,36 +2067,31 @@
2071
2067
  request.abortableTasks.delete(task);
2072
2068
  task.status = 1;
2073
2069
  } catch (thrownValue) {
2074
- var x =
2075
- thrownValue === SuspenseException
2076
- ? getSuspendedThenable()
2077
- : thrownValue;
2078
- if (
2079
- "object" === typeof x &&
2080
- null !== x &&
2081
- "function" === typeof x.then
2082
- )
2083
- if (11 === request.status) {
2084
- request.abortableTasks.delete(task);
2085
- task.status = 3;
2086
- var model = stringify(serializeByValueID(request.fatalError));
2087
- emitModelChunk(request, task.id, model);
2088
- } else {
2070
+ if (11 === request.status) {
2071
+ request.abortableTasks.delete(task);
2072
+ task.status = 3;
2073
+ var model = stringify(serializeByValueID(request.fatalError));
2074
+ emitModelChunk(request, task.id, model);
2075
+ } else {
2076
+ var x =
2077
+ thrownValue === SuspenseException
2078
+ ? getSuspendedThenable()
2079
+ : thrownValue;
2080
+ if (
2081
+ "object" === typeof x &&
2082
+ null !== x &&
2083
+ "function" === typeof x.then
2084
+ ) {
2089
2085
  task.status = 0;
2090
2086
  task.thenableState = getThenableStateAfterSuspending();
2091
2087
  var ping = task.ping;
2092
2088
  x.then(ping, ping);
2089
+ } else {
2090
+ request.abortableTasks.delete(task);
2091
+ task.status = 4;
2092
+ var digest = logRecoverableError(request, x, task);
2093
+ emitErrorChunk(request, task.id, digest, x);
2093
2094
  }
2094
- else if (11 === request.status) {
2095
- request.abortableTasks.delete(task);
2096
- task.status = 3;
2097
- var _model = stringify(serializeByValueID(request.fatalError));
2098
- emitModelChunk(request, task.id, _model);
2099
- } else {
2100
- request.abortableTasks.delete(task);
2101
- task.status = 4;
2102
- var digest = logRecoverableError(request, x, task);
2103
- emitErrorChunk(request, task.id, digest, x);
2104
2095
  }
2105
2096
  } finally {
2106
2097
  debugID = prevDebugID;
@@ -2206,9 +2197,13 @@
2206
2197
  }
2207
2198
  function startWork(request) {
2208
2199
  request.flushScheduled = null !== request.destination;
2209
- scheduleWork(function () {
2210
- return performWork(request);
2211
- });
2200
+ 21 === request.type
2201
+ ? scheduleMicrotask(function () {
2202
+ return performWork(request);
2203
+ })
2204
+ : scheduleWork(function () {
2205
+ return performWork(request);
2206
+ });
2212
2207
  }
2213
2208
  function enqueueFlush(request) {
2214
2209
  !1 === request.flushScheduled &&
@@ -2226,8 +2221,6 @@
2226
2221
  10 === request.status && (request.status = 11);
2227
2222
  var abortableTasks = request.abortableTasks;
2228
2223
  if (0 < abortableTasks.size) {
2229
- var errorId = request.nextChunkId++;
2230
- request.fatalError = errorId;
2231
2224
  var error =
2232
2225
  void 0 === reason
2233
2226
  ? Error(
@@ -2240,13 +2233,15 @@
2240
2233
  "The render was aborted by the server with a promise."
2241
2234
  )
2242
2235
  : reason,
2243
- digest = logRecoverableError(request, error, null);
2236
+ digest = logRecoverableError(request, error, null),
2237
+ _errorId2 = request.nextChunkId++;
2238
+ request.fatalError = _errorId2;
2244
2239
  request.pendingChunks++;
2245
- emitErrorChunk(request, errorId, digest, error);
2240
+ emitErrorChunk(request, _errorId2, digest, error);
2246
2241
  abortableTasks.forEach(function (task) {
2247
2242
  if (5 !== task.status) {
2248
2243
  task.status = 3;
2249
- var ref = serializeByValueID(errorId);
2244
+ var ref = serializeByValueID(_errorId2);
2250
2245
  task = encodeReferenceChunk(request, task.id, ref);
2251
2246
  request.completedErrorChunks.push(task);
2252
2247
  }
@@ -1118,9 +1118,13 @@ function pingTask(request, task) {
1118
1118
  pingedTasks.push(task);
1119
1119
  1 === pingedTasks.length &&
1120
1120
  ((request.flushScheduled = null !== request.destination),
1121
- scheduleMicrotask(function () {
1122
- return performWork(request);
1123
- }));
1121
+ 21 === request.type
1122
+ ? scheduleMicrotask(function () {
1123
+ return performWork(request);
1124
+ })
1125
+ : scheduleWork(function () {
1126
+ return performWork(request);
1127
+ }));
1124
1128
  }
1125
1129
  function createTask(request, model, keyPath, implicitSlot, abortSet) {
1126
1130
  request.pendingChunks++;
@@ -1158,54 +1162,48 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1158
1162
  null !== parentPropertyName &&
1159
1163
  (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
1160
1164
  parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
1161
- (value =
1165
+ 11 === request.status)
1166
+ )
1167
+ (task.status = 3),
1168
+ (prevKeyPath = request.fatalError),
1169
+ (JSCompiler_inline_result = parentPropertyName
1170
+ ? "$L" + prevKeyPath.toString(16)
1171
+ : serializeByValueID(prevKeyPath));
1172
+ else if (
1173
+ ((value =
1162
1174
  thrownValue === SuspenseException
1163
1175
  ? getSuspendedThenable()
1164
1176
  : thrownValue),
1165
1177
  "object" === typeof value &&
1166
1178
  null !== value &&
1167
1179
  "function" === typeof value.then)
1168
- )
1169
- if (11 === request.status)
1170
- (task.status = 3),
1171
- (prevKeyPath = request.fatalError),
1172
- (JSCompiler_inline_result = parentPropertyName
1173
- ? "$L" + prevKeyPath.toString(16)
1174
- : serializeByValueID(prevKeyPath));
1175
- else {
1176
- JSCompiler_inline_result = createTask(
1177
- request,
1178
- task.model,
1179
- task.keyPath,
1180
- task.implicitSlot,
1181
- request.abortableTasks
1182
- );
1183
- var ping = JSCompiler_inline_result.ping;
1184
- value.then(ping, ping);
1185
- JSCompiler_inline_result.thenableState =
1186
- getThenableStateAfterSuspending();
1187
- task.keyPath = prevKeyPath;
1188
- task.implicitSlot = prevImplicitSlot;
1189
- JSCompiler_inline_result = parentPropertyName
1190
- ? "$L" + JSCompiler_inline_result.id.toString(16)
1191
- : serializeByValueID(JSCompiler_inline_result.id);
1192
- }
1193
- else
1194
- 11 === request.status
1195
- ? ((task.status = 3),
1196
- (prevKeyPath = request.fatalError),
1197
- (JSCompiler_inline_result = parentPropertyName
1198
- ? "$L" + prevKeyPath.toString(16)
1199
- : serializeByValueID(prevKeyPath)))
1200
- : ((task.keyPath = prevKeyPath),
1201
- (task.implicitSlot = prevImplicitSlot),
1202
- request.pendingChunks++,
1203
- (prevKeyPath = request.nextChunkId++),
1204
- (prevImplicitSlot = logRecoverableError(request, value, task)),
1205
- emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1206
- (JSCompiler_inline_result = parentPropertyName
1207
- ? "$L" + prevKeyPath.toString(16)
1208
- : serializeByValueID(prevKeyPath)));
1180
+ ) {
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
+ } else
1198
+ (task.keyPath = prevKeyPath),
1199
+ (task.implicitSlot = prevImplicitSlot),
1200
+ request.pendingChunks++,
1201
+ (prevKeyPath = request.nextChunkId++),
1202
+ (prevImplicitSlot = logRecoverableError(request, value, task)),
1203
+ emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1204
+ (JSCompiler_inline_result = parentPropertyName
1205
+ ? "$L" + prevKeyPath.toString(16)
1206
+ : serializeByValueID(prevKeyPath));
1209
1207
  }
1210
1208
  return JSCompiler_inline_result;
1211
1209
  },
@@ -1743,32 +1741,31 @@ function retryTask(request, task) {
1743
1741
  request.abortableTasks.delete(task);
1744
1742
  task.status = 1;
1745
1743
  } catch (thrownValue) {
1746
- var x =
1747
- thrownValue === SuspenseException
1748
- ? getSuspendedThenable()
1749
- : thrownValue;
1750
- if ("object" === typeof x && null !== x && "function" === typeof x.then)
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 {
1744
+ if (11 === request.status) {
1745
+ request.abortableTasks.delete(task);
1746
+ task.status = 3;
1747
+ var model = stringify(serializeByValueID(request.fatalError));
1748
+ emitModelChunk(request, task.id, model);
1749
+ } else {
1750
+ var x =
1751
+ thrownValue === SuspenseException
1752
+ ? getSuspendedThenable()
1753
+ : thrownValue;
1754
+ if (
1755
+ "object" === typeof x &&
1756
+ null !== x &&
1757
+ "function" === typeof x.then
1758
+ ) {
1757
1759
  task.status = 0;
1758
1760
  task.thenableState = getThenableStateAfterSuspending();
1759
1761
  var ping = task.ping;
1760
1762
  x.then(ping, ping);
1763
+ } else {
1764
+ request.abortableTasks.delete(task);
1765
+ task.status = 4;
1766
+ var digest = logRecoverableError(request, x, task);
1767
+ emitErrorChunk(request, task.id, digest);
1761
1768
  }
1762
- else if (11 === request.status) {
1763
- request.abortableTasks.delete(task);
1764
- task.status = 3;
1765
- var model$19 = stringify(serializeByValueID(request.fatalError));
1766
- emitModelChunk(request, task.id, model$19);
1767
- } else {
1768
- request.abortableTasks.delete(task);
1769
- task.status = 4;
1770
- var digest = logRecoverableError(request, x, task);
1771
- emitErrorChunk(request, task.id, digest);
1772
1769
  }
1773
1770
  } finally {
1774
1771
  }
@@ -1839,9 +1836,13 @@ function flushCompletedChunks(request, destination) {
1839
1836
  }
1840
1837
  function startWork(request) {
1841
1838
  request.flushScheduled = null !== request.destination;
1842
- scheduleWork(function () {
1843
- return performWork(request);
1844
- });
1839
+ 21 === request.type
1840
+ ? scheduleMicrotask(function () {
1841
+ return performWork(request);
1842
+ })
1843
+ : scheduleWork(function () {
1844
+ return performWork(request);
1845
+ });
1845
1846
  }
1846
1847
  function enqueueFlush(request) {
1847
1848
  !1 === request.flushScheduled &&
@@ -1859,8 +1860,6 @@ function abort(request, reason) {
1859
1860
  10 === request.status && (request.status = 11);
1860
1861
  var abortableTasks = request.abortableTasks;
1861
1862
  if (0 < abortableTasks.size) {
1862
- var errorId = request.nextChunkId++;
1863
- request.fatalError = errorId;
1864
1863
  var error =
1865
1864
  void 0 === reason
1866
1865
  ? Error("The render was aborted by the server without a reason.")
@@ -1869,7 +1868,9 @@ function abort(request, reason) {
1869
1868
  "function" === typeof reason.then
1870
1869
  ? Error("The render was aborted by the server with a promise.")
1871
1870
  : reason,
1872
- digest = logRecoverableError(request, error, null);
1871
+ digest = logRecoverableError(request, error, null),
1872
+ errorId = request.nextChunkId++;
1873
+ request.fatalError = errorId;
1873
1874
  request.pendingChunks++;
1874
1875
  emitErrorChunk(request, errorId, digest, error);
1875
1876
  abortableTasks.forEach(function (task) {
@@ -1886,7 +1887,7 @@ function abort(request, reason) {
1886
1887
  }
1887
1888
  var abortListeners = request.abortListeners;
1888
1889
  if (0 < abortListeners.size) {
1889
- var error$26 =
1890
+ var error$23 =
1890
1891
  void 0 === reason
1891
1892
  ? Error("The render was aborted by the server without a reason.")
1892
1893
  : "object" === typeof reason &&
@@ -1895,14 +1896,14 @@ function abort(request, reason) {
1895
1896
  ? Error("The render was aborted by the server with a promise.")
1896
1897
  : reason;
1897
1898
  abortListeners.forEach(function (callback) {
1898
- return callback(error$26);
1899
+ return callback(error$23);
1899
1900
  });
1900
1901
  abortListeners.clear();
1901
1902
  }
1902
1903
  null !== request.destination &&
1903
1904
  flushCompletedChunks(request, request.destination);
1904
- } catch (error$27) {
1905
- logRecoverableError(request, error$27, null), fatalError(request, error$27);
1905
+ } catch (error$24) {
1906
+ logRecoverableError(request, error$24, null), fatalError(request, error$24);
1906
1907
  }
1907
1908
  }
1908
1909
  function resolveServerReference(bundlerConfig, id) {
@@ -2354,8 +2355,8 @@ function parseReadableStream(response, reference, type) {
2354
2355
  (previousBlockedChunk = chunk));
2355
2356
  } else {
2356
2357
  chunk = previousBlockedChunk;
2357
- var chunk$30 = createPendingChunk(response);
2358
- chunk$30.then(
2358
+ var chunk$27 = createPendingChunk(response);
2359
+ chunk$27.then(
2359
2360
  function (v) {
2360
2361
  return controller.enqueue(v);
2361
2362
  },
@@ -2363,10 +2364,10 @@ function parseReadableStream(response, reference, type) {
2363
2364
  return controller.error(e);
2364
2365
  }
2365
2366
  );
2366
- previousBlockedChunk = chunk$30;
2367
+ previousBlockedChunk = chunk$27;
2367
2368
  chunk.then(function () {
2368
- previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
2369
- resolveModelChunk(chunk$30, json, -1);
2369
+ previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
2370
+ resolveModelChunk(chunk$27, json, -1);
2370
2371
  });
2371
2372
  }
2372
2373
  },