react-server-dom-webpack 18.3.0-canary-a870b2d54-20240314 → 18.3.0-canary-4b84f1161-20240318

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 (39) hide show
  1. package/cjs/react-server-dom-webpack-client.browser.development.js +176 -272
  2. package/cjs/react-server-dom-webpack-client.browser.production.js +146 -127
  3. package/cjs/react-server-dom-webpack-client.browser.production.min.js +25 -24
  4. package/cjs/react-server-dom-webpack-client.browser.production.min.js.map +1 -1
  5. package/cjs/react-server-dom-webpack-client.edge.development.js +181 -324
  6. package/cjs/react-server-dom-webpack-client.edge.production.js +151 -168
  7. package/cjs/react-server-dom-webpack-client.edge.production.min.js +30 -30
  8. package/cjs/react-server-dom-webpack-client.edge.production.min.js.map +1 -1
  9. package/cjs/react-server-dom-webpack-client.node.development.js +181 -324
  10. package/cjs/react-server-dom-webpack-client.node.production.js +151 -168
  11. package/cjs/react-server-dom-webpack-client.node.production.min.js +29 -28
  12. package/cjs/react-server-dom-webpack-client.node.production.min.js.map +1 -1
  13. package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +181 -324
  14. package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +151 -168
  15. package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +30 -30
  16. package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js.map +1 -1
  17. package/cjs/react-server-dom-webpack-node-register.js.map +1 -1
  18. package/cjs/react-server-dom-webpack-plugin.js.map +1 -1
  19. package/cjs/react-server-dom-webpack-server.browser.development.js +424 -587
  20. package/cjs/react-server-dom-webpack-server.browser.production.js +368 -403
  21. package/cjs/react-server-dom-webpack-server.browser.production.min.js +68 -65
  22. package/cjs/react-server-dom-webpack-server.browser.production.min.js.map +1 -1
  23. package/cjs/react-server-dom-webpack-server.edge.development.js +424 -590
  24. package/cjs/react-server-dom-webpack-server.edge.production.js +369 -407
  25. package/cjs/react-server-dom-webpack-server.edge.production.min.js +69 -67
  26. package/cjs/react-server-dom-webpack-server.edge.production.min.js.map +1 -1
  27. package/cjs/react-server-dom-webpack-server.node.development.js +423 -586
  28. package/cjs/react-server-dom-webpack-server.node.production.js +368 -403
  29. package/cjs/react-server-dom-webpack-server.node.production.min.js +72 -70
  30. package/cjs/react-server-dom-webpack-server.node.production.min.js.map +1 -1
  31. package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +423 -586
  32. package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +368 -403
  33. package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +69 -67
  34. package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js.map +1 -1
  35. package/package.json +11 -5
  36. package/umd/react-server-dom-webpack-client.browser.development.js +176 -272
  37. package/umd/react-server-dom-webpack-client.browser.production.min.js +23 -22
  38. package/umd/react-server-dom-webpack-server.browser.development.js +424 -587
  39. package/umd/react-server-dom-webpack-server.browser.production.min.js +52 -52
@@ -30,48 +30,6 @@
30
30
  return decoder.decode(buffer);
31
31
  }
32
32
 
33
- var badgeFormat = '%c%s%c '; // Same badge styling as DevTools.
34
-
35
- var badgeStyle = // We use a fixed background if light-dark is not supported, otherwise
36
- // we use a transparent background.
37
- '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';
38
- var resetStyle = '';
39
- var pad = ' ';
40
- function printToConsole(methodName, args, badgeName) {
41
- var offset = 0;
42
-
43
- switch (methodName) {
44
- case 'dir':
45
- case 'dirxml':
46
- case 'groupEnd':
47
- case 'table':
48
- {
49
- // These methods cannot be colorized because they don't take a formatting string.
50
- // eslint-disable-next-line react-internal/no-production-logging
51
- console[methodName].apply(console, args);
52
- return;
53
- }
54
-
55
- case 'assert':
56
- {
57
- // assert takes formatting options as the second argument.
58
- offset = 1;
59
- }
60
- }
61
-
62
- var newArgs = args.slice(0);
63
-
64
- if (typeof newArgs[offset] === 'string') {
65
- newArgs.splice(offset, 1, badgeFormat + newArgs[offset], badgeStyle, pad + badgeName + pad, resetStyle);
66
- } else {
67
- newArgs.splice(offset, 0, badgeFormat, badgeStyle, pad + badgeName + pad, resetStyle);
68
- } // eslint-disable-next-line react-internal/no-production-logging
69
-
70
-
71
- console[methodName].apply(console, newArgs);
72
- return;
73
- }
74
-
75
33
  // This is the parsed shape of the wire format which is why it is
76
34
  // condensed to only the essentialy information
77
35
  var ID = 0;
@@ -244,118 +202,120 @@
244
202
  var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
245
203
 
246
204
  // This client file is in the shared folder because it applies to both SSR and browser contexts.
247
- var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
205
+ var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
248
206
  function dispatchHint(code, model) {
249
207
  var dispatcher = ReactDOMCurrentDispatcher.current;
250
208
 
251
- switch (code) {
252
- case 'D':
253
- {
254
- var refined = refineModel(code, model);
255
- var href = refined;
256
- dispatcher.prefetchDNS(href);
257
- return;
258
- }
209
+ if (dispatcher) {
210
+ switch (code) {
211
+ case 'D':
212
+ {
213
+ var refined = refineModel(code, model);
214
+ var href = refined;
215
+ dispatcher.prefetchDNS(href);
216
+ return;
217
+ }
259
218
 
260
- case 'C':
261
- {
262
- var _refined = refineModel(code, model);
219
+ case 'C':
220
+ {
221
+ var _refined = refineModel(code, model);
263
222
 
264
- if (typeof _refined === 'string') {
265
- var _href = _refined;
266
- dispatcher.preconnect(_href);
267
- } else {
268
- var _href2 = _refined[0];
269
- var crossOrigin = _refined[1];
270
- dispatcher.preconnect(_href2, crossOrigin);
223
+ if (typeof _refined === 'string') {
224
+ var _href = _refined;
225
+ dispatcher.preconnect(_href);
226
+ } else {
227
+ var _href2 = _refined[0];
228
+ var crossOrigin = _refined[1];
229
+ dispatcher.preconnect(_href2, crossOrigin);
230
+ }
231
+
232
+ return;
271
233
  }
272
234
 
273
- return;
274
- }
235
+ case 'L':
236
+ {
237
+ var _refined2 = refineModel(code, model);
275
238
 
276
- case 'L':
277
- {
278
- var _refined2 = refineModel(code, model);
239
+ var _href3 = _refined2[0];
240
+ var as = _refined2[1];
279
241
 
280
- var _href3 = _refined2[0];
281
- var as = _refined2[1];
242
+ if (_refined2.length === 3) {
243
+ var options = _refined2[2];
244
+ dispatcher.preload(_href3, as, options);
245
+ } else {
246
+ dispatcher.preload(_href3, as);
247
+ }
282
248
 
283
- if (_refined2.length === 3) {
284
- var options = _refined2[2];
285
- dispatcher.preload(_href3, as, options);
286
- } else {
287
- dispatcher.preload(_href3, as);
249
+ return;
288
250
  }
289
251
 
290
- return;
291
- }
252
+ case 'm':
253
+ {
254
+ var _refined3 = refineModel(code, model);
292
255
 
293
- case 'm':
294
- {
295
- var _refined3 = refineModel(code, model);
256
+ if (typeof _refined3 === 'string') {
257
+ var _href4 = _refined3;
258
+ dispatcher.preloadModule(_href4);
259
+ } else {
260
+ var _href5 = _refined3[0];
261
+ var _options = _refined3[1];
262
+ dispatcher.preloadModule(_href5, _options);
263
+ }
296
264
 
297
- if (typeof _refined3 === 'string') {
298
- var _href4 = _refined3;
299
- dispatcher.preloadModule(_href4);
300
- } else {
301
- var _href5 = _refined3[0];
302
- var _options = _refined3[1];
303
- dispatcher.preloadModule(_href5, _options);
265
+ return;
304
266
  }
305
267
 
306
- return;
307
- }
268
+ case 'S':
269
+ {
270
+ var _refined4 = refineModel(code, model);
308
271
 
309
- case 'S':
310
- {
311
- var _refined4 = refineModel(code, model);
272
+ if (typeof _refined4 === 'string') {
273
+ var _href6 = _refined4;
274
+ dispatcher.preinitStyle(_href6);
275
+ } else {
276
+ var _href7 = _refined4[0];
277
+ var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
312
278
 
313
- if (typeof _refined4 === 'string') {
314
- var _href6 = _refined4;
315
- dispatcher.preinitStyle(_href6);
316
- } else {
317
- var _href7 = _refined4[0];
318
- var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
279
+ var _options2 = _refined4.length === 3 ? _refined4[2] : undefined;
319
280
 
320
- var _options2 = _refined4.length === 3 ? _refined4[2] : undefined;
281
+ dispatcher.preinitStyle(_href7, precedence, _options2);
282
+ }
321
283
 
322
- dispatcher.preinitStyle(_href7, precedence, _options2);
284
+ return;
323
285
  }
324
286
 
325
- return;
326
- }
287
+ case 'X':
288
+ {
289
+ var _refined5 = refineModel(code, model);
327
290
 
328
- case 'X':
329
- {
330
- var _refined5 = refineModel(code, model);
291
+ if (typeof _refined5 === 'string') {
292
+ var _href8 = _refined5;
293
+ dispatcher.preinitScript(_href8);
294
+ } else {
295
+ var _href9 = _refined5[0];
296
+ var _options3 = _refined5[1];
297
+ dispatcher.preinitScript(_href9, _options3);
298
+ }
331
299
 
332
- if (typeof _refined5 === 'string') {
333
- var _href8 = _refined5;
334
- dispatcher.preinitScript(_href8);
335
- } else {
336
- var _href9 = _refined5[0];
337
- var _options3 = _refined5[1];
338
- dispatcher.preinitScript(_href9, _options3);
300
+ return;
339
301
  }
340
302
 
341
- return;
342
- }
303
+ case 'M':
304
+ {
305
+ var _refined6 = refineModel(code, model);
343
306
 
344
- case 'M':
345
- {
346
- var _refined6 = refineModel(code, model);
307
+ if (typeof _refined6 === 'string') {
308
+ var _href10 = _refined6;
309
+ dispatcher.preinitModuleScript(_href10);
310
+ } else {
311
+ var _href11 = _refined6[0];
312
+ var _options4 = _refined6[1];
313
+ dispatcher.preinitModuleScript(_href11, _options4);
314
+ }
347
315
 
348
- if (typeof _refined6 === 'string') {
349
- var _href10 = _refined6;
350
- dispatcher.preinitModuleScript(_href10);
351
- } else {
352
- var _href11 = _refined6[0];
353
- var _options4 = _refined6[1];
354
- dispatcher.preinitModuleScript(_href11, _options4);
316
+ return;
355
317
  }
356
-
357
- return;
358
- }
318
+ }
359
319
  }
360
320
  } // Flow is having trouble refining the HintModels so we help it a bit.
361
321
  // This should be compiled out in the production build.
@@ -408,12 +368,14 @@
408
368
  // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
409
369
  // The Symbol used to tag the ReactElement-like types.
410
370
  var REACT_ELEMENT_TYPE = Symbol.for('react.element');
411
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
371
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
372
+ var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
412
373
  var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
413
374
  var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
414
375
  var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
415
376
  var REACT_MEMO_TYPE = Symbol.for('react.memo');
416
377
  var REACT_LAZY_TYPE = Symbol.for('react.lazy');
378
+ var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
417
379
  var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
418
380
  var FAUX_ITERATOR_SYMBOL = '@@iterator';
419
381
  function getIteratorFn(maybeIterable) {
@@ -525,10 +487,6 @@
525
487
  return '[...]';
526
488
  }
527
489
 
528
- if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
529
- return describeClientReference();
530
- }
531
-
532
490
  var name = objectName(value);
533
491
 
534
492
  if (name === 'Object') {
@@ -539,15 +497,7 @@
539
497
  }
540
498
 
541
499
  case 'function':
542
- {
543
- if (value.$$typeof === CLIENT_REFERENCE_TAG) {
544
- return describeClientReference();
545
- }
546
-
547
- var _name = value.displayName || value.name;
548
-
549
- return _name ? 'function ' + _name : 'function';
550
- }
500
+ return 'function';
551
501
 
552
502
  default:
553
503
  // eslint-disable-next-line react-internal/safe-string-coercion
@@ -593,12 +543,6 @@
593
543
  return '';
594
544
  }
595
545
 
596
- var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
597
-
598
- function describeClientReference(ref) {
599
- return 'client';
600
- }
601
-
602
546
  function describeObjectForErrorMessage(objectOrArray, expandedName) {
603
547
  var objKind = objectName(objectOrArray);
604
548
 
@@ -677,8 +621,6 @@
677
621
  } else {
678
622
  if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
679
623
  str = '<' + describeElementType(objectOrArray.type) + '/>';
680
- } else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
681
- return describeClientReference();
682
624
  } else if (jsxPropsParents.has(objectOrArray)) {
683
625
  // Print JSX
684
626
  var _type = jsxPropsParents.get(objectOrArray);
@@ -729,9 +671,9 @@
729
671
  str += ', ';
730
672
  }
731
673
 
732
- var _name2 = _names[_i3];
733
- str += describeKeyForErrorMessage(_name2) + ': ';
734
- var _value3 = _object[_name2];
674
+ var _name = _names[_i3];
675
+ str += describeKeyForErrorMessage(_name) + ': ';
676
+ var _value3 = _object[_name];
735
677
 
736
678
  var _substr3 = void 0;
737
679
 
@@ -741,7 +683,7 @@
741
683
  _substr3 = describeValueForErrorMessage(_value3);
742
684
  }
743
685
 
744
- if (_name2 === expandedName) {
686
+ if (_name === expandedName) {
745
687
  start = str.length;
746
688
  length = _substr3.length;
747
689
  str += _substr3;
@@ -966,7 +908,7 @@
966
908
  error('React Element cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
967
909
  } else if (value.$$typeof === REACT_LAZY_TYPE) {
968
910
  error('React Lazy cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
969
- } else if (value.$$typeof === (REACT_PROVIDER_TYPE)) {
911
+ } else if (value.$$typeof === REACT_PROVIDER_TYPE) {
970
912
  error('React Context Providers cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
971
913
  } else if (objectName(value) !== 'Object') {
972
914
  error('Only plain objects can be passed to Server Functions from the Client. ' + '%s objects are not supported.%s', objectName(value), describeObjectForErrorMessage(parent, key));
@@ -1070,12 +1012,12 @@
1070
1012
  }
1071
1013
  }
1072
1014
 
1073
- function registerServerReference(proxy, reference, encodeFormAction) {
1015
+ function registerServerReference(proxy, reference) {
1074
1016
 
1075
1017
  knownServerReferences.set(proxy, reference);
1076
1018
  } // $FlowFixMe[method-unbinding]
1077
1019
 
1078
- function createServerReference(id, callServer, encodeFormAction) {
1020
+ function createServerReference(id, callServer) {
1079
1021
  var proxy = function () {
1080
1022
  // $FlowFixMe[method-unbinding]
1081
1023
  var args = Array.prototype.slice.call(arguments);
@@ -1089,6 +1031,57 @@
1089
1031
  return proxy;
1090
1032
  }
1091
1033
 
1034
+ var ContextRegistry = ReactSharedInternals.ContextRegistry;
1035
+ function getOrCreateServerContext(globalName) {
1036
+ if (!ContextRegistry[globalName]) {
1037
+ var context = {
1038
+ $$typeof: REACT_SERVER_CONTEXT_TYPE,
1039
+ // As a workaround to support multiple concurrent renderers, we categorize
1040
+ // some renderers as primary and others as secondary. We only expect
1041
+ // there to be two concurrent renderers at most: React Native (primary) and
1042
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1043
+ // Secondary renderers store their context values on separate fields.
1044
+ _currentValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
1045
+ _currentValue2: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
1046
+ _defaultValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
1047
+ // Used to track how many concurrent renderers this context currently
1048
+ // supports within in a single renderer. Such as parallel server rendering.
1049
+ _threadCount: 0,
1050
+ // These are circular
1051
+ Provider: null,
1052
+ Consumer: null,
1053
+ _globalName: globalName
1054
+ };
1055
+ context.Provider = {
1056
+ $$typeof: REACT_PROVIDER_TYPE,
1057
+ _context: context
1058
+ };
1059
+
1060
+ {
1061
+ var hasWarnedAboutUsingConsumer;
1062
+ context._currentRenderer = null;
1063
+ context._currentRenderer2 = null;
1064
+ Object.defineProperties(context, {
1065
+ Consumer: {
1066
+ get: function () {
1067
+ if (!hasWarnedAboutUsingConsumer) {
1068
+ error('Consumer pattern is not supported by ReactServerContext');
1069
+
1070
+ hasWarnedAboutUsingConsumer = true;
1071
+ }
1072
+
1073
+ return null;
1074
+ }
1075
+ }
1076
+ });
1077
+ }
1078
+
1079
+ ContextRegistry[globalName] = context;
1080
+ }
1081
+
1082
+ return ContextRegistry[globalName];
1083
+ }
1084
+
1092
1085
  var ROW_ID = 0;
1093
1086
  var ROW_TAG = 1;
1094
1087
  var ROW_LENGTH = 2;
@@ -1107,10 +1100,6 @@
1107
1100
  this.value = value;
1108
1101
  this.reason = reason;
1109
1102
  this._response = response;
1110
-
1111
- {
1112
- this._debugInfo = null;
1113
- }
1114
1103
  } // We subclass Promise.prototype so that we get other methods like .catch
1115
1104
 
1116
1105
 
@@ -1387,20 +1376,17 @@
1387
1376
  }
1388
1377
 
1389
1378
  function createElement(type, key, props) {
1390
- var element;
1391
-
1392
- {
1393
- element = {
1394
- // This tag allows us to uniquely identify this as a React Element
1395
- $$typeof: REACT_ELEMENT_TYPE,
1396
- type: type,
1397
- key: key,
1398
- ref: null,
1399
- props: props,
1400
- // Record the component responsible for creating this element.
1401
- _owner: null
1402
- };
1403
- }
1379
+ var element = {
1380
+ // This tag allows us to uniquely identify this as a React Element
1381
+ $$typeof: REACT_ELEMENT_TYPE,
1382
+ // Built-in properties that belong on the element
1383
+ type: type,
1384
+ key: key,
1385
+ ref: null,
1386
+ props: props,
1387
+ // Record the component responsible for creating this element.
1388
+ _owner: null
1389
+ };
1404
1390
 
1405
1391
  {
1406
1392
  // We don't really need to add any of these but keeping them for good measure.
@@ -1413,12 +1399,17 @@
1413
1399
  writable: true,
1414
1400
  value: true // This element has already been validated on the server.
1415
1401
 
1416
- }); // debugInfo contains Server Component debug information.
1417
-
1418
- Object.defineProperty(element, '_debugInfo', {
1402
+ });
1403
+ Object.defineProperty(element, '_self', {
1419
1404
  configurable: false,
1420
1405
  enumerable: false,
1421
- writable: true,
1406
+ writable: false,
1407
+ value: null
1408
+ });
1409
+ Object.defineProperty(element, '_source', {
1410
+ configurable: false,
1411
+ enumerable: false,
1412
+ writable: false,
1422
1413
  value: null
1423
1414
  });
1424
1415
  }
@@ -1432,13 +1423,6 @@
1432
1423
  _payload: chunk,
1433
1424
  _init: readChunk
1434
1425
  };
1435
-
1436
- {
1437
- // Ensure we have a live array to track future debug info.
1438
- var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
1439
- lazyType._debugInfo = chunkDebugInfo;
1440
- }
1441
-
1442
1426
  return lazyType;
1443
1427
  }
1444
1428
 
@@ -1574,11 +1558,6 @@
1574
1558
  case '@':
1575
1559
  {
1576
1560
  // Promise
1577
- if (value.length === 2) {
1578
- // Infinite promise that never resolves.
1579
- return new Promise(function () {});
1580
- }
1581
-
1582
1561
  var _id = parseInt(value.slice(2), 16);
1583
1562
 
1584
1563
  var _chunk = getChunk(response, _id);
@@ -1592,6 +1571,12 @@
1592
1571
  return Symbol.for(value.slice(2));
1593
1572
  }
1594
1573
 
1574
+ case 'P':
1575
+ {
1576
+ // Server Context Provider
1577
+ return getOrCreateServerContext(value.slice(2)).Provider;
1578
+ }
1579
+
1595
1580
  case 'F':
1596
1581
  {
1597
1582
  // Server Reference
@@ -1661,23 +1646,6 @@
1661
1646
  return BigInt(value.slice(2));
1662
1647
  }
1663
1648
 
1664
- case 'E':
1665
- {
1666
- {
1667
- // In DEV mode we allow indirect eval to produce functions for logging.
1668
- // This should not compile to eval() because then it has local scope access.
1669
- try {
1670
- // eslint-disable-next-line no-eval
1671
- return (0, eval)(value.slice(2));
1672
- } catch (x) {
1673
- // We currently use this to express functions so we fail parsing it,
1674
- // let's just return a blank function as a place holder.
1675
- return function () {};
1676
- }
1677
- } // Fallthrough
1678
-
1679
- }
1680
-
1681
1649
  default:
1682
1650
  {
1683
1651
  // We assume that anything else is a reference ID.
@@ -1698,29 +1666,7 @@
1698
1666
 
1699
1667
  switch (_chunk2.status) {
1700
1668
  case INITIALIZED:
1701
- var chunkValue = _chunk2.value;
1702
-
1703
- if (_chunk2._debugInfo) {
1704
- // If we have a direct reference to an object that was rendered by a synchronous
1705
- // server component, it might have some debug info about how it was rendered.
1706
- // We forward this to the underlying object. This might be a React Element or
1707
- // an Array fragment.
1708
- // If this was a string / number return value we lose the debug info. We choose
1709
- // that tradeoff to allow sync server components to return plain values and not
1710
- // use them as React Nodes necessarily. We could otherwise wrap them in a Lazy.
1711
- if (typeof chunkValue === 'object' && chunkValue !== null && (Array.isArray(chunkValue) || chunkValue.$$typeof === REACT_ELEMENT_TYPE) && !chunkValue._debugInfo) {
1712
- // We should maybe use a unique symbol for arrays but this is a React owned array.
1713
- // $FlowFixMe[prop-missing]: This should be added to elements.
1714
- Object.defineProperty(chunkValue, '_debugInfo', {
1715
- configurable: false,
1716
- enumerable: false,
1717
- writable: true,
1718
- value: _chunk2._debugInfo
1719
- });
1720
- }
1721
- }
1722
-
1723
- return chunkValue;
1669
+ return _chunk2.value;
1724
1670
 
1725
1671
  case PENDING:
1726
1672
  case BLOCKED:
@@ -1757,13 +1703,12 @@
1757
1703
  throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
1758
1704
  }
1759
1705
 
1760
- function createResponse(bundlerConfig, moduleLoading, callServer, encodeFormAction, nonce) {
1706
+ function createResponse(bundlerConfig, moduleLoading, callServer, nonce) {
1761
1707
  var chunks = new Map();
1762
1708
  var response = {
1763
1709
  _bundlerConfig: bundlerConfig,
1764
1710
  _moduleLoading: moduleLoading,
1765
1711
  _callServer: callServer !== undefined ? callServer : missingCall,
1766
- _encodeFormAction: encodeFormAction,
1767
1712
  _nonce: nonce,
1768
1713
  _chunks: chunks,
1769
1714
  _stringDecoder: createStringDecoder(),
@@ -1860,24 +1805,6 @@
1860
1805
  dispatchHint(code, hintModel);
1861
1806
  }
1862
1807
 
1863
- function resolveDebugInfo(response, id, debugInfo) {
1864
-
1865
- var chunk = getChunk(response, id);
1866
- var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
1867
- chunkDebugInfo.push(debugInfo);
1868
- }
1869
-
1870
- function resolveConsoleEntry(response, value) {
1871
-
1872
- var payload = parseModel(response, value);
1873
- var methodName = payload[0]; // TODO: Restore the fake stack before logging.
1874
- // const stackTrace = payload[1];
1875
-
1876
- var env = payload[2];
1877
- var args = payload.slice(3);
1878
- printToConsole(methodName, args, env);
1879
- }
1880
-
1881
1808
  function processFullRow(response, id, tag, buffer, chunk) {
1882
1809
 
1883
1810
  var stringDecoder = response._stringDecoder;
@@ -1928,28 +1855,6 @@
1928
1855
  return;
1929
1856
  }
1930
1857
 
1931
- case 68
1932
- /* "D" */
1933
- :
1934
- {
1935
- {
1936
- var debugInfo = JSON.parse(row);
1937
- resolveDebugInfo(response, id, debugInfo);
1938
- return;
1939
- } // Fallthrough to share the error with Console entries.
1940
-
1941
- }
1942
-
1943
- case 87
1944
- /* "W" */
1945
- :
1946
- {
1947
- {
1948
- resolveConsoleEntry(response, row);
1949
- return;
1950
- }
1951
- }
1952
-
1953
1858
  case 80
1954
1859
  /* "P" */
1955
1860
  :
@@ -2127,8 +2032,7 @@
2127
2032
  }
2128
2033
 
2129
2034
  function createResponseFromOptions(options) {
2130
- return createResponse(null, null, options && options.callServer ? options.callServer : undefined, undefined, // encodeFormAction
2131
- undefined // nonce
2035
+ return createResponse(null, null, options && options.callServer ? options.callServer : undefined, undefined // nonce
2132
2036
  );
2133
2037
  }
2134
2038