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