react-server-dom-webpack 19.2.0-canary-befc1246-20250708 → 19.2.0-canary-e6dc25da-20250709

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.
@@ -262,72 +262,77 @@
262
262
  var owner = componentStorage.getStore();
263
263
  return owner ? owner : null;
264
264
  }
265
- function collectStackTrace(error, structuredStackTrace) {
266
- for (
267
- var result = [], i = framesToSkip;
268
- i < structuredStackTrace.length;
269
- i++
270
- ) {
265
+ function collectStackTracePrivate(error, structuredStackTrace) {
266
+ error = [];
267
+ for (var i = framesToSkip; i < structuredStackTrace.length; i++) {
271
268
  var callSite = structuredStackTrace[i],
272
- _name = callSite.getFunctionName() || "<anonymous>";
273
- if (_name.includes("react_stack_bottom_frame")) break;
274
- else if (callSite.isNative()) result.push([_name, "", 0, 0, 0, 0]);
269
+ name = callSite.getFunctionName() || "<anonymous>";
270
+ if (name.includes("react_stack_bottom_frame")) break;
271
+ else if (callSite.isNative())
272
+ (callSite = callSite.isAsync()),
273
+ error.push([name, "", 0, 0, 0, 0, callSite]);
275
274
  else {
276
- if (callSite.isConstructor()) _name = "new " + _name;
275
+ if (callSite.isConstructor()) name = "new " + name;
277
276
  else if (!callSite.isToplevel()) {
278
277
  var callSite$jscomp$0 = callSite;
279
- _name = callSite$jscomp$0.getTypeName();
278
+ name = callSite$jscomp$0.getTypeName();
280
279
  var methodName = callSite$jscomp$0.getMethodName();
281
280
  callSite$jscomp$0 = callSite$jscomp$0.getFunctionName();
282
- var result$jscomp$0 = "";
281
+ var result = "";
283
282
  callSite$jscomp$0
284
- ? (_name &&
283
+ ? (name &&
285
284
  identifierRegExp.test(callSite$jscomp$0) &&
286
- callSite$jscomp$0 !== _name &&
287
- (result$jscomp$0 += _name + "."),
288
- (result$jscomp$0 += callSite$jscomp$0),
285
+ callSite$jscomp$0 !== name &&
286
+ (result += name + "."),
287
+ (result += callSite$jscomp$0),
289
288
  !methodName ||
290
289
  callSite$jscomp$0 === methodName ||
291
290
  callSite$jscomp$0.endsWith("." + methodName) ||
292
291
  callSite$jscomp$0.endsWith(" " + methodName) ||
293
- (result$jscomp$0 += " [as " + methodName + "]"))
294
- : (_name && (result$jscomp$0 += _name + "."),
295
- (result$jscomp$0 = methodName
296
- ? result$jscomp$0 + methodName
297
- : result$jscomp$0 + "<anonymous>"));
298
- _name = result$jscomp$0;
292
+ (result += " [as " + methodName + "]"))
293
+ : (name && (result += name + "."),
294
+ (result = methodName
295
+ ? result + methodName
296
+ : result + "<anonymous>"));
297
+ name = result;
299
298
  }
300
- "<anonymous>" === _name && (_name = "");
299
+ "<anonymous>" === name && (name = "");
301
300
  methodName = callSite.getScriptNameOrSourceURL() || "<anonymous>";
302
- "<anonymous>" === methodName && (methodName = "");
303
- callSite.isEval() &&
304
- !methodName &&
305
- (callSite$jscomp$0 = callSite.getEvalOrigin()) &&
306
- (methodName = callSite$jscomp$0.toString() + ", <anonymous>");
301
+ "<anonymous>" === methodName &&
302
+ ((methodName = ""),
303
+ callSite.isEval() &&
304
+ (callSite$jscomp$0 = callSite.getEvalOrigin()) &&
305
+ (methodName = callSite$jscomp$0.toString() + ", <anonymous>"));
307
306
  callSite$jscomp$0 = callSite.getLineNumber() || 0;
308
- result$jscomp$0 = callSite.getColumnNumber() || 0;
307
+ result = callSite.getColumnNumber() || 0;
309
308
  var enclosingLine =
310
- "function" === typeof callSite.getEnclosingLineNumber
311
- ? callSite.getEnclosingLineNumber() || 0
312
- : 0;
313
- callSite =
314
- "function" === typeof callSite.getEnclosingColumnNumber
315
- ? callSite.getEnclosingColumnNumber() || 0
316
- : 0;
317
- result.push([
318
- _name,
309
+ "function" === typeof callSite.getEnclosingLineNumber
310
+ ? callSite.getEnclosingLineNumber() || 0
311
+ : 0,
312
+ enclosingCol =
313
+ "function" === typeof callSite.getEnclosingColumnNumber
314
+ ? callSite.getEnclosingColumnNumber() || 0
315
+ : 0;
316
+ callSite = callSite.isAsync();
317
+ error.push([
318
+ name,
319
319
  methodName,
320
320
  callSite$jscomp$0,
321
- result$jscomp$0,
321
+ result,
322
322
  enclosingLine,
323
+ enclosingCol,
323
324
  callSite
324
325
  ]);
325
326
  }
326
327
  }
328
+ collectedStackTrace = error;
329
+ return "";
330
+ }
331
+ function collectStackTrace(error, structuredStackTrace) {
332
+ collectStackTracePrivate(error, structuredStackTrace);
327
333
  error = (error.name || "Error") + ": " + (error.message || "");
328
- for (i = 0; i < structuredStackTrace.length; i++)
334
+ for (var i = 0; i < structuredStackTrace.length; i++)
329
335
  error += "\n at " + structuredStackTrace[i].toString();
330
- collectedStackTrace = result;
331
336
  return error;
332
337
  }
333
338
  function parseStackTrace(error, skipFrames) {
@@ -344,10 +349,10 @@
344
349
  }
345
350
  if (null !== collectedStackTrace)
346
351
  return (
347
- (skipFrames = collectedStackTrace),
352
+ (stack = collectedStackTrace),
348
353
  (collectedStackTrace = null),
349
- stackTraceCache.set(error, skipFrames),
350
- skipFrames
354
+ stackTraceCache.set(error, stack),
355
+ stack
351
356
  );
352
357
  stack.startsWith("Error: react-stack-top-frame\n") &&
353
358
  (stack = stack.slice(29));
@@ -358,8 +363,12 @@
358
363
  for (existing = []; skipFrames < stack.length; skipFrames++) {
359
364
  var parsed = frameRegExp.exec(stack[skipFrames]);
360
365
  if (parsed) {
361
- var name = parsed[1] || "";
362
- "<anonymous>" === name && (name = "");
366
+ var name = parsed[1] || "",
367
+ isAsync = "async " === parsed[8];
368
+ "<anonymous>" === name
369
+ ? (name = "")
370
+ : name.startsWith("async ") &&
371
+ ((name = name.slice(5)), (isAsync = !0));
363
372
  var filename = parsed[2] || parsed[5] || "";
364
373
  "<anonymous>" === filename && (filename = "");
365
374
  existing.push([
@@ -368,7 +377,8 @@
368
377
  +(parsed[3] || parsed[6]),
369
378
  +(parsed[4] || parsed[7]),
370
379
  0,
371
- 0
380
+ 0,
381
+ isAsync
372
382
  ]);
373
383
  }
374
384
  }
@@ -701,13 +711,29 @@
701
711
  var wrapperMethod = function () {
702
712
  var request = resolveRequest();
703
713
  if (("assert" !== methodName || !arguments[0]) && null !== request) {
704
- var stack = filterStackTrace(
714
+ a: {
715
+ var error = Error("react-stack-top-frame");
716
+ collectedStackTrace = null;
717
+ framesToSkip = 1;
718
+ var previousPrepare = Error.prepareStackTrace;
719
+ Error.prepareStackTrace = collectStackTracePrivate;
720
+ try {
721
+ if ("" !== error.stack) {
722
+ var JSCompiler_inline_result = null;
723
+ break a;
724
+ }
725
+ } finally {
726
+ Error.prepareStackTrace = previousPrepare;
727
+ }
728
+ JSCompiler_inline_result = collectedStackTrace;
729
+ }
730
+ JSCompiler_inline_result = filterStackTrace(
705
731
  request,
706
- parseStackTrace(Error("react-stack-top-frame"), 1)
732
+ JSCompiler_inline_result || []
707
733
  );
708
734
  request.pendingDebugChunks++;
709
- var owner = resolveOwner(),
710
- args = Array.from(arguments);
735
+ error = resolveOwner();
736
+ previousPrepare = Array.from(arguments);
711
737
  a: {
712
738
  var env = 0;
713
739
  switch (methodName) {
@@ -720,36 +746,41 @@
720
746
  case "assert":
721
747
  env = 1;
722
748
  }
723
- var format = args[env],
724
- style = args[env + 1],
725
- badge = args[env + 2];
749
+ var format = previousPrepare[env],
750
+ style = previousPrepare[env + 1],
751
+ badge = previousPrepare[env + 2];
726
752
  "string" === typeof format &&
727
753
  format.startsWith("\u001b[0m\u001b[7m%c%s\u001b[0m%c ") &&
728
754
  "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px" ===
729
755
  style &&
730
756
  "string" === typeof badge
731
- ? (args.splice(env, 4, format.slice(19)),
757
+ ? (previousPrepare.splice(env, 4, format.slice(19)),
732
758
  (env = badge.slice(1, badge.length - 1)))
733
759
  : (env = null);
734
760
  }
735
761
  null === env && (env = (0, request.environmentName)());
736
- null != owner && outlineComponentInfo(request, owner);
737
- format = [methodName, stack, owner, env];
738
- format.push.apply(format, args);
739
- args = serializeDebugModel(
762
+ null != error && outlineComponentInfo(request, error);
763
+ format = [methodName, JSCompiler_inline_result, error, env];
764
+ format.push.apply(format, previousPrepare);
765
+ previousPrepare = serializeDebugModel(
740
766
  request,
741
- (null === request.deferredDebugObjects ? 500 : 10) + stack.length,
767
+ (null === request.deferredDebugObjects ? 500 : 10) +
768
+ JSCompiler_inline_result.length,
742
769
  format
743
770
  );
744
- "[" !== args[0] &&
745
- (args = serializeDebugModel(request, 10 + stack.length, [
746
- methodName,
747
- stack,
748
- owner,
749
- env,
750
- "Unknown Value: React could not send it from the server."
751
- ]));
752
- request.completedDebugChunks.push(":W" + args + "\n");
771
+ "[" !== previousPrepare[0] &&
772
+ (previousPrepare = serializeDebugModel(
773
+ request,
774
+ 10 + JSCompiler_inline_result.length,
775
+ [
776
+ methodName,
777
+ JSCompiler_inline_result,
778
+ error,
779
+ env,
780
+ "Unknown Value: React could not send it from the server."
781
+ ]
782
+ ));
783
+ request.completedDebugChunks.push(":W" + previousPrepare + "\n");
753
784
  }
754
785
  return originalMethod.apply(this, arguments);
755
786
  };
@@ -972,6 +1003,14 @@
972
1003
  }
973
1004
  if (request.status === ABORTING)
974
1005
  return emitDebugHaltChunk(request, id), ref;
1006
+ var deferredDebugObjects = request.deferredDebugObjects;
1007
+ if (null !== deferredDebugObjects)
1008
+ return (
1009
+ deferredDebugObjects.retained.set(id, thenable),
1010
+ (ref = "$Y@" + id.toString(16)),
1011
+ request.writtenDebugObjects.set(thenable, ref),
1012
+ ref
1013
+ );
975
1014
  var cancelled = !1;
976
1015
  thenable.then(
977
1016
  function (value) {
@@ -1000,6 +1039,22 @@
1000
1039
  });
1001
1040
  return ref;
1002
1041
  }
1042
+ function emitRequestedDebugThenable(request, id, counter, thenable) {
1043
+ thenable.then(
1044
+ function (value) {
1045
+ request.status === ABORTING
1046
+ ? emitDebugHaltChunk(request, id)
1047
+ : emitOutlinedDebugModelChunk(request, id, counter, value);
1048
+ enqueueFlush(request);
1049
+ },
1050
+ function (reason) {
1051
+ request.status === ABORTING
1052
+ ? emitDebugHaltChunk(request, id)
1053
+ : emitErrorChunk(request, id, "", reason, !0);
1054
+ enqueueFlush(request);
1055
+ }
1056
+ );
1057
+ }
1003
1058
  function serializeThenable(request, task, thenable) {
1004
1059
  var newTask = createTask(
1005
1060
  request,
@@ -2588,6 +2643,8 @@
2588
2643
  ((existingDebugReference = tempRef.get(parent)),
2589
2644
  void 0 !== existingDebugReference)
2590
2645
  ) {
2646
+ if (0 >= counter.objectLimit && !doNotLimit.has(value))
2647
+ return serializeDeferredObject(request, value);
2591
2648
  var propertyName = parentPropertyName;
2592
2649
  if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
2593
2650
  switch (parentPropertyName) {
@@ -2604,11 +2661,12 @@
2604
2661
  propertyName = "_owner";
2605
2662
  }
2606
2663
  tempRef.set(value, existingDebugReference + ":" + propertyName);
2607
- } else if (debugNoOutline !== value)
2608
- return (
2609
- (request = outlineDebugModel(request, counter, value)),
2610
- serializeByValueID(request)
2611
- );
2664
+ } else if (debugNoOutline !== value) {
2665
+ if ("function" === typeof value.then)
2666
+ return serializeDebugThenable(request, counter, value);
2667
+ request = outlineDebugModel(request, counter, value);
2668
+ return serializeByValueID(request);
2669
+ }
2612
2670
  parent = request.writtenObjects.get(value);
2613
2671
  if (void 0 !== parent) return parent;
2614
2672
  if (0 >= counter.objectLimit && !doNotLimit.has(value))
@@ -2941,10 +2999,10 @@
2941
2999
  start: ioInfo$jscomp$0.start - request$jscomp$0.timeOrigin,
2942
3000
  end: ioInfo$jscomp$0.end - request$jscomp$0.timeOrigin
2943
3001
  };
2944
- void 0 !== value && (debugIOInfo.value = value);
2945
3002
  null != env && (debugIOInfo.env = env);
2946
3003
  null != debugStack && (debugIOInfo.stack = debugStack);
2947
3004
  null != owner && (debugIOInfo.owner = owner);
3005
+ void 0 !== value && (debugIOInfo.value = value);
2948
3006
  value = serializeDebugModel(
2949
3007
  request$jscomp$0,
2950
3008
  objectLimit,
@@ -3363,6 +3421,19 @@
3363
3421
  ),
3364
3422
  enqueueFlush(request));
3365
3423
  break;
3424
+ case 80:
3425
+ for (command = 0; command < message.length; command++)
3426
+ (id = message[command]),
3427
+ (retainedValue = deferredDebugObjects.retained.get(id)),
3428
+ void 0 !== retainedValue &&
3429
+ (deferredDebugObjects.retained.delete(id),
3430
+ emitRequestedDebugThenable(
3431
+ request,
3432
+ id,
3433
+ { objectLimit: 10 },
3434
+ retainedValue
3435
+ ));
3436
+ break;
3366
3437
  default:
3367
3438
  throw Error(
3368
3439
  "Unknown command. The debugChannel was not wired up properly."
@@ -4852,12 +4923,12 @@
4852
4923
  "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."
4853
4924
  );
4854
4925
  pendingFiles++;
4855
- var JSCompiler_object_inline_chunks_214 = [];
4926
+ var JSCompiler_object_inline_chunks_219 = [];
4856
4927
  value.on("data", function (chunk) {
4857
- JSCompiler_object_inline_chunks_214.push(chunk);
4928
+ JSCompiler_object_inline_chunks_219.push(chunk);
4858
4929
  });
4859
4930
  value.on("end", function () {
4860
- var blob = new Blob(JSCompiler_object_inline_chunks_214, {
4931
+ var blob = new Blob(JSCompiler_object_inline_chunks_219, {
4861
4932
  type: mimeType
4862
4933
  });
4863
4934
  response._formData.append(name, blob, filename);
@@ -864,8 +864,8 @@ function serializeReadableStream(request, task, stream) {
864
864
  tryStreamTask(request, streamTask),
865
865
  enqueueFlush(request),
866
866
  reader.read().then(progress, error);
867
- } catch (x$9) {
868
- error(x$9);
867
+ } catch (x$8) {
868
+ error(x$8);
869
869
  }
870
870
  }
871
871
  function error(reason) {
@@ -941,8 +941,8 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
941
941
  tryStreamTask(request, streamTask),
942
942
  enqueueFlush(request),
943
943
  iterator.next().then(progress, error);
944
- } catch (x$10) {
945
- error(x$10);
944
+ } catch (x$9) {
945
+ error(x$9);
946
946
  }
947
947
  }
948
948
  function error(reason) {
@@ -1999,9 +1999,9 @@ function abort(request, reason) {
1999
1999
  null !== request.destination &&
2000
2000
  flushCompletedChunks(request, request.destination);
2001
2001
  }
2002
- } catch (error$24) {
2003
- logRecoverableError(request, error$24, null),
2004
- fatalError(request, error$24);
2002
+ } catch (error$23) {
2003
+ logRecoverableError(request, error$23, null),
2004
+ fatalError(request, error$23);
2005
2005
  }
2006
2006
  }
2007
2007
  function resolveServerReference(bundlerConfig, id) {
@@ -2449,8 +2449,8 @@ function parseReadableStream(response, reference, type) {
2449
2449
  (previousBlockedChunk = chunk));
2450
2450
  } else {
2451
2451
  chunk = previousBlockedChunk;
2452
- var chunk$27 = createPendingChunk(response);
2453
- chunk$27.then(
2452
+ var chunk$26 = createPendingChunk(response);
2453
+ chunk$26.then(
2454
2454
  function (v) {
2455
2455
  return controller.enqueue(v);
2456
2456
  },
@@ -2458,10 +2458,10 @@ function parseReadableStream(response, reference, type) {
2458
2458
  return controller.error(e);
2459
2459
  }
2460
2460
  );
2461
- previousBlockedChunk = chunk$27;
2461
+ previousBlockedChunk = chunk$26;
2462
2462
  chunk.then(function () {
2463
- previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
2464
- resolveModelChunk(chunk$27, json, -1);
2463
+ previousBlockedChunk === chunk$26 && (previousBlockedChunk = null);
2464
+ resolveModelChunk(chunk$26, json, -1);
2465
2465
  });
2466
2466
  }
2467
2467
  },
@@ -2882,12 +2882,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
2882
2882
  "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."
2883
2883
  );
2884
2884
  pendingFiles++;
2885
- var JSCompiler_object_inline_chunks_253 = [];
2885
+ var JSCompiler_object_inline_chunks_262 = [];
2886
2886
  value.on("data", function (chunk) {
2887
- JSCompiler_object_inline_chunks_253.push(chunk);
2887
+ JSCompiler_object_inline_chunks_262.push(chunk);
2888
2888
  });
2889
2889
  value.on("end", function () {
2890
- var blob = new Blob(JSCompiler_object_inline_chunks_253, {
2890
+ var blob = new Blob(JSCompiler_object_inline_chunks_262, {
2891
2891
  type: mimeType
2892
2892
  });
2893
2893
  response._formData.append(name, blob, filename);