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
@@ -34,49 +34,6 @@ function readFinalStringChunk(decoder, buffer) {
|
|
34
34
|
return decoder.decode(buffer);
|
35
35
|
}
|
36
36
|
|
37
|
-
// This flips color using ANSI, then sets a color styling, then resets.
|
38
|
-
var badgeFormat = '\x1b[0m\x1b[7m%c%s\x1b[0m%c '; // Same badge styling as DevTools.
|
39
|
-
|
40
|
-
var badgeStyle = // We use a fixed background if light-dark is not supported, otherwise
|
41
|
-
// we use a transparent background.
|
42
|
-
'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';
|
43
|
-
var resetStyle = '';
|
44
|
-
var pad = ' ';
|
45
|
-
function printToConsole(methodName, args, badgeName) {
|
46
|
-
var offset = 0;
|
47
|
-
|
48
|
-
switch (methodName) {
|
49
|
-
case 'dir':
|
50
|
-
case 'dirxml':
|
51
|
-
case 'groupEnd':
|
52
|
-
case 'table':
|
53
|
-
{
|
54
|
-
// These methods cannot be colorized because they don't take a formatting string.
|
55
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
56
|
-
console[methodName].apply(console, args);
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
|
60
|
-
case 'assert':
|
61
|
-
{
|
62
|
-
// assert takes formatting options as the second argument.
|
63
|
-
offset = 1;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
var newArgs = args.slice(0);
|
68
|
-
|
69
|
-
if (typeof newArgs[offset] === 'string') {
|
70
|
-
newArgs.splice(offset, 1, badgeFormat + newArgs[offset], badgeStyle, pad + badgeName + pad, resetStyle);
|
71
|
-
} else {
|
72
|
-
newArgs.splice(offset, 0, badgeFormat, badgeStyle, pad + badgeName + pad, resetStyle);
|
73
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
74
|
-
|
75
|
-
|
76
|
-
console[methodName].apply(console, newArgs);
|
77
|
-
return;
|
78
|
-
}
|
79
|
-
|
80
37
|
// This is the parsed shape of the wire format which is why it is
|
81
38
|
// condensed to only the essentialy information
|
82
39
|
var ID = 0;
|
@@ -210,118 +167,120 @@ function getCrossOriginString(input) {
|
|
210
167
|
}
|
211
168
|
|
212
169
|
// This client file is in the shared folder because it applies to both SSR and browser contexts.
|
213
|
-
var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.
|
170
|
+
var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
|
214
171
|
function dispatchHint(code, model) {
|
215
172
|
var dispatcher = ReactDOMCurrentDispatcher.current;
|
216
173
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
174
|
+
if (dispatcher) {
|
175
|
+
switch (code) {
|
176
|
+
case 'D':
|
177
|
+
{
|
178
|
+
var refined = refineModel(code, model);
|
179
|
+
var href = refined;
|
180
|
+
dispatcher.prefetchDNS(href);
|
181
|
+
return;
|
182
|
+
}
|
225
183
|
|
226
|
-
|
227
|
-
|
228
|
-
|
184
|
+
case 'C':
|
185
|
+
{
|
186
|
+
var _refined = refineModel(code, model);
|
229
187
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
188
|
+
if (typeof _refined === 'string') {
|
189
|
+
var _href = _refined;
|
190
|
+
dispatcher.preconnect(_href);
|
191
|
+
} else {
|
192
|
+
var _href2 = _refined[0];
|
193
|
+
var crossOrigin = _refined[1];
|
194
|
+
dispatcher.preconnect(_href2, crossOrigin);
|
195
|
+
}
|
196
|
+
|
197
|
+
return;
|
237
198
|
}
|
238
199
|
|
239
|
-
|
240
|
-
|
200
|
+
case 'L':
|
201
|
+
{
|
202
|
+
var _refined2 = refineModel(code, model);
|
241
203
|
|
242
|
-
|
243
|
-
|
244
|
-
var _refined2 = refineModel(code, model);
|
204
|
+
var _href3 = _refined2[0];
|
205
|
+
var as = _refined2[1];
|
245
206
|
|
246
|
-
|
247
|
-
|
207
|
+
if (_refined2.length === 3) {
|
208
|
+
var options = _refined2[2];
|
209
|
+
dispatcher.preload(_href3, as, options);
|
210
|
+
} else {
|
211
|
+
dispatcher.preload(_href3, as);
|
212
|
+
}
|
248
213
|
|
249
|
-
|
250
|
-
var options = _refined2[2];
|
251
|
-
dispatcher.preload(_href3, as, options);
|
252
|
-
} else {
|
253
|
-
dispatcher.preload(_href3, as);
|
214
|
+
return;
|
254
215
|
}
|
255
216
|
|
256
|
-
|
257
|
-
|
217
|
+
case 'm':
|
218
|
+
{
|
219
|
+
var _refined3 = refineModel(code, model);
|
258
220
|
|
259
|
-
|
260
|
-
|
261
|
-
|
221
|
+
if (typeof _refined3 === 'string') {
|
222
|
+
var _href4 = _refined3;
|
223
|
+
dispatcher.preloadModule(_href4);
|
224
|
+
} else {
|
225
|
+
var _href5 = _refined3[0];
|
226
|
+
var _options = _refined3[1];
|
227
|
+
dispatcher.preloadModule(_href5, _options);
|
228
|
+
}
|
262
229
|
|
263
|
-
|
264
|
-
var _href4 = _refined3;
|
265
|
-
dispatcher.preloadModule(_href4);
|
266
|
-
} else {
|
267
|
-
var _href5 = _refined3[0];
|
268
|
-
var _options = _refined3[1];
|
269
|
-
dispatcher.preloadModule(_href5, _options);
|
230
|
+
return;
|
270
231
|
}
|
271
232
|
|
272
|
-
|
273
|
-
|
233
|
+
case 'S':
|
234
|
+
{
|
235
|
+
var _refined4 = refineModel(code, model);
|
274
236
|
|
275
|
-
|
276
|
-
|
277
|
-
|
237
|
+
if (typeof _refined4 === 'string') {
|
238
|
+
var _href6 = _refined4;
|
239
|
+
dispatcher.preinitStyle(_href6);
|
240
|
+
} else {
|
241
|
+
var _href7 = _refined4[0];
|
242
|
+
var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
|
278
243
|
|
279
|
-
|
280
|
-
var _href6 = _refined4;
|
281
|
-
dispatcher.preinitStyle(_href6);
|
282
|
-
} else {
|
283
|
-
var _href7 = _refined4[0];
|
284
|
-
var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
|
244
|
+
var _options2 = _refined4.length === 3 ? _refined4[2] : undefined;
|
285
245
|
|
286
|
-
|
246
|
+
dispatcher.preinitStyle(_href7, precedence, _options2);
|
247
|
+
}
|
287
248
|
|
288
|
-
|
249
|
+
return;
|
289
250
|
}
|
290
251
|
|
291
|
-
|
292
|
-
|
252
|
+
case 'X':
|
253
|
+
{
|
254
|
+
var _refined5 = refineModel(code, model);
|
293
255
|
|
294
|
-
|
295
|
-
|
296
|
-
|
256
|
+
if (typeof _refined5 === 'string') {
|
257
|
+
var _href8 = _refined5;
|
258
|
+
dispatcher.preinitScript(_href8);
|
259
|
+
} else {
|
260
|
+
var _href9 = _refined5[0];
|
261
|
+
var _options3 = _refined5[1];
|
262
|
+
dispatcher.preinitScript(_href9, _options3);
|
263
|
+
}
|
297
264
|
|
298
|
-
|
299
|
-
var _href8 = _refined5;
|
300
|
-
dispatcher.preinitScript(_href8);
|
301
|
-
} else {
|
302
|
-
var _href9 = _refined5[0];
|
303
|
-
var _options3 = _refined5[1];
|
304
|
-
dispatcher.preinitScript(_href9, _options3);
|
265
|
+
return;
|
305
266
|
}
|
306
267
|
|
307
|
-
|
308
|
-
|
268
|
+
case 'M':
|
269
|
+
{
|
270
|
+
var _refined6 = refineModel(code, model);
|
309
271
|
|
310
|
-
|
311
|
-
|
312
|
-
|
272
|
+
if (typeof _refined6 === 'string') {
|
273
|
+
var _href10 = _refined6;
|
274
|
+
dispatcher.preinitModuleScript(_href10);
|
275
|
+
} else {
|
276
|
+
var _href11 = _refined6[0];
|
277
|
+
var _options4 = _refined6[1];
|
278
|
+
dispatcher.preinitModuleScript(_href11, _options4);
|
279
|
+
}
|
313
280
|
|
314
|
-
|
315
|
-
var _href10 = _refined6;
|
316
|
-
dispatcher.preinitModuleScript(_href10);
|
317
|
-
} else {
|
318
|
-
var _href11 = _refined6[0];
|
319
|
-
var _options4 = _refined6[1];
|
320
|
-
dispatcher.preinitModuleScript(_href11, _options4);
|
281
|
+
return;
|
321
282
|
}
|
322
|
-
|
323
|
-
return;
|
324
|
-
}
|
283
|
+
}
|
325
284
|
}
|
326
285
|
} // Flow is having trouble refining the HintModels so we help it a bit.
|
327
286
|
// This should be compiled out in the production build.
|
@@ -384,12 +343,14 @@ function printWarning(level, format, args) {
|
|
384
343
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
385
344
|
// The Symbol used to tag the ReactElement-like types.
|
386
345
|
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
387
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
346
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
347
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
388
348
|
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
389
349
|
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
390
350
|
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
391
351
|
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
392
352
|
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
353
|
+
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
393
354
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
394
355
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
395
356
|
function getIteratorFn(maybeIterable) {
|
@@ -501,10 +462,6 @@ function describeValueForErrorMessage(value) {
|
|
501
462
|
return '[...]';
|
502
463
|
}
|
503
464
|
|
504
|
-
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
|
505
|
-
return describeClientReference();
|
506
|
-
}
|
507
|
-
|
508
465
|
var name = objectName(value);
|
509
466
|
|
510
467
|
if (name === 'Object') {
|
@@ -515,15 +472,7 @@ function describeValueForErrorMessage(value) {
|
|
515
472
|
}
|
516
473
|
|
517
474
|
case 'function':
|
518
|
-
|
519
|
-
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
|
520
|
-
return describeClientReference();
|
521
|
-
}
|
522
|
-
|
523
|
-
var _name = value.displayName || value.name;
|
524
|
-
|
525
|
-
return _name ? 'function ' + _name : 'function';
|
526
|
-
}
|
475
|
+
return 'function';
|
527
476
|
|
528
477
|
default:
|
529
478
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
@@ -569,12 +518,6 @@ function describeElementType(type) {
|
|
569
518
|
return '';
|
570
519
|
}
|
571
520
|
|
572
|
-
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
573
|
-
|
574
|
-
function describeClientReference(ref) {
|
575
|
-
return 'client';
|
576
|
-
}
|
577
|
-
|
578
521
|
function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
579
522
|
var objKind = objectName(objectOrArray);
|
580
523
|
|
@@ -653,8 +596,6 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
653
596
|
} else {
|
654
597
|
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
|
655
598
|
str = '<' + describeElementType(objectOrArray.type) + '/>';
|
656
|
-
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
|
657
|
-
return describeClientReference();
|
658
599
|
} else if (jsxPropsParents.has(objectOrArray)) {
|
659
600
|
// Print JSX
|
660
601
|
var _type = jsxPropsParents.get(objectOrArray);
|
@@ -705,9 +646,9 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
705
646
|
str += ', ';
|
706
647
|
}
|
707
648
|
|
708
|
-
var
|
709
|
-
str += describeKeyForErrorMessage(
|
710
|
-
var _value3 = _object[
|
649
|
+
var _name = _names[_i3];
|
650
|
+
str += describeKeyForErrorMessage(_name) + ': ';
|
651
|
+
var _value3 = _object[_name];
|
711
652
|
|
712
653
|
var _substr3 = void 0;
|
713
654
|
|
@@ -717,7 +658,7 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
717
658
|
_substr3 = describeValueForErrorMessage(_value3);
|
718
659
|
}
|
719
660
|
|
720
|
-
if (
|
661
|
+
if (_name === expandedName) {
|
721
662
|
start = str.length;
|
722
663
|
length = _substr3.length;
|
723
664
|
str += _substr3;
|
@@ -942,7 +883,7 @@ function processReply(root, formFieldPrefix, resolve, reject) {
|
|
942
883
|
error('React Element cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
943
884
|
} else if (value.$$typeof === REACT_LAZY_TYPE) {
|
944
885
|
error('React Lazy cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
945
|
-
} else if (value.$$typeof ===
|
886
|
+
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
946
887
|
error('React Context Providers cannot be passed to Server Functions from the Client.%s', describeObjectForErrorMessage(parent, key));
|
947
888
|
} else if (objectName(value) !== 'Object') {
|
948
889
|
error('Only plain objects can be passed to Server Functions from the Client. ' + '%s objects are not supported.%s', objectName(value), describeObjectForErrorMessage(parent, key));
|
@@ -1075,7 +1016,7 @@ function encodeFormData(reference) {
|
|
1075
1016
|
return thenable;
|
1076
1017
|
}
|
1077
1018
|
|
1078
|
-
function
|
1019
|
+
function encodeFormAction(identifierPrefix) {
|
1079
1020
|
var reference = knownServerReferences.get(this);
|
1080
1021
|
|
1081
1022
|
if (!reference) {
|
@@ -1125,22 +1066,6 @@ function defaultEncodeFormAction(identifierPrefix) {
|
|
1125
1066
|
};
|
1126
1067
|
}
|
1127
1068
|
|
1128
|
-
function customEncodeFormAction(proxy, identifierPrefix, encodeFormAction) {
|
1129
|
-
var reference = knownServerReferences.get(proxy);
|
1130
|
-
|
1131
|
-
if (!reference) {
|
1132
|
-
throw new Error('Tried to encode a Server Action from a different instance than the encoder is from. ' + 'This is a bug in React.');
|
1133
|
-
}
|
1134
|
-
|
1135
|
-
var boundPromise = reference.bound;
|
1136
|
-
|
1137
|
-
if (boundPromise === null) {
|
1138
|
-
boundPromise = Promise.resolve([]);
|
1139
|
-
}
|
1140
|
-
|
1141
|
-
return encodeFormAction(reference.id, boundPromise);
|
1142
|
-
}
|
1143
|
-
|
1144
1069
|
function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
1145
1070
|
var reference = knownServerReferences.get(this);
|
1146
1071
|
|
@@ -1202,17 +1127,14 @@ function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
|
1202
1127
|
}
|
1203
1128
|
}
|
1204
1129
|
|
1205
|
-
function registerServerReference(proxy, reference
|
1130
|
+
function registerServerReference(proxy, reference) {
|
1206
1131
|
// Expose encoder for use by SSR, as well as a special bind that can be used to
|
1207
1132
|
// keep server capabilities.
|
1208
1133
|
{
|
1209
1134
|
// Only expose this in builds that would actually use it. Not needed on the client.
|
1210
|
-
var $$FORM_ACTION = encodeFormAction === undefined ? defaultEncodeFormAction : function (identifierPrefix) {
|
1211
|
-
return customEncodeFormAction(this, identifierPrefix, encodeFormAction);
|
1212
|
-
};
|
1213
1135
|
Object.defineProperties(proxy, {
|
1214
1136
|
$$FORM_ACTION: {
|
1215
|
-
value:
|
1137
|
+
value: encodeFormAction
|
1216
1138
|
},
|
1217
1139
|
$$IS_SIGNATURE_EQUAL: {
|
1218
1140
|
value: isSignatureEqual
|
@@ -1236,17 +1158,6 @@ function bind() {
|
|
1236
1158
|
var reference = knownServerReferences.get(this);
|
1237
1159
|
|
1238
1160
|
if (reference) {
|
1239
|
-
{
|
1240
|
-
var thisBind = arguments[0];
|
1241
|
-
|
1242
|
-
if (thisBind != null) {
|
1243
|
-
// This doesn't warn in browser environments since it's not instrumented outside
|
1244
|
-
// usedWithSSR. This makes this an SSR only warning which we don't generally do.
|
1245
|
-
// TODO: Consider a DEV only instrumentation in the browser.
|
1246
|
-
error('Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().');
|
1247
|
-
}
|
1248
|
-
}
|
1249
|
-
|
1250
1161
|
var args = ArraySlice.call(arguments, 1);
|
1251
1162
|
var boundPromise = null;
|
1252
1163
|
|
@@ -1256,26 +1167,9 @@ function bind() {
|
|
1256
1167
|
});
|
1257
1168
|
} else {
|
1258
1169
|
boundPromise = Promise.resolve(args);
|
1259
|
-
} // Expose encoder for use by SSR, as well as a special bind that can be used to
|
1260
|
-
// keep server capabilities.
|
1261
|
-
|
1262
|
-
|
1263
|
-
{
|
1264
|
-
// Only expose this in builds that would actually use it. Not needed on the client.
|
1265
|
-
Object.defineProperties(newFn, {
|
1266
|
-
$$FORM_ACTION: {
|
1267
|
-
value: this.$$FORM_ACTION
|
1268
|
-
},
|
1269
|
-
$$IS_SIGNATURE_EQUAL: {
|
1270
|
-
value: isSignatureEqual
|
1271
|
-
},
|
1272
|
-
bind: {
|
1273
|
-
value: bind
|
1274
|
-
}
|
1275
|
-
});
|
1276
1170
|
}
|
1277
1171
|
|
1278
|
-
|
1172
|
+
registerServerReference(newFn, {
|
1279
1173
|
id: reference.id,
|
1280
1174
|
bound: boundPromise
|
1281
1175
|
});
|
@@ -1284,7 +1178,7 @@ function bind() {
|
|
1284
1178
|
return newFn;
|
1285
1179
|
}
|
1286
1180
|
|
1287
|
-
function createServerReference$1(id, callServer
|
1181
|
+
function createServerReference$1(id, callServer) {
|
1288
1182
|
var proxy = function () {
|
1289
1183
|
// $FlowFixMe[method-unbinding]
|
1290
1184
|
var args = Array.prototype.slice.call(arguments);
|
@@ -1294,10 +1188,61 @@ function createServerReference$1(id, callServer, encodeFormAction) {
|
|
1294
1188
|
registerServerReference(proxy, {
|
1295
1189
|
id: id,
|
1296
1190
|
bound: null
|
1297
|
-
}
|
1191
|
+
});
|
1298
1192
|
return proxy;
|
1299
1193
|
}
|
1300
1194
|
|
1195
|
+
var ContextRegistry = ReactSharedInternals.ContextRegistry;
|
1196
|
+
function getOrCreateServerContext(globalName) {
|
1197
|
+
if (!ContextRegistry[globalName]) {
|
1198
|
+
var context = {
|
1199
|
+
$$typeof: REACT_SERVER_CONTEXT_TYPE,
|
1200
|
+
// As a workaround to support multiple concurrent renderers, we categorize
|
1201
|
+
// some renderers as primary and others as secondary. We only expect
|
1202
|
+
// there to be two concurrent renderers at most: React Native (primary) and
|
1203
|
+
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
1204
|
+
// Secondary renderers store their context values on separate fields.
|
1205
|
+
_currentValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1206
|
+
_currentValue2: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1207
|
+
_defaultValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
1208
|
+
// Used to track how many concurrent renderers this context currently
|
1209
|
+
// supports within in a single renderer. Such as parallel server rendering.
|
1210
|
+
_threadCount: 0,
|
1211
|
+
// These are circular
|
1212
|
+
Provider: null,
|
1213
|
+
Consumer: null,
|
1214
|
+
_globalName: globalName
|
1215
|
+
};
|
1216
|
+
context.Provider = {
|
1217
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
1218
|
+
_context: context
|
1219
|
+
};
|
1220
|
+
|
1221
|
+
{
|
1222
|
+
var hasWarnedAboutUsingConsumer;
|
1223
|
+
context._currentRenderer = null;
|
1224
|
+
context._currentRenderer2 = null;
|
1225
|
+
Object.defineProperties(context, {
|
1226
|
+
Consumer: {
|
1227
|
+
get: function () {
|
1228
|
+
if (!hasWarnedAboutUsingConsumer) {
|
1229
|
+
error('Consumer pattern is not supported by ReactServerContext');
|
1230
|
+
|
1231
|
+
hasWarnedAboutUsingConsumer = true;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
return null;
|
1235
|
+
}
|
1236
|
+
}
|
1237
|
+
});
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
ContextRegistry[globalName] = context;
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
return ContextRegistry[globalName];
|
1244
|
+
}
|
1245
|
+
|
1301
1246
|
var ROW_ID = 0;
|
1302
1247
|
var ROW_TAG = 1;
|
1303
1248
|
var ROW_LENGTH = 2;
|
@@ -1316,10 +1261,6 @@ function Chunk(status, value, reason, response) {
|
|
1316
1261
|
this.value = value;
|
1317
1262
|
this.reason = reason;
|
1318
1263
|
this._response = response;
|
1319
|
-
|
1320
|
-
{
|
1321
|
-
this._debugInfo = null;
|
1322
|
-
}
|
1323
1264
|
} // We subclass Promise.prototype so that we get other methods like .catch
|
1324
1265
|
|
1325
1266
|
|
@@ -1596,20 +1537,17 @@ function reportGlobalError(response, error) {
|
|
1596
1537
|
}
|
1597
1538
|
|
1598
1539
|
function createElement(type, key, props) {
|
1599
|
-
var element
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
_owner: null
|
1611
|
-
};
|
1612
|
-
}
|
1540
|
+
var element = {
|
1541
|
+
// This tag allows us to uniquely identify this as a React Element
|
1542
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
1543
|
+
// Built-in properties that belong on the element
|
1544
|
+
type: type,
|
1545
|
+
key: key,
|
1546
|
+
ref: null,
|
1547
|
+
props: props,
|
1548
|
+
// Record the component responsible for creating this element.
|
1549
|
+
_owner: null
|
1550
|
+
};
|
1613
1551
|
|
1614
1552
|
{
|
1615
1553
|
// We don't really need to add any of these but keeping them for good measure.
|
@@ -1622,12 +1560,17 @@ function createElement(type, key, props) {
|
|
1622
1560
|
writable: true,
|
1623
1561
|
value: true // This element has already been validated on the server.
|
1624
1562
|
|
1625
|
-
});
|
1626
|
-
|
1627
|
-
Object.defineProperty(element, '_debugInfo', {
|
1563
|
+
});
|
1564
|
+
Object.defineProperty(element, '_self', {
|
1628
1565
|
configurable: false,
|
1629
1566
|
enumerable: false,
|
1630
|
-
writable:
|
1567
|
+
writable: false,
|
1568
|
+
value: null
|
1569
|
+
});
|
1570
|
+
Object.defineProperty(element, '_source', {
|
1571
|
+
configurable: false,
|
1572
|
+
enumerable: false,
|
1573
|
+
writable: false,
|
1631
1574
|
value: null
|
1632
1575
|
});
|
1633
1576
|
}
|
@@ -1641,13 +1584,6 @@ function createLazyChunkWrapper(chunk) {
|
|
1641
1584
|
_payload: chunk,
|
1642
1585
|
_init: readChunk
|
1643
1586
|
};
|
1644
|
-
|
1645
|
-
{
|
1646
|
-
// Ensure we have a live array to track future debug info.
|
1647
|
-
var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
|
1648
|
-
lazyType._debugInfo = chunkDebugInfo;
|
1649
|
-
}
|
1650
|
-
|
1651
1587
|
return lazyType;
|
1652
1588
|
}
|
1653
1589
|
|
@@ -1730,7 +1666,7 @@ function createServerReferenceProxy(response, metaData) {
|
|
1730
1666
|
});
|
1731
1667
|
};
|
1732
1668
|
|
1733
|
-
registerServerReference(proxy, metaData
|
1669
|
+
registerServerReference(proxy, metaData);
|
1734
1670
|
return proxy;
|
1735
1671
|
}
|
1736
1672
|
|
@@ -1783,11 +1719,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1783
1719
|
case '@':
|
1784
1720
|
{
|
1785
1721
|
// Promise
|
1786
|
-
if (value.length === 2) {
|
1787
|
-
// Infinite promise that never resolves.
|
1788
|
-
return new Promise(function () {});
|
1789
|
-
}
|
1790
|
-
|
1791
1722
|
var _id = parseInt(value.slice(2), 16);
|
1792
1723
|
|
1793
1724
|
var _chunk = getChunk(response, _id);
|
@@ -1801,6 +1732,12 @@ function parseModelString(response, parentObject, key, value) {
|
|
1801
1732
|
return Symbol.for(value.slice(2));
|
1802
1733
|
}
|
1803
1734
|
|
1735
|
+
case 'P':
|
1736
|
+
{
|
1737
|
+
// Server Context Provider
|
1738
|
+
return getOrCreateServerContext(value.slice(2)).Provider;
|
1739
|
+
}
|
1740
|
+
|
1804
1741
|
case 'F':
|
1805
1742
|
{
|
1806
1743
|
// Server Reference
|
@@ -1870,23 +1807,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1870
1807
|
return BigInt(value.slice(2));
|
1871
1808
|
}
|
1872
1809
|
|
1873
|
-
case 'E':
|
1874
|
-
{
|
1875
|
-
{
|
1876
|
-
// In DEV mode we allow indirect eval to produce functions for logging.
|
1877
|
-
// This should not compile to eval() because then it has local scope access.
|
1878
|
-
try {
|
1879
|
-
// eslint-disable-next-line no-eval
|
1880
|
-
return (0, eval)(value.slice(2));
|
1881
|
-
} catch (x) {
|
1882
|
-
// We currently use this to express functions so we fail parsing it,
|
1883
|
-
// let's just return a blank function as a place holder.
|
1884
|
-
return function () {};
|
1885
|
-
}
|
1886
|
-
} // Fallthrough
|
1887
|
-
|
1888
|
-
}
|
1889
|
-
|
1890
1810
|
default:
|
1891
1811
|
{
|
1892
1812
|
// We assume that anything else is a reference ID.
|
@@ -1907,29 +1827,7 @@ function parseModelString(response, parentObject, key, value) {
|
|
1907
1827
|
|
1908
1828
|
switch (_chunk2.status) {
|
1909
1829
|
case INITIALIZED:
|
1910
|
-
|
1911
|
-
|
1912
|
-
if (_chunk2._debugInfo) {
|
1913
|
-
// If we have a direct reference to an object that was rendered by a synchronous
|
1914
|
-
// server component, it might have some debug info about how it was rendered.
|
1915
|
-
// We forward this to the underlying object. This might be a React Element or
|
1916
|
-
// an Array fragment.
|
1917
|
-
// If this was a string / number return value we lose the debug info. We choose
|
1918
|
-
// that tradeoff to allow sync server components to return plain values and not
|
1919
|
-
// use them as React Nodes necessarily. We could otherwise wrap them in a Lazy.
|
1920
|
-
if (typeof chunkValue === 'object' && chunkValue !== null && (Array.isArray(chunkValue) || chunkValue.$$typeof === REACT_ELEMENT_TYPE) && !chunkValue._debugInfo) {
|
1921
|
-
// We should maybe use a unique symbol for arrays but this is a React owned array.
|
1922
|
-
// $FlowFixMe[prop-missing]: This should be added to elements.
|
1923
|
-
Object.defineProperty(chunkValue, '_debugInfo', {
|
1924
|
-
configurable: false,
|
1925
|
-
enumerable: false,
|
1926
|
-
writable: true,
|
1927
|
-
value: _chunk2._debugInfo
|
1928
|
-
});
|
1929
|
-
}
|
1930
|
-
}
|
1931
|
-
|
1932
|
-
return chunkValue;
|
1830
|
+
return _chunk2.value;
|
1933
1831
|
|
1934
1832
|
case PENDING:
|
1935
1833
|
case BLOCKED:
|
@@ -1966,13 +1864,12 @@ function missingCall() {
|
|
1966
1864
|
throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
|
1967
1865
|
}
|
1968
1866
|
|
1969
|
-
function createResponse(bundlerConfig, moduleLoading, callServer,
|
1867
|
+
function createResponse(bundlerConfig, moduleLoading, callServer, nonce) {
|
1970
1868
|
var chunks = new Map();
|
1971
1869
|
var response = {
|
1972
1870
|
_bundlerConfig: bundlerConfig,
|
1973
1871
|
_moduleLoading: moduleLoading,
|
1974
1872
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1975
|
-
_encodeFormAction: encodeFormAction,
|
1976
1873
|
_nonce: nonce,
|
1977
1874
|
_chunks: chunks,
|
1978
1875
|
_stringDecoder: createStringDecoder(),
|
@@ -2070,24 +1967,6 @@ function resolveHint(response, code, model) {
|
|
2070
1967
|
dispatchHint(code, hintModel);
|
2071
1968
|
}
|
2072
1969
|
|
2073
|
-
function resolveDebugInfo(response, id, debugInfo) {
|
2074
|
-
|
2075
|
-
var chunk = getChunk(response, id);
|
2076
|
-
var chunkDebugInfo = chunk._debugInfo || (chunk._debugInfo = []);
|
2077
|
-
chunkDebugInfo.push(debugInfo);
|
2078
|
-
}
|
2079
|
-
|
2080
|
-
function resolveConsoleEntry(response, value) {
|
2081
|
-
|
2082
|
-
var payload = parseModel(response, value);
|
2083
|
-
var methodName = payload[0]; // TODO: Restore the fake stack before logging.
|
2084
|
-
// const stackTrace = payload[1];
|
2085
|
-
|
2086
|
-
var env = payload[2];
|
2087
|
-
var args = payload.slice(3);
|
2088
|
-
printToConsole(methodName, args, env);
|
2089
|
-
}
|
2090
|
-
|
2091
1970
|
function processFullRow(response, id, tag, buffer, chunk) {
|
2092
1971
|
|
2093
1972
|
var stringDecoder = response._stringDecoder;
|
@@ -2138,28 +2017,6 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
2138
2017
|
return;
|
2139
2018
|
}
|
2140
2019
|
|
2141
|
-
case 68
|
2142
|
-
/* "D" */
|
2143
|
-
:
|
2144
|
-
{
|
2145
|
-
{
|
2146
|
-
var debugInfo = JSON.parse(row);
|
2147
|
-
resolveDebugInfo(response, id, debugInfo);
|
2148
|
-
return;
|
2149
|
-
} // Fallthrough to share the error with Console entries.
|
2150
|
-
|
2151
|
-
}
|
2152
|
-
|
2153
|
-
case 87
|
2154
|
-
/* "W" */
|
2155
|
-
:
|
2156
|
-
{
|
2157
|
-
{
|
2158
|
-
resolveConsoleEntry(response, row);
|
2159
|
-
return;
|
2160
|
-
}
|
2161
|
-
}
|
2162
|
-
|
2163
2020
|
case 80
|
2164
2021
|
/* "P" */
|
2165
2022
|
:
|
@@ -2345,7 +2202,7 @@ function createServerReference(id, callServer) {
|
|
2345
2202
|
}
|
2346
2203
|
|
2347
2204
|
function createFromNodeStream(stream, ssrManifest, options) {
|
2348
|
-
var response = createResponse(ssrManifest.moduleMap, ssrManifest.moduleLoading, noServerCall, options
|
2205
|
+
var response = createResponse(ssrManifest.moduleMap, ssrManifest.moduleLoading, noServerCall, options && typeof options.nonce === 'string' ? options.nonce : undefined);
|
2349
2206
|
stream.on('data', function (chunk) {
|
2350
2207
|
processBinaryChunk(response, chunk);
|
2351
2208
|
});
|