react-server-dom-webpack 19.0.0-rc-94e652d5-20240912 → 19.0.0-rc-ee1a403a-20240916

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.
@@ -631,7 +631,7 @@
631
631
  pingedTasks = [],
632
632
  hints = new Set();
633
633
  this.type = type;
634
- this.status = 10;
634
+ this.status = OPENING;
635
635
  this.flushScheduled = !1;
636
636
  this.destination = this.fatalError = null;
637
637
  this.bundlerConfig = bundlerConfig;
@@ -1171,7 +1171,7 @@
1171
1171
  pingedTasks.push(task);
1172
1172
  1 === pingedTasks.length &&
1173
1173
  ((request.flushScheduled = null !== request.destination),
1174
- request.type === PRERENDER
1174
+ request.type === PRERENDER || request.status === OPENING
1175
1175
  ? scheduleMicrotask(function () {
1176
1176
  return performWork(request);
1177
1177
  })
@@ -1290,8 +1290,14 @@
1290
1290
  '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
1291
1291
  );
1292
1292
  }
1293
+ if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
1294
+ throw Error(
1295
+ 'The module "' +
1296
+ modulePath +
1297
+ '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
1298
+ );
1293
1299
  var clientReferenceMetadata =
1294
- !0 === clientReference.$$async
1300
+ !0 === resolvedModuleData.async || !0 === clientReference.$$async
1295
1301
  ? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
1296
1302
  : [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
1297
1303
  request.pendingChunks++;
@@ -2148,13 +2154,15 @@
2148
2154
  );
2149
2155
  var currentEnv = (0, request.environmentName)();
2150
2156
  currentEnv !== task.environmentName &&
2151
- emitDebugChunk(request, task.id, { env: currentEnv });
2157
+ (request.pendingChunks++,
2158
+ emitDebugChunk(request, task.id, { env: currentEnv }));
2152
2159
  emitChunk(request, task, resolvedModel);
2153
2160
  } else {
2154
2161
  var json = stringify(resolvedModel),
2155
2162
  _currentEnv = (0, request.environmentName)();
2156
2163
  _currentEnv !== task.environmentName &&
2157
- emitDebugChunk(request, task.id, { env: _currentEnv });
2164
+ (request.pendingChunks++,
2165
+ emitDebugChunk(request, task.id, { env: _currentEnv }));
2158
2166
  emitModelChunk(request, task.id, json);
2159
2167
  }
2160
2168
  request.abortableTasks.delete(task);
@@ -2291,13 +2299,12 @@
2291
2299
  }
2292
2300
  function startWork(request) {
2293
2301
  request.flushScheduled = null !== request.destination;
2294
- request.type === PRERENDER
2295
- ? scheduleMicrotask(function () {
2296
- requestStorage.run(request, performWork, request);
2297
- })
2298
- : setImmediate(function () {
2299
- return requestStorage.run(request, performWork, request);
2300
- });
2302
+ scheduleMicrotask(function () {
2303
+ requestStorage.run(request, performWork, request);
2304
+ });
2305
+ setImmediate(function () {
2306
+ request.status === OPENING && (request.status = 11);
2307
+ });
2301
2308
  }
2302
2309
  function enqueueFlush(request) {
2303
2310
  !1 === request.flushScheduled &&
@@ -2324,7 +2331,7 @@
2324
2331
  }
2325
2332
  function abort(request, reason) {
2326
2333
  try {
2327
- 10 === request.status && (request.status = ABORTING);
2334
+ 11 >= request.status && (request.status = ABORTING);
2328
2335
  var abortableTasks = request.abortableTasks;
2329
2336
  if (0 < abortableTasks.size) {
2330
2337
  var error =
@@ -3506,9 +3513,10 @@
3506
3513
  ABORTED = 3,
3507
3514
  ERRORED$1 = 4,
3508
3515
  RENDERING = 5,
3509
- ABORTING = 11,
3510
- CLOSING = 12,
3511
- CLOSED = 13,
3516
+ OPENING = 10,
3517
+ ABORTING = 12,
3518
+ CLOSING = 13,
3519
+ CLOSED = 14,
3512
3520
  PRERENDER = 21,
3513
3521
  currentRequest = null,
3514
3522
  debugID = null,
@@ -806,7 +806,7 @@ function serializeThenable(request, task, thenable) {
806
806
  newTask.id
807
807
  );
808
808
  default:
809
- if (11 === request.status)
809
+ if (12 === request.status)
810
810
  return (
811
811
  request.abortableTasks.delete(newTask),
812
812
  (newTask.status = 3),
@@ -1021,7 +1021,7 @@ function renderFunctionComponent(request, task, key, Component, props) {
1021
1021
  thenableIndexCounter = 0;
1022
1022
  thenableState = prevThenableState;
1023
1023
  Component = Component(props, void 0);
1024
- if (11 === request.status)
1024
+ if (12 === request.status)
1025
1025
  throw (
1026
1026
  ("object" === typeof Component &&
1027
1027
  null !== Component &&
@@ -1120,7 +1120,7 @@ function renderElement(request, task, type, key, ref, props) {
1120
1120
  case REACT_LAZY_TYPE:
1121
1121
  var init = type._init;
1122
1122
  type = init(type._payload);
1123
- if (11 === request.status) throw null;
1123
+ if (12 === request.status) throw null;
1124
1124
  return renderElement(request, task, type, key, ref, props);
1125
1125
  case REACT_FORWARD_REF_TYPE:
1126
1126
  return renderFunctionComponent(request, task, key, type.render, props);
@@ -1141,7 +1141,7 @@ function pingTask(request, task) {
1141
1141
  pingedTasks.push(task);
1142
1142
  1 === pingedTasks.length &&
1143
1143
  ((request.flushScheduled = null !== request.destination),
1144
- 21 === request.type
1144
+ 21 === request.type || 10 === request.status
1145
1145
  ? scheduleMicrotask(function () {
1146
1146
  return performWork(request);
1147
1147
  })
@@ -1185,7 +1185,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1185
1185
  null !== parentPropertyName &&
1186
1186
  (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
1187
1187
  parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
1188
- 11 === request.status)
1188
+ 12 === request.status)
1189
1189
  )
1190
1190
  (task.status = 3),
1191
1191
  (prevKeyPath = request.fatalError),
@@ -1275,8 +1275,14 @@ function serializeClientReference(
1275
1275
  '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
1276
1276
  );
1277
1277
  }
1278
+ if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
1279
+ throw Error(
1280
+ 'The module "' +
1281
+ modulePath +
1282
+ '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
1283
+ );
1278
1284
  var JSCompiler_inline_result =
1279
- !0 === clientReference.$$async
1285
+ !0 === resolvedModuleData.async || !0 === clientReference.$$async
1280
1286
  ? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
1281
1287
  : [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
1282
1288
  request.pendingChunks++;
@@ -1397,7 +1403,7 @@ function renderModelDestructive(
1397
1403
  task.thenableState = null;
1398
1404
  parentPropertyName = value._init;
1399
1405
  value = parentPropertyName(value._payload);
1400
- if (11 === request.status) throw null;
1406
+ if (12 === request.status) throw null;
1401
1407
  return renderModelDestructive(request, task, emptyRoot, "", value);
1402
1408
  case REACT_LEGACY_ELEMENT_TYPE:
1403
1409
  throw Error(
@@ -1663,8 +1669,8 @@ function fatalError(request, error) {
1663
1669
  var onFatalError = request.onFatalError;
1664
1670
  onFatalError(error);
1665
1671
  null !== request.destination
1666
- ? ((request.status = 13), request.destination.destroy(error))
1667
- : ((request.status = 12), (request.fatalError = error));
1672
+ ? ((request.status = 14), request.destination.destroy(error))
1673
+ : ((request.status = 13), (request.fatalError = error));
1668
1674
  }
1669
1675
  function emitErrorChunk(request, id, digest) {
1670
1676
  digest = { digest: digest };
@@ -1755,7 +1761,7 @@ function retryTask(request, task) {
1755
1761
  request.abortableTasks.delete(task);
1756
1762
  task.status = 1;
1757
1763
  } catch (thrownValue) {
1758
- if (11 === request.status) {
1764
+ if (12 === request.status) {
1759
1765
  request.abortableTasks.delete(task);
1760
1766
  task.status = 3;
1761
1767
  var model = stringify(serializeByValueID(request.fatalError));
@@ -1870,17 +1876,16 @@ function flushCompletedChunks(request, destination) {
1870
1876
  }
1871
1877
  "function" === typeof destination.flush && destination.flush();
1872
1878
  0 === request.pendingChunks &&
1873
- ((request.status = 13), destination.end(), (request.destination = null));
1879
+ ((request.status = 14), destination.end(), (request.destination = null));
1874
1880
  }
1875
1881
  function startWork(request) {
1876
1882
  request.flushScheduled = null !== request.destination;
1877
- 21 === request.type
1878
- ? scheduleMicrotask(function () {
1879
- requestStorage.run(request, performWork, request);
1880
- })
1881
- : setImmediate(function () {
1882
- return requestStorage.run(request, performWork, request);
1883
- });
1883
+ scheduleMicrotask(function () {
1884
+ requestStorage.run(request, performWork, request);
1885
+ });
1886
+ setImmediate(function () {
1887
+ 10 === request.status && (request.status = 11);
1888
+ });
1884
1889
  }
1885
1890
  function enqueueFlush(request) {
1886
1891
  !1 === request.flushScheduled &&
@@ -1894,9 +1899,9 @@ function enqueueFlush(request) {
1894
1899
  }));
1895
1900
  }
1896
1901
  function startFlowing(request, destination) {
1897
- if (12 === request.status)
1898
- (request.status = 13), destination.destroy(request.fatalError);
1899
- else if (13 !== request.status && null === request.destination) {
1902
+ if (13 === request.status)
1903
+ (request.status = 14), destination.destroy(request.fatalError);
1904
+ else if (14 !== request.status && null === request.destination) {
1900
1905
  request.destination = destination;
1901
1906
  try {
1902
1907
  flushCompletedChunks(request, destination);
@@ -1907,7 +1912,7 @@ function startFlowing(request, destination) {
1907
1912
  }
1908
1913
  function abort(request, reason) {
1909
1914
  try {
1910
- 10 === request.status && (request.status = 11);
1915
+ 11 >= request.status && (request.status = 12);
1911
1916
  var abortableTasks = request.abortableTasks;
1912
1917
  if (0 < abortableTasks.size) {
1913
1918
  var error =
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-server-dom-webpack",
3
3
  "description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
4
- "version": "19.0.0-rc-94e652d5-20240912",
4
+ "version": "19.0.0-rc-ee1a403a-20240916",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -99,8 +99,8 @@
99
99
  "node": ">=0.10.0"
100
100
  },
101
101
  "peerDependencies": {
102
- "react": "19.0.0-rc-94e652d5-20240912",
103
- "react-dom": "19.0.0-rc-94e652d5-20240912",
102
+ "react": "19.0.0-rc-ee1a403a-20240916",
103
+ "react-dom": "19.0.0-rc-ee1a403a-20240916",
104
104
  "webpack": "^5.59.0"
105
105
  },
106
106
  "dependencies": {