react-server-dom-webpack 19.0.0-rc-20b6f4c0e8-20240607 → 19.0.0-rc-34d0c5e357-20240607

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.
@@ -387,48 +387,32 @@ function error(format) {
387
387
  args[_key2 - 1] = arguments[_key2];
388
388
  }
389
389
 
390
- printWarning('error', format, args, new Error('react-stack-top-frame'));
390
+ printWarning('error', format, args);
391
391
  }
392
392
  }
393
- } // eslint-disable-next-line react-internal/no-production-logging
393
+ }
394
394
 
395
- function printWarning(level, format, args, currentStack) {
395
+ function printWarning(level, format, args) {
396
396
  // When changing this logic, you might want to also
397
397
  // update consoleWithStackDev.www.js as well.
398
398
  {
399
- var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
399
+ var stack = ReactSharedInternals.getStackAddendum();
400
400
 
401
- if (ReactSharedInternals.getCurrentStack) {
402
- // We only add the current stack to the console when createTask is not supported.
403
- // Since createTask requires DevTools to be open to work, this means that stacks
404
- // can be lost while DevTools isn't open but we can't detect this.
405
- var stack = ReactSharedInternals.getCurrentStack(currentStack);
401
+ if (stack !== '') {
402
+ format += '%s';
403
+ args = args.concat([stack]);
404
+ } // eslint-disable-next-line react-internal/safe-string-coercion
406
405
 
407
- if (stack !== '') {
408
- format += '%s';
409
- args = args.concat([stack]);
410
- }
411
- }
412
406
 
413
- if (isErrorLogger) {
414
- // Don't prefix our default logging formatting in ReactFiberErrorLoggger.
415
- // Don't toString the arguments.
416
- args.unshift(format);
417
- } else {
418
- // TODO: Remove this prefix and stop toStringing in the wrapper and
419
- // instead do it at each callsite as needed.
420
- // Careful: RN currently depends on this prefix
421
- // eslint-disable-next-line react-internal/safe-string-coercion
422
- args = args.map(function (item) {
423
- return String(item);
424
- });
425
- args.unshift('Warning: ' + format);
426
- } // We intentionally don't use spread (or .apply) directly because it
407
+ var argsWithFormat = args.map(function (item) {
408
+ return String(item);
409
+ }); // Careful: RN currently depends on this prefix
410
+
411
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
427
412
  // breaks IE9: https://github.com/facebook/react/issues/13610
428
413
  // eslint-disable-next-line react-internal/no-production-logging
429
414
 
430
-
431
- Function.prototype.apply.call(console[level], console, args);
415
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
432
416
  }
433
417
  }
434
418
 
@@ -2179,9 +2163,8 @@ function nullRefGetter() {
2179
2163
  }
2180
2164
  }
2181
2165
 
2182
- function createElement(response, type, key, props, owner, // DEV-only
2183
- stack, // DEV-only
2184
- validated) // DEV-only
2166
+ function createElement(type, key, props, owner, // DEV-only
2167
+ stack) // DEV-only
2185
2168
  {
2186
2169
  var element;
2187
2170
 
@@ -2209,7 +2192,7 @@ validated) // DEV-only
2209
2192
  configurable: false,
2210
2193
  enumerable: false,
2211
2194
  writable: true,
2212
- value: 1 // Whether the element has already been validated on the server.
2195
+ value: true // This element has already been validated on the server.
2213
2196
 
2214
2197
  }); // debugInfo contains Server Component debug information.
2215
2198
 
@@ -2619,7 +2602,7 @@ function parseModelTuple(response, value) {
2619
2602
  if (tuple[0] === REACT_ELEMENT_TYPE) {
2620
2603
  // TODO: Consider having React just directly accept these arrays as elements.
2621
2604
  // Or even change the ReactElement type to be an array.
2622
- return createElement(response, tuple[1], tuple[2], tuple[3], tuple[4] );
2605
+ return createElement(tuple[1], tuple[2], tuple[3], tuple[4] );
2623
2606
  }
2624
2607
 
2625
2608
  return value;
@@ -2629,7 +2612,7 @@ function missingCall() {
2629
2612
  throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
2630
2613
  }
2631
2614
 
2632
- function createResponse(bundlerConfig, moduleLoading, callServer, encodeFormAction, nonce, temporaryReferences, findSourceMapURL) {
2615
+ function createResponse(bundlerConfig, moduleLoading, callServer, encodeFormAction, nonce, temporaryReferences) {
2633
2616
  var chunks = new Map();
2634
2617
  var response = {
2635
2618
  _bundlerConfig: bundlerConfig,
@@ -2646,12 +2629,7 @@ function createResponse(bundlerConfig, moduleLoading, callServer, encodeFormActi
2646
2629
  _rowLength: 0,
2647
2630
  _buffer: [],
2648
2631
  _tempRefs: temporaryReferences
2649
- };
2650
-
2651
- {
2652
- response._debugFindSourceMapURL = findSourceMapURL;
2653
- } // Don't inline this call because it causes closure to outline the call above.
2654
-
2632
+ }; // Don't inline this call because it causes closure to outline the call above.
2655
2633
 
2656
2634
  response._fromJSON = createFromJSONCallback(response);
2657
2635
  return response;
@@ -2989,16 +2967,9 @@ function stopStream(response, id, row) {
2989
2967
 
2990
2968
  function resolveErrorDev(response, id, digest, message, stack) {
2991
2969
 
2992
- var error;
2993
-
2994
- {
2995
- // Executing Error within a native stack isn't really limited to owner stacks
2996
- // but we gate it behind the same flag for now while iterating.
2997
- // eslint-disable-next-line react-internal/prod-error-codes
2998
- error = Error(message || 'An error occurred in the Server Components render but no message was provided');
2999
- error.stack = stack;
3000
- }
3001
2970
 
2971
+ var error = new Error(message || 'An error occurred in the Server Components render but no message was provided');
2972
+ error.stack = stack;
3002
2973
  error.digest = digest;
3003
2974
  var errorWithDigest = error;
3004
2975
  var chunks = response._chunks;
@@ -3014,9 +2985,10 @@ function resolveErrorDev(response, id, digest, message, stack) {
3014
2985
  function resolveHint(response, code, model) {
3015
2986
  var hintModel = parseModel(response, model);
3016
2987
  dispatchHint(code, hintModel);
3017
- } // eslint-disable-next-line react-internal/no-production-logging
2988
+ }
3018
2989
 
3019
2990
  function resolveDebugInfo(response, id, debugInfo) {
2991
+
3020
2992
  var chunk = getChunk(response, id);
3021
2993
  var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
3022
2994
  chunkDebugInfo.push(debugInfo);
@@ -3025,16 +2997,13 @@ function resolveDebugInfo(response, id, debugInfo) {
3025
2997
  function resolveConsoleEntry(response, value) {
3026
2998
 
3027
2999
  var payload = parseModel(response, value);
3028
- var methodName = payload[0];
3000
+ var methodName = payload[0]; // TODO: Restore the fake stack before logging.
3001
+ // const stackTrace = payload[1];
3002
+ // const owner = payload[2];
3003
+
3029
3004
  var env = payload[3];
3030
3005
  var args = payload.slice(4);
3031
-
3032
- {
3033
- // Printing with stack isn't really limited to owner stacks but
3034
- // we gate it behind the same flag for now while iterating.
3035
- printToConsole(methodName, args, env);
3036
- return;
3037
- }
3006
+ printToConsole(methodName, args, env);
3038
3007
  }
3039
3008
 
3040
3009
  function mergeBuffer(buffer, lastChunk) {
@@ -3497,8 +3466,8 @@ function createServerReference(id, callServer) {
3497
3466
  }
3498
3467
 
3499
3468
  function createFromNodeStream(stream, ssrManifest, options) {
3500
- var response = createResponse(ssrManifest.moduleMap, ssrManifest.moduleLoading, noServerCall, options ? options.encodeFormAction : undefined, options && typeof options.nonce === 'string' ? options.nonce : undefined, undefined, // TODO: If encodeReply is supported, this should support temporaryReferences
3501
- options && options.findSourceMapURL ? options.findSourceMapURL : undefined);
3469
+ var response = createResponse(ssrManifest.moduleMap, ssrManifest.moduleLoading, noServerCall, options ? options.encodeFormAction : undefined, options && typeof options.nonce === 'string' ? options.nonce : undefined, undefined // TODO: If encodeReply is supported, this should support temporaryReferences
3470
+ );
3502
3471
  stream.on('data', function (chunk) {
3503
3472
  processBinaryChunk(response, chunk);
3504
3473
  });