react-server-dom-webpack 19.2.0-canary-ab859e31-20250606 → 19.2.0-canary-b6c0aa88-20250609

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.
Files changed (26) hide show
  1. package/cjs/react-server-dom-webpack-client.browser.development.js +38 -64
  2. package/cjs/react-server-dom-webpack-client.edge.development.js +36 -62
  3. package/cjs/react-server-dom-webpack-client.node.development.js +202 -149
  4. package/cjs/react-server-dom-webpack-client.node.production.js +162 -86
  5. package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +202 -149
  6. package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +162 -86
  7. package/cjs/react-server-dom-webpack-server.browser.development.js +132 -92
  8. package/cjs/react-server-dom-webpack-server.edge.development.js +132 -92
  9. package/cjs/react-server-dom-webpack-server.node.development.js +298 -118
  10. package/cjs/react-server-dom-webpack-server.node.production.js +166 -25
  11. package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +298 -118
  12. package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +166 -25
  13. package/client.node.js +2 -23
  14. package/client.node.unbundled.js +2 -23
  15. package/package.json +3 -3
  16. package/server.node.js +6 -9
  17. package/server.node.unbundled.js +4 -7
  18. package/static.node.js +3 -0
  19. package/cjs/react-server-dom-webpack-client.node-webstreams.development.js +0 -3052
  20. package/cjs/react-server-dom-webpack-client.node-webstreams.production.js +0 -1846
  21. package/cjs/react-server-dom-webpack-client.node-webstreams.unbundled.development.js +0 -3014
  22. package/cjs/react-server-dom-webpack-client.node-webstreams.unbundled.production.js +0 -1811
  23. package/cjs/react-server-dom-webpack-server.node-webstreams.development.js +0 -4318
  24. package/cjs/react-server-dom-webpack-server.node-webstreams.production.js +0 -2842
  25. package/cjs/react-server-dom-webpack-server.node-webstreams.unbundled.development.js +0 -4281
  26. package/cjs/react-server-dom-webpack-server.node-webstreams.unbundled.production.js +0 -2808
@@ -12,6 +12,14 @@
12
12
  "production" !== process.env.NODE_ENV &&
13
13
  (function () {
14
14
  function voidHandler() {}
15
+ function getIteratorFn(maybeIterable) {
16
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
17
+ return null;
18
+ maybeIterable =
19
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
20
+ maybeIterable["@@iterator"];
21
+ return "function" === typeof maybeIterable ? maybeIterable : null;
22
+ }
15
23
  function _defineProperty(obj, key, value) {
16
24
  a: if ("object" == typeof key && key) {
17
25
  var e = key[Symbol.toPrimitive];
@@ -351,14 +359,6 @@
351
359
  temporaryReferences.set(reference, id);
352
360
  return reference;
353
361
  }
354
- function getIteratorFn(maybeIterable) {
355
- if (null === maybeIterable || "object" !== typeof maybeIterable)
356
- return null;
357
- maybeIterable =
358
- (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
359
- maybeIterable["@@iterator"];
360
- return "function" === typeof maybeIterable ? maybeIterable : null;
361
- }
362
362
  function noop() {}
363
363
  function trackUsedThenable(thenableState, thenable, index) {
364
364
  index = thenableState[index];
@@ -882,17 +882,22 @@
882
882
  task.debugStack,
883
883
  task.debugTask
884
884
  );
885
- (task = thenable._debugInfo) &&
886
- forwardDebugInfo(request, newTask.id, task);
887
885
  switch (thenable.status) {
888
886
  case "fulfilled":
889
887
  return (
888
+ (task = thenable._debugInfo) &&
889
+ forwardDebugInfo(request, newTask, task),
890
890
  (newTask.model = thenable.value),
891
891
  pingTask(request, newTask),
892
892
  newTask.id
893
893
  );
894
894
  case "rejected":
895
- return erroredTask(request, newTask, thenable.reason), newTask.id;
895
+ return (
896
+ (task = thenable._debugInfo) &&
897
+ forwardDebugInfo(request, newTask, task),
898
+ erroredTask(request, newTask, thenable.reason),
899
+ newTask.id
900
+ );
896
901
  default:
897
902
  if (request.status === ABORTING)
898
903
  return (
@@ -918,10 +923,14 @@
918
923
  }
919
924
  thenable.then(
920
925
  function (value) {
926
+ var _debugInfo2 = thenable._debugInfo;
927
+ _debugInfo2 && forwardDebugInfo(request, newTask, _debugInfo2);
921
928
  newTask.model = value;
922
929
  pingTask(request, newTask);
923
930
  },
924
931
  function (reason) {
932
+ var _debugInfo3 = thenable._debugInfo;
933
+ _debugInfo3 && forwardDebugInfo(request, newTask, _debugInfo3);
925
934
  newTask.status === PENDING$1 &&
926
935
  (erroredTask(request, newTask, reason), enqueueFlush(request));
927
936
  }
@@ -1063,7 +1072,7 @@
1063
1072
  task = streamTask.id.toString(16) + ":" + (isIterator ? "x" : "X") + "\n";
1064
1073
  request.completedRegularChunks.push(task);
1065
1074
  (iterable = iterable._debugInfo) &&
1066
- forwardDebugInfo(request, streamTask.id, iterable);
1075
+ forwardDebugInfo(request, streamTask, iterable);
1067
1076
  var aborted = !1;
1068
1077
  request.abortListeners.add(abortIterable);
1069
1078
  callIteratorInDEV(iterator, progress, error);
@@ -1202,33 +1211,34 @@
1202
1211
  ) {
1203
1212
  var prevThenableState = task.thenableState;
1204
1213
  task.thenableState = null;
1205
- if (null === debugID) return outlineTask(request, task);
1206
- if (null !== prevThenableState)
1207
- var componentDebugInfo = prevThenableState._componentDebugInfo;
1208
- else {
1209
- var componentDebugID = debugID;
1210
- componentDebugInfo = Component.displayName || Component.name || "";
1211
- var componentEnv = (0, request.environmentName)();
1212
- request.pendingChunks++;
1213
- componentDebugInfo = {
1214
- name: componentDebugInfo,
1215
- env: componentEnv,
1216
- key: key,
1217
- owner: task.debugOwner
1218
- };
1219
- componentDebugInfo.stack =
1220
- null === task.debugStack
1221
- ? null
1222
- : filterStackTrace(request, parseStackTrace(task.debugStack, 1));
1223
- componentDebugInfo.props = props;
1224
- componentDebugInfo.debugStack = task.debugStack;
1225
- componentDebugInfo.debugTask = task.debugTask;
1226
- outlineComponentInfo(request, componentDebugInfo);
1227
- emitDebugChunk(request, componentDebugID, componentDebugInfo);
1228
- task.environmentName = componentEnv;
1229
- 2 === validated &&
1230
- warnForMissingKey(request, key, componentDebugInfo, task.debugTask);
1231
- }
1214
+ if (canEmitDebugInfo)
1215
+ if (null !== prevThenableState)
1216
+ var componentDebugInfo = prevThenableState._componentDebugInfo;
1217
+ else {
1218
+ var componentDebugID = task.id;
1219
+ componentDebugInfo = Component.displayName || Component.name || "";
1220
+ var componentEnv = (0, request.environmentName)();
1221
+ request.pendingChunks++;
1222
+ componentDebugInfo = {
1223
+ name: componentDebugInfo,
1224
+ env: componentEnv,
1225
+ key: key,
1226
+ owner: task.debugOwner
1227
+ };
1228
+ componentDebugInfo.stack =
1229
+ null === task.debugStack
1230
+ ? null
1231
+ : filterStackTrace(request, parseStackTrace(task.debugStack, 1));
1232
+ componentDebugInfo.props = props;
1233
+ componentDebugInfo.debugStack = task.debugStack;
1234
+ componentDebugInfo.debugTask = task.debugTask;
1235
+ outlineComponentInfo(request, componentDebugInfo);
1236
+ emitDebugChunk(request, componentDebugID, componentDebugInfo);
1237
+ task.environmentName = componentEnv;
1238
+ 2 === validated &&
1239
+ warnForMissingKey(request, key, componentDebugInfo, task.debugTask);
1240
+ }
1241
+ else return outlineTask(request, task);
1232
1242
  thenableIndexCounter = 0;
1233
1243
  thenableState = prevThenableState;
1234
1244
  currentComponentDebugInfo = componentDebugInfo;
@@ -1333,8 +1343,8 @@
1333
1343
  task.implicitSlot ? [request] : request
1334
1344
  );
1335
1345
  if ((i = children._debugInfo)) {
1336
- if (null === debugID) return outlineTask(request, task);
1337
- forwardDebugInfo(request, debugID, i);
1346
+ if (canEmitDebugInfo) forwardDebugInfo(request, task, i);
1347
+ else return outlineTask(request, task);
1338
1348
  children = Array.from(children);
1339
1349
  }
1340
1350
  return children;
@@ -1864,10 +1874,10 @@
1864
1874
  _writtenObjects.set(value, elementReference)));
1865
1875
  }
1866
1876
  if (serializedSize > MAX_ROW_SIZE) return deferTask(request, task);
1867
- if ((_existingReference = value._debugInfo)) {
1868
- if (null === debugID) return outlineTask(request, task);
1869
- forwardDebugInfo(request, debugID, _existingReference);
1870
- }
1877
+ if ((_existingReference = value._debugInfo))
1878
+ if (canEmitDebugInfo)
1879
+ forwardDebugInfo(request, task, _existingReference);
1880
+ else return outlineTask(request, task);
1871
1881
  _existingReference = value.props;
1872
1882
  var refProp = _existingReference.ref;
1873
1883
  task.debugOwner = value._owner;
@@ -1893,10 +1903,10 @@
1893
1903
  task.thenableState = null;
1894
1904
  elementReference = callLazyInitInDEV(value);
1895
1905
  if (request.status === ABORTING) throw null;
1896
- if ((_writtenObjects = value._debugInfo)) {
1897
- if (null === debugID) return outlineTask(request, task);
1898
- forwardDebugInfo(request, debugID, _writtenObjects);
1899
- }
1906
+ if ((_writtenObjects = value._debugInfo))
1907
+ if (canEmitDebugInfo)
1908
+ forwardDebugInfo(request, task, _writtenObjects);
1909
+ else return outlineTask(request, task);
1900
1910
  return renderModelDestructive(
1901
1911
  request,
1902
1912
  task,
@@ -2262,11 +2272,19 @@
2262
2272
  objectLimit = { objectLimit: objectLimit };
2263
2273
  var componentDebugInfo = {
2264
2274
  name: componentInfo.name,
2265
- env: componentInfo.env,
2266
- key: componentInfo.key,
2267
- owner: componentInfo.owner
2275
+ key: componentInfo.key
2268
2276
  };
2269
- componentDebugInfo.stack = componentInfo.stack;
2277
+ null != componentInfo.env &&
2278
+ (componentDebugInfo.env = componentInfo.env);
2279
+ null != componentInfo.owner &&
2280
+ (componentDebugInfo.owner = componentInfo.owner);
2281
+ null == componentInfo.stack && null != componentInfo.debugStack
2282
+ ? (componentDebugInfo.stack = filterStackTrace(
2283
+ request,
2284
+ parseStackTrace(componentInfo.debugStack, 1)
2285
+ ))
2286
+ : null != componentInfo.stack &&
2287
+ (componentDebugInfo.stack = componentInfo.stack);
2270
2288
  componentDebugInfo.props = componentInfo.props;
2271
2289
  objectLimit = outlineConsoleValue(
2272
2290
  request,
@@ -2577,46 +2595,66 @@
2577
2595
  }
2578
2596
  request.completedRegularChunks.push(":W" + json + "\n");
2579
2597
  }
2580
- function forwardDebugInfo(request$jscomp$0, id$jscomp$0, debugInfo) {
2581
- for (var i = 0; i < debugInfo.length; i++)
2582
- if ("number" !== typeof debugInfo[i].time)
2583
- if (
2584
- (request$jscomp$0.pendingChunks++,
2585
- "string" === typeof debugInfo[i].name)
2586
- )
2587
- outlineComponentInfo(request$jscomp$0, debugInfo[i]),
2588
- emitDebugChunk(request$jscomp$0, id$jscomp$0, debugInfo[i]);
2589
- else if (debugInfo[i].awaited) {
2590
- var ioInfo = debugInfo[i].awaited;
2591
- var request = request$jscomp$0,
2592
- ioInfo$jscomp$0 = ioInfo;
2593
- if (!request.writtenObjects.has(ioInfo$jscomp$0)) {
2594
- request.pendingChunks++;
2595
- var id = request.nextChunkId++,
2596
- owner = ioInfo$jscomp$0.owner;
2597
- null != owner && outlineComponentInfo(request, owner);
2598
- emitIOInfoChunk(
2599
- request,
2600
- id,
2601
- ioInfo$jscomp$0.name,
2602
- ioInfo$jscomp$0.start,
2603
- ioInfo$jscomp$0.end,
2604
- ioInfo$jscomp$0.env,
2605
- owner,
2606
- ioInfo$jscomp$0.stack
2607
- );
2608
- request.writtenObjects.set(
2609
- ioInfo$jscomp$0,
2610
- serializeByValueID(id)
2611
- );
2598
+ function forwardDebugInfo(request$jscomp$0, task, debugInfo) {
2599
+ task = task.id;
2600
+ for (var i = 0; i < debugInfo.length; i++) {
2601
+ var info = debugInfo[i];
2602
+ if ("number" !== typeof info.time)
2603
+ if ("string" === typeof info.name)
2604
+ outlineComponentInfo(request$jscomp$0, info),
2605
+ request$jscomp$0.pendingChunks++,
2606
+ emitDebugChunk(request$jscomp$0, task, info);
2607
+ else if (info.awaited) {
2608
+ var ioInfo = info.awaited;
2609
+ if (!(ioInfo.end <= request$jscomp$0.timeOrigin)) {
2610
+ var request = request$jscomp$0,
2611
+ ioInfo$jscomp$0 = ioInfo;
2612
+ if (!request.writtenObjects.has(ioInfo$jscomp$0)) {
2613
+ request.pendingChunks++;
2614
+ var id = request.nextChunkId++,
2615
+ owner = ioInfo$jscomp$0.owner;
2616
+ null != owner && outlineComponentInfo(request, owner);
2617
+ var debugStack =
2618
+ null == ioInfo$jscomp$0.stack &&
2619
+ null != ioInfo$jscomp$0.debugStack
2620
+ ? filterStackTrace(
2621
+ request,
2622
+ parseStackTrace(ioInfo$jscomp$0.debugStack, 1)
2623
+ )
2624
+ : ioInfo$jscomp$0.stack;
2625
+ emitIOInfoChunk(
2626
+ request,
2627
+ id,
2628
+ ioInfo$jscomp$0.name,
2629
+ ioInfo$jscomp$0.start,
2630
+ ioInfo$jscomp$0.end,
2631
+ ioInfo$jscomp$0.env,
2632
+ owner,
2633
+ debugStack
2634
+ );
2635
+ request.writtenObjects.set(
2636
+ ioInfo$jscomp$0,
2637
+ serializeByValueID(id)
2638
+ );
2639
+ }
2640
+ debugStack =
2641
+ null == info.stack && null != info.debugStack
2642
+ ? filterStackTrace(
2643
+ request$jscomp$0,
2644
+ parseStackTrace(info.debugStack, 1)
2645
+ )
2646
+ : info.stack;
2647
+ ioInfo = { awaited: ioInfo };
2648
+ null != info.env && (ioInfo.env = info.env);
2649
+ null != info.owner && (ioInfo.owner = info.owner);
2650
+ null != debugStack && (ioInfo.stack = debugStack);
2651
+ request$jscomp$0.pendingChunks++;
2652
+ emitDebugChunk(request$jscomp$0, task, ioInfo);
2612
2653
  }
2613
- emitDebugChunk(request$jscomp$0, id$jscomp$0, {
2614
- awaited: ioInfo,
2615
- env: debugInfo[i].env,
2616
- owner: debugInfo[i].owner,
2617
- stack: debugInfo[i].stack
2618
- });
2619
- } else emitDebugChunk(request$jscomp$0, id$jscomp$0, debugInfo[i]);
2654
+ } else
2655
+ request$jscomp$0.pendingChunks++,
2656
+ emitDebugChunk(request$jscomp$0, task, info);
2657
+ }
2620
2658
  }
2621
2659
  function emitChunk(request, task, value) {
2622
2660
  var id = task.id;
@@ -2660,12 +2698,12 @@
2660
2698
  }
2661
2699
  function retryTask(request, task) {
2662
2700
  if (task.status === PENDING$1) {
2663
- var prevDebugID = debugID;
2701
+ var prevCanEmitDebugInfo = canEmitDebugInfo;
2664
2702
  task.status = RENDERING;
2665
2703
  var parentSerializedSize = serializedSize;
2666
2704
  try {
2667
2705
  modelRoot = task.model;
2668
- debugID = task.id;
2706
+ canEmitDebugInfo = !0;
2669
2707
  var resolvedModel = renderModelDestructive(
2670
2708
  request,
2671
2709
  task,
@@ -2673,7 +2711,7 @@
2673
2711
  "",
2674
2712
  task.model
2675
2713
  );
2676
- debugID = null;
2714
+ canEmitDebugInfo = !1;
2677
2715
  modelRoot = resolvedModel;
2678
2716
  task.keyPath = null;
2679
2717
  task.implicitSlot = !1;
@@ -2717,18 +2755,20 @@
2717
2755
  } else erroredTask(request, task, x);
2718
2756
  }
2719
2757
  } finally {
2720
- (debugID = prevDebugID), (serializedSize = parentSerializedSize);
2758
+ (canEmitDebugInfo = prevCanEmitDebugInfo),
2759
+ (serializedSize = parentSerializedSize);
2721
2760
  }
2722
2761
  }
2723
2762
  }
2724
2763
  function tryStreamTask(request, task) {
2725
- var prevDebugID = debugID;
2726
- debugID = null;
2764
+ var prevCanEmitDebugInfo = canEmitDebugInfo;
2765
+ canEmitDebugInfo = !1;
2727
2766
  var parentSerializedSize = serializedSize;
2728
2767
  try {
2729
2768
  emitChunk(request, task, task.model);
2730
2769
  } finally {
2731
- (serializedSize = parentSerializedSize), (debugID = prevDebugID);
2770
+ (serializedSize = parentSerializedSize),
2771
+ (canEmitDebugInfo = prevCanEmitDebugInfo);
2732
2772
  }
2733
2773
  }
2734
2774
  function performWork(request) {
@@ -3636,7 +3676,24 @@
3636
3676
  abort(request, Error(reason));
3637
3677
  };
3638
3678
  }
3639
- function createFakeWritable(readable) {
3679
+ function createFakeWritableFromReadableStreamController(controller) {
3680
+ return {
3681
+ write: function (chunk) {
3682
+ "string" === typeof chunk && (chunk = textEncoder.encode(chunk));
3683
+ controller.enqueue(chunk);
3684
+ return !0;
3685
+ },
3686
+ end: function () {
3687
+ controller.close();
3688
+ },
3689
+ destroy: function (error) {
3690
+ "function" === typeof controller.error
3691
+ ? controller.error(error)
3692
+ : controller.close();
3693
+ }
3694
+ };
3695
+ }
3696
+ function createFakeWritableFromNodeReadable(readable) {
3640
3697
  return {
3641
3698
  write: function (chunk) {
3642
3699
  return readable.push(chunk);
@@ -3655,6 +3712,19 @@
3655
3712
  var async_hooks = require("async_hooks"),
3656
3713
  ReactDOM = require("react-dom"),
3657
3714
  React = require("react"),
3715
+ REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
3716
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
3717
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
3718
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
3719
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
3720
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
3721
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
3722
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
3723
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
3724
+ REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
3725
+ Symbol.for("react.postpone");
3726
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
3727
+ ASYNC_ITERATOR = Symbol.asyncIterator,
3658
3728
  scheduleMicrotask = queueMicrotask,
3659
3729
  currentView = null,
3660
3730
  writtenBytes = 0,
@@ -3898,19 +3968,6 @@
3898
3968
  );
3899
3969
  }
3900
3970
  },
3901
- REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
3902
- REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
3903
- REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
3904
- REACT_CONTEXT_TYPE = Symbol.for("react.context"),
3905
- REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
3906
- REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
3907
- REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
3908
- REACT_MEMO_TYPE = Symbol.for("react.memo"),
3909
- REACT_LAZY_TYPE = Symbol.for("react.lazy"),
3910
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
3911
- Symbol.for("react.postpone");
3912
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
3913
- ASYNC_ITERATOR = Symbol.asyncIterator,
3914
3971
  SuspenseException = Error(
3915
3972
  "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
3916
3973
  ),
@@ -4090,7 +4147,7 @@
4090
4147
  PRERENDER = 21,
4091
4148
  defaultPostponeHandler = noop,
4092
4149
  currentRequest = null,
4093
- debugID = null,
4150
+ canEmitDebugInfo = !1,
4094
4151
  serializedSize = 0,
4095
4152
  MAX_ROW_SIZE = 3200,
4096
4153
  modelRoot = !1,
@@ -4187,6 +4244,37 @@
4187
4244
  close(body);
4188
4245
  return webpackMap;
4189
4246
  };
4247
+ exports.decodeReplyFromAsyncIterable = function (
4248
+ iterable,
4249
+ webpackMap,
4250
+ options
4251
+ ) {
4252
+ function progress(entry) {
4253
+ if (entry.done) close(response);
4254
+ else {
4255
+ var _entry$value = entry.value;
4256
+ entry = _entry$value[0];
4257
+ _entry$value = _entry$value[1];
4258
+ "string" === typeof _entry$value
4259
+ ? resolveField(response, entry, _entry$value)
4260
+ : response._formData.append(entry, _entry$value);
4261
+ iterator.next().then(progress, error);
4262
+ }
4263
+ }
4264
+ function error(reason) {
4265
+ reportGlobalError(response, reason);
4266
+ "function" === typeof iterator.throw &&
4267
+ iterator.throw(reason).then(error, error);
4268
+ }
4269
+ var iterator = iterable[ASYNC_ITERATOR](),
4270
+ response = createResponse(
4271
+ webpackMap,
4272
+ "",
4273
+ options ? options.temporaryReferences : void 0
4274
+ );
4275
+ iterator.next().then(progress, error);
4276
+ return getChunk(response, 0);
4277
+ };
4190
4278
  exports.decodeReplyFromBusboy = function (
4191
4279
  busboyStream,
4192
4280
  webpackMap,
@@ -4212,12 +4300,12 @@
4212
4300
  "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."
4213
4301
  );
4214
4302
  pendingFiles++;
4215
- var JSCompiler_object_inline_chunks_165 = [];
4303
+ var JSCompiler_object_inline_chunks_174 = [];
4216
4304
  value.on("data", function (chunk) {
4217
- JSCompiler_object_inline_chunks_165.push(chunk);
4305
+ JSCompiler_object_inline_chunks_174.push(chunk);
4218
4306
  });
4219
4307
  value.on("end", function () {
4220
- var blob = new Blob(JSCompiler_object_inline_chunks_165, {
4308
+ var blob = new Blob(JSCompiler_object_inline_chunks_174, {
4221
4309
  type: mimeType
4222
4310
  });
4223
4311
  response._formData.append(name, blob, filename);
@@ -4304,6 +4392,98 @@
4304
4392
  }
4305
4393
  };
4306
4394
  };
4395
+ exports.renderToReadableStream = function (model, webpackMap, options) {
4396
+ var request = createRequest(
4397
+ model,
4398
+ webpackMap,
4399
+ options ? options.onError : void 0,
4400
+ options ? options.identifierPrefix : void 0,
4401
+ options ? options.onPostpone : void 0,
4402
+ options ? options.temporaryReferences : void 0,
4403
+ options ? options.environmentName : void 0,
4404
+ options ? options.filterStackFrame : void 0
4405
+ );
4406
+ if (options && options.signal) {
4407
+ var signal = options.signal;
4408
+ if (signal.aborted) abort(request, signal.reason);
4409
+ else {
4410
+ var listener = function () {
4411
+ abort(request, signal.reason);
4412
+ signal.removeEventListener("abort", listener);
4413
+ };
4414
+ signal.addEventListener("abort", listener);
4415
+ }
4416
+ }
4417
+ var writable;
4418
+ return new ReadableStream(
4419
+ {
4420
+ type: "bytes",
4421
+ start: function (controller) {
4422
+ writable =
4423
+ createFakeWritableFromReadableStreamController(controller);
4424
+ startWork(request);
4425
+ },
4426
+ pull: function () {
4427
+ startFlowing(request, writable);
4428
+ },
4429
+ cancel: function (reason) {
4430
+ request.destination = null;
4431
+ abort(request, reason);
4432
+ }
4433
+ },
4434
+ { highWaterMark: 0 }
4435
+ );
4436
+ };
4437
+ exports.unstable_prerender = function (model, webpackMap, options) {
4438
+ return new Promise(function (resolve, reject) {
4439
+ var request = createPrerenderRequest(
4440
+ model,
4441
+ webpackMap,
4442
+ function () {
4443
+ var writable,
4444
+ stream = new ReadableStream(
4445
+ {
4446
+ type: "bytes",
4447
+ start: function (controller) {
4448
+ writable =
4449
+ createFakeWritableFromReadableStreamController(
4450
+ controller
4451
+ );
4452
+ },
4453
+ pull: function () {
4454
+ startFlowing(request, writable);
4455
+ },
4456
+ cancel: function (reason) {
4457
+ request.destination = null;
4458
+ abort(request, reason);
4459
+ }
4460
+ },
4461
+ { highWaterMark: 0 }
4462
+ );
4463
+ resolve({ prelude: stream });
4464
+ },
4465
+ reject,
4466
+ options ? options.onError : void 0,
4467
+ options ? options.identifierPrefix : void 0,
4468
+ options ? options.onPostpone : void 0,
4469
+ options ? options.temporaryReferences : void 0,
4470
+ options ? options.environmentName : void 0,
4471
+ options ? options.filterStackFrame : void 0
4472
+ );
4473
+ if (options && options.signal) {
4474
+ var signal = options.signal;
4475
+ if (signal.aborted) abort(request, signal.reason);
4476
+ else {
4477
+ var listener = function () {
4478
+ abort(request, signal.reason);
4479
+ signal.removeEventListener("abort", listener);
4480
+ };
4481
+ signal.addEventListener("abort", listener);
4482
+ }
4483
+ }
4484
+ startWork(request);
4485
+ });
4486
+ };
4307
4487
  exports.unstable_prerenderToNodeStream = function (
4308
4488
  model,
4309
4489
  webpackMap,
@@ -4319,7 +4499,7 @@
4319
4499
  startFlowing(request, writable);
4320
4500
  }
4321
4501
  }),
4322
- writable = createFakeWritable(readable);
4502
+ writable = createFakeWritableFromNodeReadable(readable);
4323
4503
  resolve({ prelude: readable });
4324
4504
  },
4325
4505
  reject,