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,49 +33,6 @@ function readFinalStringChunk(decoder, buffer) {
|
|
33
33
|
return decoder.decode(buffer);
|
34
34
|
}
|
35
35
|
|
36
|
-
// This flips color using ANSI, then sets a color styling, then resets.
|
37
|
-
var badgeFormat = '\x1b[0m\x1b[7m%c%s\x1b[0m%c '; // Same badge styling as DevTools.
|
38
|
-
|
39
|
-
var badgeStyle = // We use a fixed background if light-dark is not supported, otherwise
|
40
|
-
// we use a transparent background.
|
41
|
-
'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';
|
42
|
-
var resetStyle = '';
|
43
|
-
var pad = ' ';
|
44
|
-
function printToConsole(methodName, args, badgeName) {
|
45
|
-
var offset = 0;
|
46
|
-
|
47
|
-
switch (methodName) {
|
48
|
-
case 'dir':
|
49
|
-
case 'dirxml':
|
50
|
-
case 'groupEnd':
|
51
|
-
case 'table':
|
52
|
-
{
|
53
|
-
// These methods cannot be colorized because they don't take a formatting string.
|
54
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
55
|
-
console[methodName].apply(console, args);
|
56
|
-
return;
|
57
|
-
}
|
58
|
-
|
59
|
-
case 'assert':
|
60
|
-
{
|
61
|
-
// assert takes formatting options as the second argument.
|
62
|
-
offset = 1;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
var newArgs = args.slice(0);
|
67
|
-
|
68
|
-
if (typeof newArgs[offset] === 'string') {
|
69
|
-
newArgs.splice(offset, 1, badgeFormat + newArgs[offset], badgeStyle, pad + badgeName + pad, resetStyle);
|
70
|
-
} else {
|
71
|
-
newArgs.splice(offset, 0, badgeFormat, badgeStyle, pad + badgeName + pad, resetStyle);
|
72
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
73
|
-
|
74
|
-
|
75
|
-
console[methodName].apply(console, newArgs);
|
76
|
-
return;
|
77
|
-
}
|
78
|
-
|
79
36
|
// This is the parsed shape of the wire format which is why it is
|
80
37
|
// condensed to only the essentialy information
|
81
38
|
var ID = 0;
|
@@ -256,118 +213,120 @@ function getCrossOriginString(input) {
|
|
256
213
|
}
|
257
214
|
|
258
215
|
// This client file is in the shared folder because it applies to both SSR and browser contexts.
|
259
|
-
var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.
|
216
|
+
var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
|
260
217
|
function dispatchHint(code, model) {
|
261
218
|
var dispatcher = ReactDOMCurrentDispatcher.current;
|
262
219
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
220
|
+
if (dispatcher) {
|
221
|
+
switch (code) {
|
222
|
+
case 'D':
|
223
|
+
{
|
224
|
+
var refined = refineModel(code, model);
|
225
|
+
var href = refined;
|
226
|
+
dispatcher.prefetchDNS(href);
|
227
|
+
return;
|
228
|
+
}
|
271
229
|
|
272
|
-
|
273
|
-
|
274
|
-
|
230
|
+
case 'C':
|
231
|
+
{
|
232
|
+
var _refined = refineModel(code, model);
|
275
233
|
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
234
|
+
if (typeof _refined === 'string') {
|
235
|
+
var _href = _refined;
|
236
|
+
dispatcher.preconnect(_href);
|
237
|
+
} else {
|
238
|
+
var _href2 = _refined[0];
|
239
|
+
var crossOrigin = _refined[1];
|
240
|
+
dispatcher.preconnect(_href2, crossOrigin);
|
241
|
+
}
|
242
|
+
|
243
|
+
return;
|
283
244
|
}
|
284
245
|
|
285
|
-
|
286
|
-
|
246
|
+
case 'L':
|
247
|
+
{
|
248
|
+
var _refined2 = refineModel(code, model);
|
287
249
|
|
288
|
-
|
289
|
-
|
290
|
-
var _refined2 = refineModel(code, model);
|
250
|
+
var _href3 = _refined2[0];
|
251
|
+
var as = _refined2[1];
|
291
252
|
|
292
|
-
|
293
|
-
|
253
|
+
if (_refined2.length === 3) {
|
254
|
+
var options = _refined2[2];
|
255
|
+
dispatcher.preload(_href3, as, options);
|
256
|
+
} else {
|
257
|
+
dispatcher.preload(_href3, as);
|
258
|
+
}
|
294
259
|
|
295
|
-
|
296
|
-
var options = _refined2[2];
|
297
|
-
dispatcher.preload(_href3, as, options);
|
298
|
-
} else {
|
299
|
-
dispatcher.preload(_href3, as);
|
260
|
+
return;
|
300
261
|
}
|
301
262
|
|
302
|
-
|
303
|
-
|
263
|
+
case 'm':
|
264
|
+
{
|
265
|
+
var _refined3 = refineModel(code, model);
|
304
266
|
|
305
|
-
|
306
|
-
|
307
|
-
|
267
|
+
if (typeof _refined3 === 'string') {
|
268
|
+
var _href4 = _refined3;
|
269
|
+
dispatcher.preloadModule(_href4);
|
270
|
+
} else {
|
271
|
+
var _href5 = _refined3[0];
|
272
|
+
var _options = _refined3[1];
|
273
|
+
dispatcher.preloadModule(_href5, _options);
|
274
|
+
}
|
308
275
|
|
309
|
-
|
310
|
-
var _href4 = _refined3;
|
311
|
-
dispatcher.preloadModule(_href4);
|
312
|
-
} else {
|
313
|
-
var _href5 = _refined3[0];
|
314
|
-
var _options = _refined3[1];
|
315
|
-
dispatcher.preloadModule(_href5, _options);
|
276
|
+
return;
|
316
277
|
}
|
317
278
|
|
318
|
-
|
319
|
-
|
279
|
+
case 'S':
|
280
|
+
{
|
281
|
+
var _refined4 = refineModel(code, model);
|
320
282
|
|
321
|
-
|
322
|
-
|
323
|
-
|
283
|
+
if (typeof _refined4 === 'string') {
|
284
|
+
var _href6 = _refined4;
|
285
|
+
dispatcher.preinitStyle(_href6);
|
286
|
+
} else {
|
287
|
+
var _href7 = _refined4[0];
|
288
|
+
var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
|
324
289
|
|
325
|
-
|
326
|
-
var _href6 = _refined4;
|
327
|
-
dispatcher.preinitStyle(_href6);
|
328
|
-
} else {
|
329
|
-
var _href7 = _refined4[0];
|
330
|
-
var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
|
290
|
+
var _options2 = _refined4.length === 3 ? _refined4[2] : undefined;
|
331
291
|
|
332
|
-
|
292
|
+
dispatcher.preinitStyle(_href7, precedence, _options2);
|
293
|
+
}
|
333
294
|
|
334
|
-
|
295
|
+
return;
|
335
296
|
}
|
336
297
|
|
337
|
-
|
338
|
-
|
298
|
+
case 'X':
|
299
|
+
{
|
300
|
+
var _refined5 = refineModel(code, model);
|
339
301
|
|
340
|
-
|
341
|
-
|
342
|
-
|
302
|
+
if (typeof _refined5 === 'string') {
|
303
|
+
var _href8 = _refined5;
|
304
|
+
dispatcher.preinitScript(_href8);
|
305
|
+
} else {
|
306
|
+
var _href9 = _refined5[0];
|
307
|
+
var _options3 = _refined5[1];
|
308
|
+
dispatcher.preinitScript(_href9, _options3);
|
309
|
+
}
|
343
310
|
|
344
|
-
|
345
|
-
var _href8 = _refined5;
|
346
|
-
dispatcher.preinitScript(_href8);
|
347
|
-
} else {
|
348
|
-
var _href9 = _refined5[0];
|
349
|
-
var _options3 = _refined5[1];
|
350
|
-
dispatcher.preinitScript(_href9, _options3);
|
311
|
+
return;
|
351
312
|
}
|
352
313
|
|
353
|
-
|
354
|
-
|
314
|
+
case 'M':
|
315
|
+
{
|
316
|
+
var _refined6 = refineModel(code, model);
|
355
317
|
|
356
|
-
|
357
|
-
|
358
|
-
|
318
|
+
if (typeof _refined6 === 'string') {
|
319
|
+
var _href10 = _refined6;
|
320
|
+
dispatcher.preinitModuleScript(_href10);
|
321
|
+
} else {
|
322
|
+
var _href11 = _refined6[0];
|
323
|
+
var _options4 = _refined6[1];
|
324
|
+
dispatcher.preinitModuleScript(_href11, _options4);
|
325
|
+
}
|
359
326
|
|
360
|
-
|
361
|
-
var _href10 = _refined6;
|
362
|
-
dispatcher.preinitModuleScript(_href10);
|
363
|
-
} else {
|
364
|
-
var _href11 = _refined6[0];
|
365
|
-
var _options4 = _refined6[1];
|
366
|
-
dispatcher.preinitModuleScript(_href11, _options4);
|
327
|
+
return;
|
367
328
|
}
|
368
|
-
|
369
|
-
return;
|
370
|
-
}
|
329
|
+
}
|
371
330
|
}
|
372
331
|
} // Flow is having trouble refining the HintModels so we help it a bit.
|
373
332
|
// This should be compiled out in the production build.
|
@@ -430,12 +389,14 @@ function printWarning(level, format, args) {
|
|
430
389
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
431
390
|
// The Symbol used to tag the ReactElement-like types.
|
432
391
|
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
433
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
392
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
393
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
434
394
|
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
435
395
|
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
436
396
|
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
437
397
|
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
438
398
|
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
399
|
+
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
439
400
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
440
401
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
441
402
|
function getIteratorFn(maybeIterable) {
|
@@ -547,10 +508,6 @@ function describeValueForErrorMessage(value) {
|
|
547
508
|
return '[...]';
|
548
509
|
}
|
549
510
|
|
550
|
-
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
|
551
|
-
return describeClientReference();
|
552
|
-
}
|
553
|
-
|
554
511
|
var name = objectName(value);
|
555
512
|
|
556
513
|
if (name === 'Object') {
|
@@ -561,15 +518,7 @@ function describeValueForErrorMessage(value) {
|
|
561
518
|
}
|
562
519
|
|
563
520
|
case 'function':
|
564
|
-
|
565
|
-
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
|
566
|
-
return describeClientReference();
|
567
|
-
}
|
568
|
-
|
569
|
-
var _name = value.displayName || value.name;
|
570
|
-
|
571
|
-
return _name ? 'function ' + _name : 'function';
|
572
|
-
}
|
521
|
+
return 'function';
|
573
522
|
|
574
523
|
default:
|
575
524
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
@@ -615,12 +564,6 @@ function describeElementType(type) {
|
|
615
564
|
return '';
|
616
565
|
}
|
617
566
|
|
618
|
-
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
619
|
-
|
620
|
-
function describeClientReference(ref) {
|
621
|
-
return 'client';
|
622
|
-
}
|
623
|
-
|
624
567
|
function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
625
568
|
var objKind = objectName(objectOrArray);
|
626
569
|
|
@@ -699,8 +642,6 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
699
642
|
} else {
|
700
643
|
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
|
701
644
|
str = '<' + describeElementType(objectOrArray.type) + '/>';
|
702
|
-
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
|
703
|
-
return describeClientReference();
|
704
645
|
} else if (jsxPropsParents.has(objectOrArray)) {
|
705
646
|
// Print JSX
|
706
647
|
var _type = jsxPropsParents.get(objectOrArray);
|
@@ -751,9 +692,9 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
751
692
|
str += ', ';
|
752
693
|
}
|
753
694
|
|
754
|
-
var
|
755
|
-
str += describeKeyForErrorMessage(
|
756
|
-
var _value3 = _object[
|
695
|
+
var _name = _names[_i3];
|
696
|
+
str += describeKeyForErrorMessage(_name) + ': ';
|
697
|
+
var _value3 = _object[_name];
|
757
698
|
|
758
699
|
var _substr3 = void 0;
|
759
700
|
|
@@ -763,7 +704,7 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
763
704
|
_substr3 = describeValueForErrorMessage(_value3);
|
764
705
|
}
|
765
706
|
|
766
|
-
if (
|
707
|
+
if (_name === expandedName) {
|
767
708
|
start = str.length;
|
768
709
|
length = _substr3.length;
|
769
710
|
str += _substr3;
|
@@ -988,7 +929,7 @@ function processReply(root, formFieldPrefix, resolve, reject) {
|
|
988
929
|
error('React Element cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
989
930
|
} else if (value.$$typeof === REACT_LAZY_TYPE) {
|
990
931
|
error('React Lazy cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
991
|
-
} else if (value.$$typeof ===
|
932
|
+
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
992
933
|
error('React Context Providers cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
993
934
|
} else if (objectName(value) !== 'Object') {
|
994
935
|
error('Only plain objects can be passed to Server Functions from the Client. ' + '%s objects are not supported.%s', objectName(value), describeObjectForErrorMessage(parent, key));
|
@@ -1121,7 +1062,7 @@ function encodeFormData(reference) {
|
|
1121
1062
|
return thenable;
|
1122
1063
|
}
|
1123
1064
|
|
1124
|
-
function
|
1065
|
+
function encodeFormAction(identifierPrefix) {
|
1125
1066
|
var reference = knownServerReferences.get(this);
|
1126
1067
|
|
1127
1068
|
if (!reference) {
|
@@ -1171,22 +1112,6 @@ function defaultEncodeFormAction(identifierPrefix) {
|
|
1171
1112
|
};
|
1172
1113
|
}
|
1173
1114
|
|
1174
|
-
function customEncodeFormAction(proxy, identifierPrefix, encodeFormAction) {
|
1175
|
-
var reference = knownServerReferences.get(proxy);
|
1176
|
-
|
1177
|
-
if (!reference) {
|
1178
|
-
throw new Error('Tried to encode a Server Action from a different instance than the encoder is from. ' + 'This is a bug in React.');
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
var boundPromise = reference.bound;
|
1182
|
-
|
1183
|
-
if (boundPromise === null) {
|
1184
|
-
boundPromise = Promise.resolve([]);
|
1185
|
-
}
|
1186
|
-
|
1187
|
-
return encodeFormAction(reference.id, boundPromise);
|
1188
|
-
}
|
1189
|
-
|
1190
1115
|
function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
1191
1116
|
var reference = knownServerReferences.get(this);
|
1192
1117
|
|
@@ -1248,17 +1173,14 @@ function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
|
1248
1173
|
}
|
1249
1174
|
}
|
1250
1175
|
|
1251
|
-
function registerServerReference(proxy, reference
|
1176
|
+
function registerServerReference(proxy, reference) {
|
1252
1177
|
// Expose encoder for use by SSR, as well as a special bind that can be used to
|
1253
1178
|
// keep server capabilities.
|
1254
1179
|
{
|
1255
1180
|
// Only expose this in builds that would actually use it. Not needed on the client.
|
1256
|
-
var $$FORM_ACTION = encodeFormAction === undefined ? defaultEncodeFormAction : function (identifierPrefix) {
|
1257
|
-
return customEncodeFormAction(this, identifierPrefix, encodeFormAction);
|
1258
|
-
};
|
1259
1181
|
Object.defineProperties(proxy, {
|
1260
1182
|
$$FORM_ACTION: {
|
1261
|
-
value:
|
1183
|
+
value: encodeFormAction
|
1262
1184
|
},
|
1263
1185
|
$$IS_SIGNATURE_EQUAL: {
|
1264
1186
|
value: isSignatureEqual
|
@@ -1282,17 +1204,6 @@ function bind() {
|
|
1282
1204
|
var reference = knownServerReferences.get(this);
|
1283
1205
|
|
1284
1206
|
if (reference) {
|
1285
|
-
{
|
1286
|
-
var thisBind = arguments[0];
|
1287
|
-
|
1288
|
-
if (thisBind != null) {
|
1289
|
-
// This doesn't warn in browser environments since it's not instrumented outside
|
1290
|
-
// usedWithSSR. This makes this an SSR only warning which we don't generally do.
|
1291
|
-
// TODO: Consider a DEV only instrumentation in the browser.
|
1292
|
-
error('Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().');
|
1293
|
-
}
|
1294
|
-
}
|
1295
|
-
|
1296
1207
|
var args = ArraySlice.call(arguments, 1);
|
1297
1208
|
var boundPromise = null;
|
1298
1209
|
|
@@ -1302,26 +1213,9 @@ function bind() {
|
|
1302
1213
|
});
|
1303
1214
|
} else {
|
1304
1215
|
boundPromise = Promise.resolve(args);
|
1305
|
-
} // Expose encoder for use by SSR, as well as a special bind that can be used to
|
1306
|
-
// keep server capabilities.
|
1307
|
-
|
1308
|
-
|
1309
|
-
{
|
1310
|
-
// Only expose this in builds that would actually use it. Not needed on the client.
|
1311
|
-
Object.defineProperties(newFn, {
|
1312
|
-
$$FORM_ACTION: {
|
1313
|
-
value: this.$$FORM_ACTION
|
1314
|
-
},
|
1315
|
-
$$IS_SIGNATURE_EQUAL: {
|
1316
|
-
value: isSignatureEqual
|
1317
|
-
},
|
1318
|
-
bind: {
|
1319
|
-
value: bind
|
1320
|
-
}
|
1321
|
-
});
|
1322
1216
|
}
|
1323
1217
|
|
1324
|
-
|
1218
|
+
registerServerReference(newFn, {
|
1325
1219
|
id: reference.id,
|
1326
1220
|
bound: boundPromise
|
1327
1221
|
});
|
@@ -1330,7 +1224,7 @@ function bind() {
|
|
1330
1224
|
return newFn;
|
1331
1225
|
}
|
1332
1226
|
|
1333
|
-
function createServerReference$1(id, callServer
|
1227
|
+
function createServerReference$1(id, callServer) {
|
1334
1228
|
var proxy = function () {
|
1335
1229
|
// $FlowFixMe[method-unbinding]
|
1336
1230
|
var args = Array.prototype.slice.call(arguments);
|
@@ -1340,10 +1234,61 @@ function createServerReference$1(id, callServer, encodeFormAction) {
|
|
1340
1234
|
registerServerReference(proxy, {
|
1341
1235
|
id: id,
|
1342
1236
|
bound: null
|
1343
|
-
}
|
1237
|
+
});
|
1344
1238
|
return proxy;
|
1345
1239
|
}
|
1346
1240
|
|
1241
|
+
var ContextRegistry = ReactSharedInternals.ContextRegistry;
|
1242
|
+
function getOrCreateServerContext(globalName) {
|
1243
|
+
if (!ContextRegistry[globalName]) {
|
1244
|
+
var context = {
|
1245
|
+
$$typeof: REACT_SERVER_CONTEXT_TYPE,
|
1246
|
+
// As a workaround to support multiple concurrent renderers, we categorize
|
1247
|
+
// some renderers as primary and others as secondary. We only expect
|
1248
|
+
// there to be two concurrent renderers at most: React Native (primary) and
|
1249
|
+
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
1250
|
+
// Secondary renderers store their context values on separate fields.
|
1251
|
+
_currentValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1252
|
+
_currentValue2: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1253
|
+
_defaultValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1254
|
+
// Used to track how many concurrent renderers this context currently
|
1255
|
+
// supports within in a single renderer. Such as parallel server rendering.
|
1256
|
+
_threadCount: 0,
|
1257
|
+
// These are circular
|
1258
|
+
Provider: null,
|
1259
|
+
Consumer: null,
|
1260
|
+
_globalName: globalName
|
1261
|
+
};
|
1262
|
+
context.Provider = {
|
1263
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
1264
|
+
_context: context
|
1265
|
+
};
|
1266
|
+
|
1267
|
+
{
|
1268
|
+
var hasWarnedAboutUsingConsumer;
|
1269
|
+
context._currentRenderer = null;
|
1270
|
+
context._currentRenderer2 = null;
|
1271
|
+
Object.defineProperties(context, {
|
1272
|
+
Consumer: {
|
1273
|
+
get: function () {
|
1274
|
+
if (!hasWarnedAboutUsingConsumer) {
|
1275
|
+
error('Consumer pattern is not supported by ReactServerContext');
|
1276
|
+
|
1277
|
+
hasWarnedAboutUsingConsumer = true;
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
return null;
|
1281
|
+
}
|
1282
|
+
}
|
1283
|
+
});
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
ContextRegistry[globalName] = context;
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
return ContextRegistry[globalName];
|
1290
|
+
}
|
1291
|
+
|
1347
1292
|
var ROW_ID = 0;
|
1348
1293
|
var ROW_TAG = 1;
|
1349
1294
|
var ROW_LENGTH = 2;
|
@@ -1362,10 +1307,6 @@ function Chunk(status, value, reason, response) {
|
|
1362
1307
|
this.value = value;
|
1363
1308
|
this.reason = reason;
|
1364
1309
|
this._response = response;
|
1365
|
-
|
1366
|
-
{
|
1367
|
-
this._debugInfo = null;
|
1368
|
-
}
|
1369
1310
|
} // We subclass Promise.prototype so that we get other methods like .catch
|
1370
1311
|
|
1371
1312
|
|
@@ -1642,20 +1583,17 @@ function reportGlobalError(response, error) {
|
|
1642
1583
|
}
|
1643
1584
|
|
1644
1585
|
function createElement(type, key, props) {
|
1645
|
-
var element
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
_owner: null
|
1657
|
-
};
|
1658
|
-
}
|
1586
|
+
var element = {
|
1587
|
+
// This tag allows us to uniquely identify this as a React Element
|
1588
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
1589
|
+
// Built-in properties that belong on the element
|
1590
|
+
type: type,
|
1591
|
+
key: key,
|
1592
|
+
ref: null,
|
1593
|
+
props: props,
|
1594
|
+
// Record the component responsible for creating this element.
|
1595
|
+
_owner: null
|
1596
|
+
};
|
1659
1597
|
|
1660
1598
|
{
|
1661
1599
|
// We don't really need to add any of these but keeping them for good measure.
|
@@ -1668,12 +1606,17 @@ function createElement(type, key, props) {
|
|
1668
1606
|
writable: true,
|
1669
1607
|
value: true // This element has already been validated on the server.
|
1670
1608
|
|
1671
|
-
});
|
1672
|
-
|
1673
|
-
Object.defineProperty(element, '_debugInfo', {
|
1609
|
+
});
|
1610
|
+
Object.defineProperty(element, '_self', {
|
1674
1611
|
configurable: false,
|
1675
1612
|
enumerable: false,
|
1676
|
-
writable:
|
1613
|
+
writable: false,
|
1614
|
+
value: null
|
1615
|
+
});
|
1616
|
+
Object.defineProperty(element, '_source', {
|
1617
|
+
configurable: false,
|
1618
|
+
enumerable: false,
|
1619
|
+
writable: false,
|
1677
1620
|
value: null
|
1678
1621
|
});
|
1679
1622
|
}
|
@@ -1687,13 +1630,6 @@ function createLazyChunkWrapper(chunk) {
|
|
1687
1630
|
_payload: chunk,
|
1688
1631
|
_init: readChunk
|
1689
1632
|
};
|
1690
|
-
|
1691
|
-
{
|
1692
|
-
// Ensure we have a live array to track future debug info.
|
1693
|
-
var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
|
1694
|
-
lazyType._debugInfo = chunkDebugInfo;
|
1695
|
-
}
|
1696
|
-
|
1697
1633
|
return lazyType;
|
1698
1634
|
}
|
1699
1635
|
|
@@ -1776,7 +1712,7 @@ function createServerReferenceProxy(response, metaData) {
|
|
1776
1712
|
});
|
1777
1713
|
};
|
1778
1714
|
|
1779
|
-
registerServerReference(proxy, metaData
|
1715
|
+
registerServerReference(proxy, metaData);
|
1780
1716
|
return proxy;
|
1781
1717
|
}
|
1782
1718
|
|
@@ -1829,11 +1765,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1829
1765
|
case '@':
|
1830
1766
|
{
|
1831
1767
|
// Promise
|
1832
|
-
if (value.length === 2) {
|
1833
|
-
// Infinite promise that never resolves.
|
1834
|
-
return new Promise(function () {});
|
1835
|
-
}
|
1836
|
-
|
1837
1768
|
var _id = parseInt(value.slice(2), 16);
|
1838
1769
|
|
1839
1770
|
var _chunk = getChunk(response, _id);
|
@@ -1847,6 +1778,12 @@ function parseModelString(response, parentObject, key, value) {
|
|
1847
1778
|
return Symbol.for(value.slice(2));
|
1848
1779
|
}
|
1849
1780
|
|
1781
|
+
case 'P':
|
1782
|
+
{
|
1783
|
+
// Server Context Provider
|
1784
|
+
return getOrCreateServerContext(value.slice(2)).Provider;
|
1785
|
+
}
|
1786
|
+
|
1850
1787
|
case 'F':
|
1851
1788
|
{
|
1852
1789
|
// Server Reference
|
@@ -1916,23 +1853,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1916
1853
|
return BigInt(value.slice(2));
|
1917
1854
|
}
|
1918
1855
|
|
1919
|
-
case 'E':
|
1920
|
-
{
|
1921
|
-
{
|
1922
|
-
// In DEV mode we allow indirect eval to produce functions for logging.
|
1923
|
-
// This should not compile to eval() because then it has local scope access.
|
1924
|
-
try {
|
1925
|
-
// eslint-disable-next-line no-eval
|
1926
|
-
return (0, eval)(value.slice(2));
|
1927
|
-
} catch (x) {
|
1928
|
-
// We currently use this to express functions so we fail parsing it,
|
1929
|
-
// let's just return a blank function as a place holder.
|
1930
|
-
return function () {};
|
1931
|
-
}
|
1932
|
-
} // Fallthrough
|
1933
|
-
|
1934
|
-
}
|
1935
|
-
|
1936
1856
|
default:
|
1937
1857
|
{
|
1938
1858
|
// We assume that anything else is a reference ID.
|
@@ -1953,29 +1873,7 @@ function parseModelString(response, parentObject, key, value) {
|
|
1953
1873
|
|
1954
1874
|
switch (_chunk2.status) {
|
1955
1875
|
case INITIALIZED:
|
1956
|
-
|
1957
|
-
|
1958
|
-
if (_chunk2._debugInfo) {
|
1959
|
-
// If we have a direct reference to an object that was rendered by a synchronous
|
1960
|
-
// server component, it might have some debug info about how it was rendered.
|
1961
|
-
// We forward this to the underlying object. This might be a React Element or
|
1962
|
-
// an Array fragment.
|
1963
|
-
// If this was a string / number return value we lose the debug info. We choose
|
1964
|
-
// that tradeoff to allow sync server components to return plain values and not
|
1965
|
-
// use them as React Nodes necessarily. We could otherwise wrap them in a Lazy.
|
1966
|
-
if (typeof chunkValue === 'object' && chunkValue !== null && (Array.isArray(chunkValue) || chunkValue.$$typeof === REACT_ELEMENT_TYPE) && !chunkValue._debugInfo) {
|
1967
|
-
// We should maybe use a unique symbol for arrays but this is a React owned array.
|
1968
|
-
// $FlowFixMe[prop-missing]: This should be added to elements.
|
1969
|
-
Object.defineProperty(chunkValue, '_debugInfo', {
|
1970
|
-
configurable: false,
|
1971
|
-
enumerable: false,
|
1972
|
-
writable: true,
|
1973
|
-
value: _chunk2._debugInfo
|
1974
|
-
});
|
1975
|
-
}
|
1976
|
-
}
|
1977
|
-
|
1978
|
-
return chunkValue;
|
1876
|
+
return _chunk2.value;
|
1979
1877
|
|
1980
1878
|
case PENDING:
|
1981
1879
|
case BLOCKED:
|
@@ -2012,13 +1910,12 @@ function missingCall() {
|
|
2012
1910
|
throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
|
2013
1911
|
}
|
2014
1912
|
|
2015
|
-
function createResponse(bundlerConfig, moduleLoading, callServer,
|
1913
|
+
function createResponse(bundlerConfig, moduleLoading, callServer, nonce) {
|
2016
1914
|
var chunks = new Map();
|
2017
1915
|
var response = {
|
2018
1916
|
_bundlerConfig: bundlerConfig,
|
2019
1917
|
_moduleLoading: moduleLoading,
|
2020
1918
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
2021
|
-
_encodeFormAction: encodeFormAction,
|
2022
1919
|
_nonce: nonce,
|
2023
1920
|
_chunks: chunks,
|
2024
1921
|
_stringDecoder: createStringDecoder(),
|
@@ -2116,24 +2013,6 @@ function resolveHint(response, code, model) {
|
|
2116
2013
|
dispatchHint(code, hintModel);
|
2117
2014
|
}
|
2118
2015
|
|
2119
|
-
function resolveDebugInfo(response, id, debugInfo) {
|
2120
|
-
|
2121
|
-
var chunk = getChunk(response, id);
|
2122
|
-
var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
|
2123
|
-
chunkDebugInfo.push(debugInfo);
|
2124
|
-
}
|
2125
|
-
|
2126
|
-
function resolveConsoleEntry(response, value) {
|
2127
|
-
|
2128
|
-
var payload = parseModel(response, value);
|
2129
|
-
var methodName = payload[0]; // TODO: Restore the fake stack before logging.
|
2130
|
-
// const stackTrace = payload[1];
|
2131
|
-
|
2132
|
-
var env = payload[2];
|
2133
|
-
var args = payload.slice(3);
|
2134
|
-
printToConsole(methodName, args, env);
|
2135
|
-
}
|
2136
|
-
|
2137
2016
|
function processFullRow(response, id, tag, buffer, chunk) {
|
2138
2017
|
|
2139
2018
|
var stringDecoder = response._stringDecoder;
|
@@ -2184,28 +2063,6 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
2184
2063
|
return;
|
2185
2064
|
}
|
2186
2065
|
|
2187
|
-
case 68
|
2188
|
-
/* "D" */
|
2189
|
-
:
|
2190
|
-
{
|
2191
|
-
{
|
2192
|
-
var debugInfo = JSON.parse(row);
|
2193
|
-
resolveDebugInfo(response, id, debugInfo);
|
2194
|
-
return;
|
2195
|
-
} // Fallthrough to share the error with Console entries.
|
2196
|
-
|
2197
|
-
}
|
2198
|
-
|
2199
|
-
case 87
|
2200
|
-
/* "W" */
|
2201
|
-
:
|
2202
|
-
{
|
2203
|
-
{
|
2204
|
-
resolveConsoleEntry(response, row);
|
2205
|
-
return;
|
2206
|
-
}
|
2207
|
-
}
|
2208
|
-
|
2209
2066
|
case 80
|
2210
2067
|
/* "P" */
|
2211
2068
|
:
|
@@ -2391,7 +2248,7 @@ function createServerReference(id, callServer) {
|
|
2391
2248
|
}
|
2392
2249
|
|
2393
2250
|
function createResponseFromOptions(options) {
|
2394
|
-
return createResponse(options.ssrManifest.moduleMap, options.ssrManifest.moduleLoading, noServerCall,
|
2251
|
+
return createResponse(options.ssrManifest.moduleMap, options.ssrManifest.moduleLoading, noServerCall, typeof options.nonce === 'string' ? options.nonce : undefined);
|
2395
2252
|
}
|
2396
2253
|
|
2397
2254
|
function startReadingFromStream(response, stream) {
|