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.
@@ -1046,7 +1046,7 @@
1046
1046
  retryTask(request, task);
1047
1047
  return 1 === task.status
1048
1048
  ? serializeByValueID(task.id)
1049
- : serializeLazyID(task.id);
1049
+ : "$L" + task.id.toString(16);
1050
1050
  }
1051
1051
  function renderElement(request, task, type, key, ref, props) {
1052
1052
  if (null !== ref && void 0 !== ref)
@@ -1114,9 +1114,13 @@
1114
1114
  pingedTasks.push(task);
1115
1115
  1 === pingedTasks.length &&
1116
1116
  ((request.flushScheduled = null !== request.destination),
1117
- scheduleMicrotask(function () {
1118
- return performWork(request);
1119
- }));
1117
+ 21 === request.type
1118
+ ? scheduleMicrotask(function () {
1119
+ return performWork(request);
1120
+ })
1121
+ : setImmediate(function () {
1122
+ return performWork(request);
1123
+ }));
1120
1124
  }
1121
1125
  function createTask(
1122
1126
  request,
@@ -1178,9 +1182,6 @@
1178
1182
  function serializeByValueID(id) {
1179
1183
  return "$" + id.toString(16);
1180
1184
  }
1181
- function serializeLazyID(id) {
1182
- return "$L" + id.toString(16);
1183
- }
1184
1185
  function serializeNumber(number) {
1185
1186
  return Number.isFinite(number)
1186
1187
  ? 0 === number && -Infinity === 1 / number
@@ -1209,7 +1210,7 @@
1209
1210
  existingId = writtenClientReferences.get(clientReferenceKey);
1210
1211
  if (void 0 !== existingId)
1211
1212
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1212
- ? serializeLazyID(existingId)
1213
+ ? "$L" + existingId.toString(16)
1213
1214
  : serializeByValueID(existingId);
1214
1215
  try {
1215
1216
  var config = request.bundlerConfig,
@@ -1240,7 +1241,7 @@
1240
1241
  request.completedImportChunks.push(processedChunk);
1241
1242
  writtenClientReferences.set(clientReferenceKey, importId);
1242
1243
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1243
- ? serializeLazyID(importId)
1244
+ ? "$L" + importId.toString(16)
1244
1245
  : serializeByValueID(importId);
1245
1246
  } catch (x) {
1246
1247
  return (
@@ -1388,6 +1389,12 @@
1388
1389
  null !== parent &&
1389
1390
  (parent.$$typeof === REACT_ELEMENT_TYPE ||
1390
1391
  parent.$$typeof === REACT_LAZY_TYPE);
1392
+ if (11 === request.status)
1393
+ return (
1394
+ (task.status = 3),
1395
+ (task = request.fatalError),
1396
+ parent ? "$L" + task.toString(16) : serializeByValueID(task)
1397
+ );
1391
1398
  key =
1392
1399
  thrownValue === SuspenseException
1393
1400
  ? getSuspendedThenable()
@@ -1396,35 +1403,24 @@
1396
1403
  "object" === typeof key &&
1397
1404
  null !== key &&
1398
1405
  "function" === typeof key.then
1399
- ) {
1400
- if (11 === request.status)
1401
- return (
1402
- (task.status = 3),
1403
- (task = request.fatalError),
1404
- parent ? serializeLazyID(task) : serializeByValueID(task)
1405
- );
1406
- request = createTask(
1407
- request,
1408
- task.model,
1409
- task.keyPath,
1410
- task.implicitSlot,
1411
- request.abortableTasks,
1412
- task.debugOwner
1413
- );
1414
- value = request.ping;
1415
- key.then(value, value);
1416
- request.thenableState = getThenableStateAfterSuspending();
1417
- task.keyPath = prevKeyPath;
1418
- task.implicitSlot = prevImplicitSlot;
1419
- return parent
1420
- ? serializeLazyID(request.id)
1421
- : serializeByValueID(request.id);
1422
- }
1423
- if (11 === request.status)
1406
+ )
1424
1407
  return (
1425
- (task.status = 3),
1426
- (task = request.fatalError),
1427
- parent ? serializeLazyID(task) : serializeByValueID(task)
1408
+ (request = createTask(
1409
+ request,
1410
+ task.model,
1411
+ task.keyPath,
1412
+ task.implicitSlot,
1413
+ request.abortableTasks,
1414
+ task.debugOwner
1415
+ )),
1416
+ (value = request.ping),
1417
+ key.then(value, value),
1418
+ (request.thenableState = getThenableStateAfterSuspending()),
1419
+ (task.keyPath = prevKeyPath),
1420
+ (task.implicitSlot = prevImplicitSlot),
1421
+ parent
1422
+ ? "$L" + request.id.toString(16)
1423
+ : serializeByValueID(request.id)
1428
1424
  );
1429
1425
  task.keyPath = prevKeyPath;
1430
1426
  task.implicitSlot = prevImplicitSlot;
@@ -1433,7 +1429,7 @@
1433
1429
  task = logRecoverableError(request, key, task);
1434
1430
  emitErrorChunk(request, prevKeyPath, task, key);
1435
1431
  return parent
1436
- ? serializeLazyID(prevKeyPath)
1432
+ ? "$L" + prevKeyPath.toString(16)
1437
1433
  : serializeByValueID(prevKeyPath);
1438
1434
  }
1439
1435
  }
@@ -2100,36 +2096,31 @@
2100
2096
  request.abortableTasks.delete(task);
2101
2097
  task.status = 1;
2102
2098
  } catch (thrownValue) {
2103
- var x =
2104
- thrownValue === SuspenseException
2105
- ? getSuspendedThenable()
2106
- : thrownValue;
2107
- if (
2108
- "object" === typeof x &&
2109
- null !== x &&
2110
- "function" === typeof x.then
2111
- )
2112
- if (11 === request.status) {
2113
- request.abortableTasks.delete(task);
2114
- task.status = 3;
2115
- var model = stringify(serializeByValueID(request.fatalError));
2116
- emitModelChunk(request, task.id, model);
2117
- } else {
2099
+ if (11 === request.status) {
2100
+ request.abortableTasks.delete(task);
2101
+ task.status = 3;
2102
+ var model = stringify(serializeByValueID(request.fatalError));
2103
+ emitModelChunk(request, task.id, model);
2104
+ } else {
2105
+ var x =
2106
+ thrownValue === SuspenseException
2107
+ ? getSuspendedThenable()
2108
+ : thrownValue;
2109
+ if (
2110
+ "object" === typeof x &&
2111
+ null !== x &&
2112
+ "function" === typeof x.then
2113
+ ) {
2118
2114
  task.status = 0;
2119
2115
  task.thenableState = getThenableStateAfterSuspending();
2120
2116
  var ping = task.ping;
2121
2117
  x.then(ping, ping);
2118
+ } else {
2119
+ request.abortableTasks.delete(task);
2120
+ task.status = 4;
2121
+ var digest = logRecoverableError(request, x, task);
2122
+ emitErrorChunk(request, task.id, digest, x);
2122
2123
  }
2123
- else if (11 === request.status) {
2124
- request.abortableTasks.delete(task);
2125
- task.status = 3;
2126
- var _model = stringify(serializeByValueID(request.fatalError));
2127
- emitModelChunk(request, task.id, _model);
2128
- } else {
2129
- request.abortableTasks.delete(task);
2130
- task.status = 4;
2131
- var digest = logRecoverableError(request, x, task);
2132
- emitErrorChunk(request, task.id, digest, x);
2133
2124
  }
2134
2125
  } finally {
2135
2126
  debugID = prevDebugID;
@@ -2236,9 +2227,13 @@
2236
2227
  }
2237
2228
  function startWork(request) {
2238
2229
  request.flushScheduled = null !== request.destination;
2239
- setImmediate(function () {
2240
- return requestStorage.run(request, performWork, request);
2241
- });
2230
+ 21 === request.type
2231
+ ? scheduleMicrotask(function () {
2232
+ requestStorage.run(request, performWork, request);
2233
+ })
2234
+ : setImmediate(function () {
2235
+ return requestStorage.run(request, performWork, request);
2236
+ });
2242
2237
  }
2243
2238
  function enqueueFlush(request) {
2244
2239
  !1 === request.flushScheduled &&
@@ -2268,8 +2263,6 @@
2268
2263
  10 === request.status && (request.status = 11);
2269
2264
  var abortableTasks = request.abortableTasks;
2270
2265
  if (0 < abortableTasks.size) {
2271
- var errorId = request.nextChunkId++;
2272
- request.fatalError = errorId;
2273
2266
  var error =
2274
2267
  void 0 === reason
2275
2268
  ? Error(
@@ -2282,13 +2275,15 @@
2282
2275
  "The render was aborted by the server with a promise."
2283
2276
  )
2284
2277
  : reason,
2285
- digest = logRecoverableError(request, error, null);
2278
+ digest = logRecoverableError(request, error, null),
2279
+ _errorId2 = request.nextChunkId++;
2280
+ request.fatalError = _errorId2;
2286
2281
  request.pendingChunks++;
2287
- emitErrorChunk(request, errorId, digest, error);
2282
+ emitErrorChunk(request, _errorId2, digest, error);
2288
2283
  abortableTasks.forEach(function (task) {
2289
2284
  if (5 !== task.status) {
2290
2285
  task.status = 3;
2291
- var ref = serializeByValueID(errorId);
2286
+ var ref = serializeByValueID(_errorId2);
2292
2287
  task = encodeReferenceChunk(request, task.id, ref);
2293
2288
  request.completedErrorChunks.push(task);
2294
2289
  }
@@ -3553,12 +3548,12 @@
3553
3548
  "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
3554
3549
  );
3555
3550
  pendingFiles++;
3556
- var JSCompiler_object_inline_chunks_133 = [];
3551
+ var JSCompiler_object_inline_chunks_135 = [];
3557
3552
  value.on("data", function (chunk) {
3558
- JSCompiler_object_inline_chunks_133.push(chunk);
3553
+ JSCompiler_object_inline_chunks_135.push(chunk);
3559
3554
  });
3560
3555
  value.on("end", function () {
3561
- var blob = new Blob(JSCompiler_object_inline_chunks_133, {
3556
+ var blob = new Blob(JSCompiler_object_inline_chunks_135, {
3562
3557
  type: mimeType
3563
3558
  });
3564
3559
  response._formData.append(name, blob, filename);
@@ -1138,9 +1138,13 @@ function pingTask(request, task) {
1138
1138
  pingedTasks.push(task);
1139
1139
  1 === pingedTasks.length &&
1140
1140
  ((request.flushScheduled = null !== request.destination),
1141
- scheduleMicrotask(function () {
1142
- return performWork(request);
1143
- }));
1141
+ 21 === request.type
1142
+ ? scheduleMicrotask(function () {
1143
+ return performWork(request);
1144
+ })
1145
+ : setImmediate(function () {
1146
+ return performWork(request);
1147
+ }));
1144
1148
  }
1145
1149
  function createTask(request, model, keyPath, implicitSlot, abortSet) {
1146
1150
  request.pendingChunks++;
@@ -1178,54 +1182,48 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1178
1182
  null !== parentPropertyName &&
1179
1183
  (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
1180
1184
  parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
1181
- (value =
1185
+ 11 === request.status)
1186
+ )
1187
+ (task.status = 3),
1188
+ (prevKeyPath = request.fatalError),
1189
+ (JSCompiler_inline_result = parentPropertyName
1190
+ ? "$L" + prevKeyPath.toString(16)
1191
+ : serializeByValueID(prevKeyPath));
1192
+ else if (
1193
+ ((value =
1182
1194
  thrownValue === SuspenseException
1183
1195
  ? getSuspendedThenable()
1184
1196
  : thrownValue),
1185
1197
  "object" === typeof value &&
1186
1198
  null !== value &&
1187
1199
  "function" === typeof value.then)
1188
- )
1189
- if (11 === request.status)
1190
- (task.status = 3),
1191
- (prevKeyPath = request.fatalError),
1192
- (JSCompiler_inline_result = parentPropertyName
1193
- ? "$L" + prevKeyPath.toString(16)
1194
- : serializeByValueID(prevKeyPath));
1195
- else {
1196
- JSCompiler_inline_result = createTask(
1197
- request,
1198
- task.model,
1199
- task.keyPath,
1200
- task.implicitSlot,
1201
- request.abortableTasks
1202
- );
1203
- var ping = JSCompiler_inline_result.ping;
1204
- value.then(ping, ping);
1205
- JSCompiler_inline_result.thenableState =
1206
- getThenableStateAfterSuspending();
1207
- task.keyPath = prevKeyPath;
1208
- task.implicitSlot = prevImplicitSlot;
1209
- JSCompiler_inline_result = parentPropertyName
1210
- ? "$L" + JSCompiler_inline_result.id.toString(16)
1211
- : serializeByValueID(JSCompiler_inline_result.id);
1212
- }
1213
- else
1214
- 11 === request.status
1215
- ? ((task.status = 3),
1216
- (prevKeyPath = request.fatalError),
1217
- (JSCompiler_inline_result = parentPropertyName
1218
- ? "$L" + prevKeyPath.toString(16)
1219
- : serializeByValueID(prevKeyPath)))
1220
- : ((task.keyPath = prevKeyPath),
1221
- (task.implicitSlot = prevImplicitSlot),
1222
- request.pendingChunks++,
1223
- (prevKeyPath = request.nextChunkId++),
1224
- (prevImplicitSlot = logRecoverableError(request, value, task)),
1225
- emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1226
- (JSCompiler_inline_result = parentPropertyName
1227
- ? "$L" + prevKeyPath.toString(16)
1228
- : serializeByValueID(prevKeyPath)));
1200
+ ) {
1201
+ JSCompiler_inline_result = createTask(
1202
+ request,
1203
+ task.model,
1204
+ task.keyPath,
1205
+ task.implicitSlot,
1206
+ request.abortableTasks
1207
+ );
1208
+ var ping = JSCompiler_inline_result.ping;
1209
+ value.then(ping, ping);
1210
+ JSCompiler_inline_result.thenableState =
1211
+ getThenableStateAfterSuspending();
1212
+ task.keyPath = prevKeyPath;
1213
+ task.implicitSlot = prevImplicitSlot;
1214
+ JSCompiler_inline_result = parentPropertyName
1215
+ ? "$L" + JSCompiler_inline_result.id.toString(16)
1216
+ : serializeByValueID(JSCompiler_inline_result.id);
1217
+ } else
1218
+ (task.keyPath = prevKeyPath),
1219
+ (task.implicitSlot = prevImplicitSlot),
1220
+ request.pendingChunks++,
1221
+ (prevKeyPath = request.nextChunkId++),
1222
+ (prevImplicitSlot = logRecoverableError(request, value, task)),
1223
+ emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1224
+ (JSCompiler_inline_result = parentPropertyName
1225
+ ? "$L" + prevKeyPath.toString(16)
1226
+ : serializeByValueID(prevKeyPath));
1229
1227
  }
1230
1228
  return JSCompiler_inline_result;
1231
1229
  },
@@ -1754,32 +1752,31 @@ function retryTask(request, task) {
1754
1752
  request.abortableTasks.delete(task);
1755
1753
  task.status = 1;
1756
1754
  } catch (thrownValue) {
1757
- var x =
1758
- thrownValue === SuspenseException
1759
- ? getSuspendedThenable()
1760
- : thrownValue;
1761
- if ("object" === typeof x && null !== x && "function" === typeof x.then)
1762
- if (11 === request.status) {
1763
- request.abortableTasks.delete(task);
1764
- task.status = 3;
1765
- var model = stringify(serializeByValueID(request.fatalError));
1766
- emitModelChunk(request, task.id, model);
1767
- } else {
1755
+ if (11 === request.status) {
1756
+ request.abortableTasks.delete(task);
1757
+ task.status = 3;
1758
+ var model = stringify(serializeByValueID(request.fatalError));
1759
+ emitModelChunk(request, task.id, model);
1760
+ } else {
1761
+ var x =
1762
+ thrownValue === SuspenseException
1763
+ ? getSuspendedThenable()
1764
+ : thrownValue;
1765
+ if (
1766
+ "object" === typeof x &&
1767
+ null !== x &&
1768
+ "function" === typeof x.then
1769
+ ) {
1768
1770
  task.status = 0;
1769
1771
  task.thenableState = getThenableStateAfterSuspending();
1770
1772
  var ping = task.ping;
1771
1773
  x.then(ping, ping);
1774
+ } else {
1775
+ request.abortableTasks.delete(task);
1776
+ task.status = 4;
1777
+ var digest = logRecoverableError(request, x, task);
1778
+ emitErrorChunk(request, task.id, digest);
1772
1779
  }
1773
- else if (11 === request.status) {
1774
- request.abortableTasks.delete(task);
1775
- task.status = 3;
1776
- var model$19 = stringify(serializeByValueID(request.fatalError));
1777
- emitModelChunk(request, task.id, model$19);
1778
- } else {
1779
- request.abortableTasks.delete(task);
1780
- task.status = 4;
1781
- var digest = logRecoverableError(request, x, task);
1782
- emitErrorChunk(request, task.id, digest);
1783
1780
  }
1784
1781
  } finally {
1785
1782
  }
@@ -1874,9 +1871,13 @@ function flushCompletedChunks(request, destination) {
1874
1871
  }
1875
1872
  function startWork(request) {
1876
1873
  request.flushScheduled = null !== request.destination;
1877
- setImmediate(function () {
1878
- return requestStorage.run(request, performWork, request);
1879
- });
1874
+ 21 === request.type
1875
+ ? scheduleMicrotask(function () {
1876
+ requestStorage.run(request, performWork, request);
1877
+ })
1878
+ : setImmediate(function () {
1879
+ return requestStorage.run(request, performWork, request);
1880
+ });
1880
1881
  }
1881
1882
  function enqueueFlush(request) {
1882
1883
  !1 === request.flushScheduled &&
@@ -1906,8 +1907,6 @@ function abort(request, reason) {
1906
1907
  10 === request.status && (request.status = 11);
1907
1908
  var abortableTasks = request.abortableTasks;
1908
1909
  if (0 < abortableTasks.size) {
1909
- var errorId = request.nextChunkId++;
1910
- request.fatalError = errorId;
1911
1910
  var error =
1912
1911
  void 0 === reason
1913
1912
  ? Error("The render was aborted by the server without a reason.")
@@ -1916,7 +1915,9 @@ function abort(request, reason) {
1916
1915
  "function" === typeof reason.then
1917
1916
  ? Error("The render was aborted by the server with a promise.")
1918
1917
  : reason,
1919
- digest = logRecoverableError(request, error, null);
1918
+ digest = logRecoverableError(request, error, null),
1919
+ errorId = request.nextChunkId++;
1920
+ request.fatalError = errorId;
1920
1921
  request.pendingChunks++;
1921
1922
  emitErrorChunk(request, errorId, digest, error);
1922
1923
  abortableTasks.forEach(function (task) {
@@ -1933,7 +1934,7 @@ function abort(request, reason) {
1933
1934
  }
1934
1935
  var abortListeners = request.abortListeners;
1935
1936
  if (0 < abortListeners.size) {
1936
- var error$26 =
1937
+ var error$23 =
1937
1938
  void 0 === reason
1938
1939
  ? Error("The render was aborted by the server without a reason.")
1939
1940
  : "object" === typeof reason &&
@@ -1942,14 +1943,14 @@ function abort(request, reason) {
1942
1943
  ? Error("The render was aborted by the server with a promise.")
1943
1944
  : reason;
1944
1945
  abortListeners.forEach(function (callback) {
1945
- return callback(error$26);
1946
+ return callback(error$23);
1946
1947
  });
1947
1948
  abortListeners.clear();
1948
1949
  }
1949
1950
  null !== request.destination &&
1950
1951
  flushCompletedChunks(request, request.destination);
1951
- } catch (error$27) {
1952
- logRecoverableError(request, error$27, null), fatalError(request, error$27);
1952
+ } catch (error$24) {
1953
+ logRecoverableError(request, error$24, null), fatalError(request, error$24);
1953
1954
  }
1954
1955
  }
1955
1956
  function resolveServerReference(bundlerConfig, id) {
@@ -2360,8 +2361,8 @@ function parseReadableStream(response, reference, type) {
2360
2361
  (previousBlockedChunk = chunk));
2361
2362
  } else {
2362
2363
  chunk = previousBlockedChunk;
2363
- var chunk$30 = createPendingChunk(response);
2364
- chunk$30.then(
2364
+ var chunk$27 = createPendingChunk(response);
2365
+ chunk$27.then(
2365
2366
  function (v) {
2366
2367
  return controller.enqueue(v);
2367
2368
  },
@@ -2369,10 +2370,10 @@ function parseReadableStream(response, reference, type) {
2369
2370
  return controller.error(e);
2370
2371
  }
2371
2372
  );
2372
- previousBlockedChunk = chunk$30;
2373
+ previousBlockedChunk = chunk$27;
2373
2374
  chunk.then(function () {
2374
- previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
2375
- resolveModelChunk(chunk$30, json, -1);
2375
+ previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
2376
+ resolveModelChunk(chunk$27, json, -1);
2376
2377
  });
2377
2378
  }
2378
2379
  },
@@ -2730,12 +2731,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
2730
2731
  "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
2731
2732
  );
2732
2733
  pendingFiles++;
2733
- var JSCompiler_object_inline_chunks_213 = [];
2734
+ var JSCompiler_object_inline_chunks_212 = [];
2734
2735
  value.on("data", function (chunk) {
2735
- JSCompiler_object_inline_chunks_213.push(chunk);
2736
+ JSCompiler_object_inline_chunks_212.push(chunk);
2736
2737
  });
2737
2738
  value.on("end", function () {
2738
- var blob = new Blob(JSCompiler_object_inline_chunks_213, {
2739
+ var blob = new Blob(JSCompiler_object_inline_chunks_212, {
2739
2740
  type: mimeType
2740
2741
  });
2741
2742
  response._formData.append(name, blob, filename);