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
@@ -11,6 +11,7 @@
|
|
11
11
|
'use strict';
|
12
12
|
|
13
13
|
var ReactDOM = require('react-dom');
|
14
|
+
var React = require('react');
|
14
15
|
|
15
16
|
// -----------------------------------------------------------------------------
|
16
17
|
const enableBinaryFlight = false;
|
@@ -208,115 +209,117 @@ function getCrossOriginString(input) {
|
|
208
209
|
}
|
209
210
|
|
210
211
|
// This client file is in the shared folder because it applies to both SSR and browser contexts.
|
211
|
-
const ReactDOMCurrentDispatcher = ReactDOMSharedInternals.
|
212
|
+
const ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
|
212
213
|
function dispatchHint(code, model) {
|
213
214
|
const dispatcher = ReactDOMCurrentDispatcher.current;
|
214
215
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
dispatcher.prefetchDNS(href);
|
221
|
-
return;
|
222
|
-
}
|
223
|
-
|
224
|
-
case 'C':
|
225
|
-
{
|
226
|
-
const refined = refineModel(code, model);
|
227
|
-
|
228
|
-
if (typeof refined === 'string') {
|
216
|
+
if (dispatcher) {
|
217
|
+
switch (code) {
|
218
|
+
case 'D':
|
219
|
+
{
|
220
|
+
const refined = refineModel(code, model);
|
229
221
|
const href = refined;
|
230
|
-
dispatcher.
|
231
|
-
|
232
|
-
const href = refined[0];
|
233
|
-
const crossOrigin = refined[1];
|
234
|
-
dispatcher.preconnect(href, crossOrigin);
|
222
|
+
dispatcher.prefetchDNS(href);
|
223
|
+
return;
|
235
224
|
}
|
236
225
|
|
237
|
-
|
238
|
-
|
226
|
+
case 'C':
|
227
|
+
{
|
228
|
+
const refined = refineModel(code, model);
|
239
229
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
dispatcher.preload(href, as);
|
230
|
+
if (typeof refined === 'string') {
|
231
|
+
const href = refined;
|
232
|
+
dispatcher.preconnect(href);
|
233
|
+
} else {
|
234
|
+
const href = refined[0];
|
235
|
+
const crossOrigin = refined[1];
|
236
|
+
dispatcher.preconnect(href, crossOrigin);
|
237
|
+
}
|
238
|
+
|
239
|
+
return;
|
251
240
|
}
|
252
241
|
|
253
|
-
|
254
|
-
|
242
|
+
case 'L':
|
243
|
+
{
|
244
|
+
const refined = refineModel(code, model);
|
245
|
+
const href = refined[0];
|
246
|
+
const as = refined[1];
|
255
247
|
|
256
|
-
|
257
|
-
|
258
|
-
|
248
|
+
if (refined.length === 3) {
|
249
|
+
const options = refined[2];
|
250
|
+
dispatcher.preload(href, as, options);
|
251
|
+
} else {
|
252
|
+
dispatcher.preload(href, as);
|
253
|
+
}
|
259
254
|
|
260
|
-
|
261
|
-
const href = refined;
|
262
|
-
dispatcher.preloadModule(href);
|
263
|
-
} else {
|
264
|
-
const href = refined[0];
|
265
|
-
const options = refined[1];
|
266
|
-
dispatcher.preloadModule(href, options);
|
255
|
+
return;
|
267
256
|
}
|
268
257
|
|
269
|
-
|
270
|
-
|
258
|
+
case 'm':
|
259
|
+
{
|
260
|
+
const refined = refineModel(code, model);
|
271
261
|
|
272
|
-
|
273
|
-
|
274
|
-
|
262
|
+
if (typeof refined === 'string') {
|
263
|
+
const href = refined;
|
264
|
+
dispatcher.preloadModule(href);
|
265
|
+
} else {
|
266
|
+
const href = refined[0];
|
267
|
+
const options = refined[1];
|
268
|
+
dispatcher.preloadModule(href, options);
|
269
|
+
}
|
275
270
|
|
276
|
-
|
277
|
-
const href = refined;
|
278
|
-
dispatcher.preinitStyle(href);
|
279
|
-
} else {
|
280
|
-
const href = refined[0];
|
281
|
-
const precedence = refined[1] === 0 ? undefined : refined[1];
|
282
|
-
const options = refined.length === 3 ? refined[2] : undefined;
|
283
|
-
dispatcher.preinitStyle(href, precedence, options);
|
271
|
+
return;
|
284
272
|
}
|
285
273
|
|
286
|
-
|
287
|
-
|
274
|
+
case 'S':
|
275
|
+
{
|
276
|
+
const refined = refineModel(code, model);
|
288
277
|
|
289
|
-
|
290
|
-
|
291
|
-
|
278
|
+
if (typeof refined === 'string') {
|
279
|
+
const href = refined;
|
280
|
+
dispatcher.preinitStyle(href);
|
281
|
+
} else {
|
282
|
+
const href = refined[0];
|
283
|
+
const precedence = refined[1] === 0 ? undefined : refined[1];
|
284
|
+
const options = refined.length === 3 ? refined[2] : undefined;
|
285
|
+
dispatcher.preinitStyle(href, precedence, options);
|
286
|
+
}
|
292
287
|
|
293
|
-
|
294
|
-
const href = refined;
|
295
|
-
dispatcher.preinitScript(href);
|
296
|
-
} else {
|
297
|
-
const href = refined[0];
|
298
|
-
const options = refined[1];
|
299
|
-
dispatcher.preinitScript(href, options);
|
288
|
+
return;
|
300
289
|
}
|
301
290
|
|
302
|
-
|
303
|
-
|
291
|
+
case 'X':
|
292
|
+
{
|
293
|
+
const refined = refineModel(code, model);
|
304
294
|
|
305
|
-
|
306
|
-
|
307
|
-
|
295
|
+
if (typeof refined === 'string') {
|
296
|
+
const href = refined;
|
297
|
+
dispatcher.preinitScript(href);
|
298
|
+
} else {
|
299
|
+
const href = refined[0];
|
300
|
+
const options = refined[1];
|
301
|
+
dispatcher.preinitScript(href, options);
|
302
|
+
}
|
308
303
|
|
309
|
-
|
310
|
-
const href = refined;
|
311
|
-
dispatcher.preinitModuleScript(href);
|
312
|
-
} else {
|
313
|
-
const href = refined[0];
|
314
|
-
const options = refined[1];
|
315
|
-
dispatcher.preinitModuleScript(href, options);
|
304
|
+
return;
|
316
305
|
}
|
317
306
|
|
318
|
-
|
319
|
-
|
307
|
+
case 'M':
|
308
|
+
{
|
309
|
+
const refined = refineModel(code, model);
|
310
|
+
|
311
|
+
if (typeof refined === 'string') {
|
312
|
+
const href = refined;
|
313
|
+
dispatcher.preinitModuleScript(href);
|
314
|
+
} else {
|
315
|
+
const href = refined[0];
|
316
|
+
const options = refined[1];
|
317
|
+
dispatcher.preinitModuleScript(href, options);
|
318
|
+
}
|
319
|
+
|
320
|
+
return;
|
321
|
+
}
|
322
|
+
}
|
320
323
|
}
|
321
324
|
} // Flow is having trouble refining the HintModels so we help it a bit.
|
322
325
|
// This should be compiled out in the production build.
|
@@ -340,7 +343,10 @@ function preinitScriptForSSR(href, nonce, crossOrigin) {
|
|
340
343
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
341
344
|
// The Symbol used to tag the ReactElement-like types.
|
342
345
|
const REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
346
|
+
const REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
347
|
+
const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
343
348
|
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
349
|
+
const REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
344
350
|
const MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
345
351
|
const FAUX_ITERATOR_SYMBOL = '@@iterator';
|
346
352
|
function getIteratorFn(maybeIterable) {
|
@@ -662,7 +668,7 @@ function encodeFormData(reference) {
|
|
662
668
|
return thenable;
|
663
669
|
}
|
664
670
|
|
665
|
-
function
|
671
|
+
function encodeFormAction(identifierPrefix) {
|
666
672
|
const reference = knownServerReferences.get(this);
|
667
673
|
|
668
674
|
if (!reference) {
|
@@ -712,22 +718,6 @@ function defaultEncodeFormAction(identifierPrefix) {
|
|
712
718
|
};
|
713
719
|
}
|
714
720
|
|
715
|
-
function customEncodeFormAction(proxy, identifierPrefix, encodeFormAction) {
|
716
|
-
const reference = knownServerReferences.get(proxy);
|
717
|
-
|
718
|
-
if (!reference) {
|
719
|
-
throw new Error('Tried to encode a Server Action from a different instance than the encoder is from. ' + 'This is a bug in React.');
|
720
|
-
}
|
721
|
-
|
722
|
-
let boundPromise = reference.bound;
|
723
|
-
|
724
|
-
if (boundPromise === null) {
|
725
|
-
boundPromise = Promise.resolve([]);
|
726
|
-
}
|
727
|
-
|
728
|
-
return encodeFormAction(reference.id, boundPromise);
|
729
|
-
}
|
730
|
-
|
731
721
|
function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
732
722
|
const reference = knownServerReferences.get(this);
|
733
723
|
|
@@ -789,17 +779,14 @@ function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
|
789
779
|
}
|
790
780
|
}
|
791
781
|
|
792
|
-
function registerServerReference(proxy, reference
|
782
|
+
function registerServerReference(proxy, reference) {
|
793
783
|
// Expose encoder for use by SSR, as well as a special bind that can be used to
|
794
784
|
// keep server capabilities.
|
795
785
|
{
|
796
786
|
// Only expose this in builds that would actually use it. Not needed on the client.
|
797
|
-
const $$FORM_ACTION = encodeFormAction === undefined ? defaultEncodeFormAction : function (identifierPrefix) {
|
798
|
-
return customEncodeFormAction(this, identifierPrefix, encodeFormAction);
|
799
|
-
};
|
800
787
|
Object.defineProperties(proxy, {
|
801
788
|
$$FORM_ACTION: {
|
802
|
-
value:
|
789
|
+
value: encodeFormAction
|
803
790
|
},
|
804
791
|
$$IS_SIGNATURE_EQUAL: {
|
805
792
|
value: isSignatureEqual
|
@@ -823,7 +810,6 @@ function bind() {
|
|
823
810
|
const reference = knownServerReferences.get(this);
|
824
811
|
|
825
812
|
if (reference) {
|
826
|
-
|
827
813
|
const args = ArraySlice.call(arguments, 1);
|
828
814
|
let boundPromise = null;
|
829
815
|
|
@@ -831,26 +817,9 @@ function bind() {
|
|
831
817
|
boundPromise = Promise.resolve(reference.bound).then(boundArgs => boundArgs.concat(args));
|
832
818
|
} else {
|
833
819
|
boundPromise = Promise.resolve(args);
|
834
|
-
} // Expose encoder for use by SSR, as well as a special bind that can be used to
|
835
|
-
// keep server capabilities.
|
836
|
-
|
837
|
-
|
838
|
-
{
|
839
|
-
// Only expose this in builds that would actually use it. Not needed on the client.
|
840
|
-
Object.defineProperties(newFn, {
|
841
|
-
$$FORM_ACTION: {
|
842
|
-
value: this.$$FORM_ACTION
|
843
|
-
},
|
844
|
-
$$IS_SIGNATURE_EQUAL: {
|
845
|
-
value: isSignatureEqual
|
846
|
-
},
|
847
|
-
bind: {
|
848
|
-
value: bind
|
849
|
-
}
|
850
|
-
});
|
851
820
|
}
|
852
821
|
|
853
|
-
|
822
|
+
registerServerReference(newFn, {
|
854
823
|
id: reference.id,
|
855
824
|
bound: boundPromise
|
856
825
|
});
|
@@ -859,7 +828,7 @@ function bind() {
|
|
859
828
|
return newFn;
|
860
829
|
}
|
861
830
|
|
862
|
-
function createServerReference$1(id, callServer
|
831
|
+
function createServerReference$1(id, callServer) {
|
863
832
|
const proxy = function () {
|
864
833
|
// $FlowFixMe[method-unbinding]
|
865
834
|
const args = Array.prototype.slice.call(arguments);
|
@@ -869,10 +838,44 @@ function createServerReference$1(id, callServer, encodeFormAction) {
|
|
869
838
|
registerServerReference(proxy, {
|
870
839
|
id,
|
871
840
|
bound: null
|
872
|
-
}
|
841
|
+
});
|
873
842
|
return proxy;
|
874
843
|
}
|
875
844
|
|
845
|
+
const ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
846
|
+
|
847
|
+
const ContextRegistry = ReactSharedInternals.ContextRegistry;
|
848
|
+
function getOrCreateServerContext(globalName) {
|
849
|
+
if (!ContextRegistry[globalName]) {
|
850
|
+
const context = {
|
851
|
+
$$typeof: REACT_SERVER_CONTEXT_TYPE,
|
852
|
+
// As a workaround to support multiple concurrent renderers, we categorize
|
853
|
+
// some renderers as primary and others as secondary. We only expect
|
854
|
+
// there to be two concurrent renderers at most: React Native (primary) and
|
855
|
+
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
856
|
+
// Secondary renderers store their context values on separate fields.
|
857
|
+
_currentValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
858
|
+
_currentValue2: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
859
|
+
_defaultValue: REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED,
|
860
|
+
// Used to track how many concurrent renderers this context currently
|
861
|
+
// supports within in a single renderer. Such as parallel server rendering.
|
862
|
+
_threadCount: 0,
|
863
|
+
// These are circular
|
864
|
+
Provider: null,
|
865
|
+
Consumer: null,
|
866
|
+
_globalName: globalName
|
867
|
+
};
|
868
|
+
context.Provider = {
|
869
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
870
|
+
_context: context
|
871
|
+
};
|
872
|
+
|
873
|
+
ContextRegistry[globalName] = context;
|
874
|
+
}
|
875
|
+
|
876
|
+
return ContextRegistry[globalName];
|
877
|
+
}
|
878
|
+
|
876
879
|
const ROW_ID = 0;
|
877
880
|
const ROW_TAG = 1;
|
878
881
|
const ROW_LENGTH = 2;
|
@@ -1167,20 +1170,17 @@ function reportGlobalError(response, error) {
|
|
1167
1170
|
}
|
1168
1171
|
|
1169
1172
|
function createElement(type, key, props) {
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
_owner: null
|
1182
|
-
};
|
1183
|
-
}
|
1173
|
+
const element = {
|
1174
|
+
// This tag allows us to uniquely identify this as a React Element
|
1175
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
1176
|
+
// Built-in properties that belong on the element
|
1177
|
+
type: type,
|
1178
|
+
key: key,
|
1179
|
+
ref: null,
|
1180
|
+
props: props,
|
1181
|
+
// Record the component responsible for creating this element.
|
1182
|
+
_owner: null
|
1183
|
+
};
|
1184
1184
|
|
1185
1185
|
return element;
|
1186
1186
|
}
|
@@ -1191,7 +1191,6 @@ function createLazyChunkWrapper(chunk) {
|
|
1191
1191
|
_payload: chunk,
|
1192
1192
|
_init: readChunk
|
1193
1193
|
};
|
1194
|
-
|
1195
1194
|
return lazyType;
|
1196
1195
|
}
|
1197
1196
|
|
@@ -1272,7 +1271,7 @@ function createServerReferenceProxy(response, metaData) {
|
|
1272
1271
|
});
|
1273
1272
|
};
|
1274
1273
|
|
1275
|
-
registerServerReference(proxy, metaData
|
1274
|
+
registerServerReference(proxy, metaData);
|
1276
1275
|
return proxy;
|
1277
1276
|
}
|
1278
1277
|
|
@@ -1325,11 +1324,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1325
1324
|
case '@':
|
1326
1325
|
{
|
1327
1326
|
// Promise
|
1328
|
-
if (value.length === 2) {
|
1329
|
-
// Infinite promise that never resolves.
|
1330
|
-
return new Promise(() => {});
|
1331
|
-
}
|
1332
|
-
|
1333
1327
|
const id = parseInt(value.slice(2), 16);
|
1334
1328
|
const chunk = getChunk(response, id);
|
1335
1329
|
return chunk;
|
@@ -1341,6 +1335,12 @@ function parseModelString(response, parentObject, key, value) {
|
|
1341
1335
|
return Symbol.for(value.slice(2));
|
1342
1336
|
}
|
1343
1337
|
|
1338
|
+
case 'P':
|
1339
|
+
{
|
1340
|
+
// Server Context Provider
|
1341
|
+
return getOrCreateServerContext(value.slice(2)).Provider;
|
1342
|
+
}
|
1343
|
+
|
1344
1344
|
case 'F':
|
1345
1345
|
{
|
1346
1346
|
// Server Reference
|
@@ -1406,8 +1406,6 @@ function parseModelString(response, parentObject, key, value) {
|
|
1406
1406
|
return BigInt(value.slice(2));
|
1407
1407
|
}
|
1408
1408
|
|
1409
|
-
case 'E':
|
1410
|
-
|
1411
1409
|
default:
|
1412
1410
|
{
|
1413
1411
|
// We assume that anything else is a reference ID.
|
@@ -1427,9 +1425,7 @@ function parseModelString(response, parentObject, key, value) {
|
|
1427
1425
|
|
1428
1426
|
switch (chunk.status) {
|
1429
1427
|
case INITIALIZED:
|
1430
|
-
|
1431
|
-
|
1432
|
-
return chunkValue;
|
1428
|
+
return chunk.value;
|
1433
1429
|
|
1434
1430
|
case PENDING:
|
1435
1431
|
case BLOCKED:
|
@@ -1464,13 +1460,12 @@ function missingCall() {
|
|
1464
1460
|
throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
|
1465
1461
|
}
|
1466
1462
|
|
1467
|
-
function createResponse(bundlerConfig, moduleLoading, callServer,
|
1463
|
+
function createResponse(bundlerConfig, moduleLoading, callServer, nonce) {
|
1468
1464
|
const chunks = new Map();
|
1469
1465
|
const response = {
|
1470
1466
|
_bundlerConfig: bundlerConfig,
|
1471
1467
|
_moduleLoading: moduleLoading,
|
1472
1468
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1473
|
-
_encodeFormAction: encodeFormAction,
|
1474
1469
|
_nonce: nonce,
|
1475
1470
|
_chunks: chunks,
|
1476
1471
|
_stringDecoder: createStringDecoder(),
|
@@ -1613,18 +1608,6 @@ function processFullRow(response, id, tag, buffer, chunk) {
|
|
1613
1608
|
return;
|
1614
1609
|
}
|
1615
1610
|
|
1616
|
-
case 68
|
1617
|
-
/* "D" */
|
1618
|
-
:
|
1619
|
-
|
1620
|
-
case 87
|
1621
|
-
/* "W" */
|
1622
|
-
:
|
1623
|
-
{
|
1624
|
-
|
1625
|
-
throw new Error('Failed to read a RSC payload created by a development version of React ' + 'on the server while using a production version on the client. Always use ' + 'matching versions on the server and the client.');
|
1626
|
-
}
|
1627
|
-
|
1628
1611
|
case 80
|
1629
1612
|
/* "P" */
|
1630
1613
|
:
|
@@ -1809,7 +1792,7 @@ function createServerReference(id, callServer) {
|
|
1809
1792
|
}
|
1810
1793
|
|
1811
1794
|
function createResponseFromOptions(options) {
|
1812
|
-
return createResponse(options.ssrManifest.moduleMap, options.ssrManifest.moduleLoading, noServerCall,
|
1795
|
+
return createResponse(options.ssrManifest.moduleMap, options.ssrManifest.moduleLoading, noServerCall, typeof options.nonce === 'string' ? options.nonce : undefined);
|
1813
1796
|
}
|
1814
1797
|
|
1815
1798
|
function startReadingFromStream(response, stream) {
|
@@ -7,37 +7,37 @@
|
|
7
7
|
This source code is licensed under the MIT license found in the
|
8
8
|
LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var r=require("react-dom"),t={stream:!0};function
|
11
|
-
function
|
12
|
-
function
|
13
|
-
function
|
14
|
-
function
|
15
|
-
function
|
16
|
-
f),null===k&&(k=new FormData),m=h++,k.append(b+m,e),"$Q"+m.toString(16);if(e instanceof Set)return e=JSON.stringify(Array.from(e),f),null===k&&(k=new FormData),m=h++,k.append(b+m,e),"$W"+m.toString(16);if(
|
17
|
-
e="$"===e[0]?"$"+e:e;return e}if("boolean"===typeof e)return e;if("number"===typeof e)return
|
18
|
-
(e.description+") cannot be found among global symbols."));return"$S"+m}if("bigint"===typeof e)return"$n"+e.toString(10);throw Error("Type "+typeof e+" is not supported as an argument to a Server Function.");}var h=1,n=0,k=null;a=JSON.stringify(a,f);null===k?c(a):(k.set(b+"0",a),0===n&&c(k))}var
|
19
|
-
function
|
20
|
-
function
|
21
|
-
function
|
22
|
-
function
|
23
|
-
function
|
24
|
-
|
25
|
-
function
|
10
|
+
'use strict';var r=require("react-dom"),t=require("react"),u={stream:!0};function v(a,b){if(a){var c=a[b[0]];if(a=c[b[2]])c=a.name;else{a=c["*"];if(!a)throw Error('Could not find the module "'+b[0]+'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.');c=b[2]}return 4===b.length?[a.id,a.chunks,c,1]:[a.id,a.chunks,c]}return b}var w=new Map;
|
11
|
+
function x(a){var b=__webpack_require__(a);if("function"!==typeof b.then||"fulfilled"===b.status)return null;b.then(function(c){b.status="fulfilled";b.value=c},function(c){b.status="rejected";b.reason=c});return b}function aa(){}
|
12
|
+
function ba(a){for(var b=a[1],c=[],d=0;d<b.length;){var f=b[d++];b[d++];var h=w.get(f);if(void 0===h){h=__webpack_chunk_load__(f);c.push(h);var n=w.set.bind(w,f,null);h.then(n,aa);w.set(f,h)}else null!==h&&c.push(h)}return 4===a.length?0===c.length?x(a[0]):Promise.all(c).then(function(){return x(a[0])}):0<c.length?Promise.all(c):null}
|
13
|
+
function ca(a,b,c){if(null!==a)for(var d=1;d<b.length;d+=2){var f=c,h=y.current;if(h){var n=h.preinitScript,k=a.prefix+b[d];var m=a.crossOrigin;m="string"===typeof m?"use-credentials"===m?m:"":void 0;n.call(h,k,{crossOrigin:m,nonce:f})}}}var y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,z=Symbol.for("react.element"),da=Symbol.for("react.provider"),ea=Symbol.for("react.server_context"),fa=Symbol.for("react.lazy"),A=Symbol.for("react.default_value"),B=Symbol.iterator;
|
14
|
+
function ha(a){if(null===a||"object"!==typeof a)return null;a=B&&a[B]||a["@@iterator"];return"function"===typeof a?a:null}var ia=Array.isArray,C=Object.getPrototypeOf,ja=Object.prototype,D=new WeakMap;function ka(a){return Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN"}
|
15
|
+
function F(a,b,c,d){function f(m,e){if(null===e)return null;if("object"===typeof e){if("function"===typeof e.then){null===k&&(k=new FormData);n++;var l=h++;e.then(function(p){p=JSON.stringify(p,f);var q=k;q.append(b+l,p);n--;0===n&&c(q)},function(p){d(p)});return"$@"+l.toString(16)}if(ia(e))return e;if(e instanceof FormData){null===k&&(k=new FormData);var g=k;m=h++;var E=b+m+"_";e.forEach(function(p,q){g.append(E+q,p)});return"$K"+m.toString(16)}if(e instanceof Map)return e=JSON.stringify(Array.from(e),
|
16
|
+
f),null===k&&(k=new FormData),m=h++,k.append(b+m,e),"$Q"+m.toString(16);if(e instanceof Set)return e=JSON.stringify(Array.from(e),f),null===k&&(k=new FormData),m=h++,k.append(b+m,e),"$W"+m.toString(16);if(ha(e))return Array.from(e);m=C(e);if(m!==ja&&(null===m||null!==C(m)))throw Error("Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported.");return e}if("string"===typeof e){if("Z"===e[e.length-1]&&this[m]instanceof Date)return"$D"+e;
|
17
|
+
e="$"===e[0]?"$"+e:e;return e}if("boolean"===typeof e)return e;if("number"===typeof e)return ka(e);if("undefined"===typeof e)return"$undefined";if("function"===typeof e){e=D.get(e);if(void 0!==e)return e=JSON.stringify(e,f),null===k&&(k=new FormData),m=h++,k.set(b+m,e),"$F"+m.toString(16);throw Error("Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.");}if("symbol"===typeof e){m=e.description;if(Symbol.for(m)!==e)throw Error("Only global symbols received from Symbol.for(...) can be passed to Server Functions. The symbol Symbol.for("+
|
18
|
+
(e.description+") cannot be found among global symbols."));return"$S"+m}if("bigint"===typeof e)return"$n"+e.toString(10);throw Error("Type "+typeof e+" is not supported as an argument to a Server Function.");}var h=1,n=0,k=null;a=JSON.stringify(a,f);null===k?c(a):(k.set(b+"0",a),0===n&&c(k))}var G=new WeakMap;
|
19
|
+
function la(a){var b,c,d=new Promise(function(f,h){b=f;c=h});F(a,"",function(f){if("string"===typeof f){var h=new FormData;h.append("0",f);f=h}d.status="fulfilled";d.value=f;b(f)},function(f){d.status="rejected";d.reason=f;c(f)});return d}
|
20
|
+
function ma(a){var b=D.get(this);if(!b)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var c=null;if(null!==b.bound){c=G.get(b);c||(c=la(b),G.set(b,c));if("rejected"===c.status)throw c.reason;if("fulfilled"!==c.status)throw c;b=c.value;var d=new FormData;b.forEach(function(f,h){d.append("$ACTION_"+a+":"+h,f)});c=d;b="$ACTION_REF_"+a}else b="$ACTION_ID_"+b.id;return{name:b,method:"POST",encType:"multipart/form-data",data:c}}
|
21
|
+
function na(a,b){var c=D.get(this);if(!c)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");if(c.id!==a)return!1;var d=c.bound;if(null===d)return 0===b;switch(d.status){case "fulfilled":return d.value.length===b;case "pending":throw d;case "rejected":throw d.reason;default:throw"string"!==typeof d.status&&(d.status="pending",d.then(function(f){d.status="fulfilled";d.value=f},function(f){d.status="rejected";d.reason=f})),d;}}
|
22
|
+
function H(a,b){Object.defineProperties(a,{$$FORM_ACTION:{value:ma},$$IS_SIGNATURE_EQUAL:{value:na},bind:{value:oa}});D.set(a,b)}var pa=Function.prototype.bind,qa=Array.prototype.slice;function oa(){var a=pa.apply(this,arguments),b=D.get(this);if(b){var c=qa.call(arguments,1),d=null;d=null!==b.bound?Promise.resolve(b.bound).then(function(f){return f.concat(c)}):Promise.resolve(c);H(a,{id:b.id,bound:d})}return a}
|
23
|
+
function ra(a,b){function c(){var d=Array.prototype.slice.call(arguments);return b(a,d)}H(c,{id:a,bound:null});return c}var I=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function J(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}J.prototype=Object.create(Promise.prototype);
|
24
|
+
J.prototype.then=function(a,b){switch(this.status){case "resolved_model":L(this);break;case "resolved_module":M(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":case "cyclic":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};
|
25
|
+
function sa(a){switch(a.status){case "resolved_model":L(a);break;case "resolved_module":M(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":case "cyclic":throw a;default:throw a.reason;}}function N(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function O(a,b,c){switch(a.status){case "fulfilled":N(b,a.value);break;case "pending":case "blocked":case "cyclic":a.value=b;a.reason=c;break;case "rejected":c&&N(c,a.reason)}}
|
26
26
|
function P(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&N(c,b)}}function Q(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(M(a),O(a,c,d))}}var R=null,S=null;
|
27
27
|
function L(a){var b=R,c=S;R=a;S=null;var d=a.value;a.status="cyclic";a.value=null;a.reason=null;try{var f=JSON.parse(d,a._response._fromJSON);if(null!==S&&0<S.deps)S.value=f,a.status="blocked",a.value=null,a.reason=null;else{var h=a.value;a.status="fulfilled";a.value=f;null!==h&&N(h,f)}}catch(n){a.status="rejected",a.reason=n}finally{R=b,S=c}}
|
28
|
-
function M(a){try{var b=a.value,c=__webpack_require__(b[0]);if(4===b.length&&"function"===typeof c.then)if("fulfilled"===c.status)c=c.value;else throw c.reason;var d="*"===b[2]?c:""===b[2]?c.__esModule?c.default:c:c[b[2]];a.status="fulfilled";a.value=d}catch(f){a.status="rejected",a.reason=f}}function T(a,b){a._chunks.forEach(function(c){"pending"===c.status&&P(c,b)})}function U(a,b){var c=a._chunks,d=c.get(b);d||(d=new
|
29
|
-
function
|
30
|
-
function
|
31
|
-
function
|
32
|
-
case "I":return Infinity;case "-":return"$-0"===d?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(d.slice(2)));case "n":return BigInt(d.slice(2));default:d=parseInt(d.slice(1),16);a=U(a,d);switch(a.status){case "resolved_model":L(a);break;case "resolved_module":M(a)}switch(a.status){case "fulfilled":return a.value;
|
33
|
-
function
|
34
|
-
function
|
35
|
-
function
|
36
|
-
function
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
g.value=e,null!==l&&(L(g),O(g,l,k)))):k.set(e,new
|
41
|
-
exports.createFromReadableStream=function(a,b){b=Y(b);Z(b,a);return U(b,0)};exports.createServerReference=function(a){return
|
28
|
+
function M(a){try{var b=a.value,c=__webpack_require__(b[0]);if(4===b.length&&"function"===typeof c.then)if("fulfilled"===c.status)c=c.value;else throw c.reason;var d="*"===b[2]?c:""===b[2]?c.__esModule?c.default:c:c[b[2]];a.status="fulfilled";a.value=d}catch(f){a.status="rejected",a.reason=f}}function T(a,b){a._chunks.forEach(function(c){"pending"===c.status&&P(c,b)})}function U(a,b){var c=a._chunks,d=c.get(b);d||(d=new J("pending",null,null,a),c.set(b,d));return d}
|
29
|
+
function ta(a,b,c,d){if(S){var f=S;d||f.deps++}else f=S={deps:d?0:1,value:null};return function(h){b[c]=h;f.deps--;0===f.deps&&"blocked"===a.status&&(h=a.value,a.status="fulfilled",a.value=f.value,null!==h&&N(h,f.value))}}function ua(a){return function(b){return P(a,b)}}
|
30
|
+
function va(a,b){function c(){var f=Array.prototype.slice.call(arguments),h=b.bound;return h?"fulfilled"===h.status?d(b.id,h.value.concat(f)):Promise.resolve(h).then(function(n){return d(b.id,n.concat(f))}):d(b.id,f)}var d=a._callServer;H(c,b);return c}function W(a,b){a=U(a,b);switch(a.status){case "resolved_model":L(a)}switch(a.status){case "fulfilled":return a.value;default:throw a.reason;}}
|
31
|
+
function wa(a,b,c,d){if("$"===d[0]){if("$"===d)return z;switch(d[1]){case "$":return d.slice(1);case "L":return b=parseInt(d.slice(2),16),a=U(a,b),{$$typeof:fa,_payload:a,_init:sa};case "@":return b=parseInt(d.slice(2),16),U(a,b);case "S":return Symbol.for(d.slice(2));case "P":return a=d.slice(2),I[a]||(b={$$typeof:ea,_currentValue:A,_currentValue2:A,_defaultValue:A,_threadCount:0,Provider:null,Consumer:null,_globalName:a},b.Provider={$$typeof:da,_context:b},I[a]=b),I[a].Provider;case "F":return b=
|
32
|
+
parseInt(d.slice(2),16),b=W(a,b),va(a,b);case "Q":return b=parseInt(d.slice(2),16),a=W(a,b),new Map(a);case "W":return b=parseInt(d.slice(2),16),a=W(a,b),new Set(a);case "I":return Infinity;case "-":return"$-0"===d?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(d.slice(2)));case "n":return BigInt(d.slice(2));default:d=parseInt(d.slice(1),16);a=U(a,d);switch(a.status){case "resolved_model":L(a);break;case "resolved_module":M(a)}switch(a.status){case "fulfilled":return a.value;
|
33
|
+
case "pending":case "blocked":case "cyclic":return d=R,a.then(ta(d,b,c,"cyclic"===a.status),ua(d)),null;default:throw a.reason;}}}return d}function xa(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
|
34
|
+
function ya(a,b,c){var d=a._chunks,f=d.get(b);c=JSON.parse(c,a._fromJSON);var h=v(a._bundlerConfig,c);ca(a._moduleLoading,c[1],a._nonce);if(c=ba(h)){if(f){var n=f;n.status="blocked"}else n=new J("blocked",null,null,a),d.set(b,n);c.then(function(){return Q(n,h)},function(k){return P(n,k)})}else f?Q(f,h):d.set(b,new J("resolved_module",h,null,a))}
|
35
|
+
function za(a){return function(b,c){return"string"===typeof c?wa(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===z?{$$typeof:z,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}function X(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
|
36
|
+
function Y(a){var b=a.ssrManifest.moduleMap,c=a.ssrManifest.moduleLoading;a="string"===typeof a.nonce?a.nonce:void 0;var d=new Map;b={_bundlerConfig:b,_moduleLoading:c,_callServer:void 0!==X?X:xa,_nonce:a,_chunks:d,_stringDecoder:new TextDecoder,_fromJSON:null,_rowState:0,_rowID:0,_rowTag:0,_rowLength:0,_buffer:[]};b._fromJSON=za(b);return b}
|
37
|
+
function Z(a,b){function c(h){var n=h.value;if(h.done)T(a,Error("Connection closed."));else{var k=0,m=a._rowState,e=a._rowID,l=a._rowTag,g=a._rowLength;h=a._buffer;for(var E=n.length;k<E;){var p=-1;switch(m){case 0:p=n[k++];58===p?m=1:e=e<<4|(96<p?p-87:p-48);continue;case 1:m=n[k];84===m?(l=m,m=2,k++):64<m&&91>m?(l=m,m=3,k++):(l=0,m=3);continue;case 2:p=n[k++];44===p?m=4:g=g<<4|(96<p?p-87:p-48);continue;case 3:p=n.indexOf(10,k);break;case 4:p=k+g,p>n.length&&(p=-1)}var q=n.byteOffset+k;if(-1<p){k=
|
38
|
+
new Uint8Array(n.buffer,q,p-k);g=a;q=l;var V=g._stringDecoder;l="";for(var K=0;K<h.length;K++)l+=V.decode(h[K],u);l+=V.decode(k);switch(q){case 73:ya(g,e,l);break;case 72:e=l[0];l=l.slice(1);g=JSON.parse(l,g._fromJSON);if(l=y.current)switch(e){case "D":l.prefetchDNS(g);break;case "C":"string"===typeof g?l.preconnect(g):l.preconnect(g[0],g[1]);break;case "L":e=g[0];k=g[1];3===g.length?l.preload(e,k,g[2]):l.preload(e,k);break;case "m":"string"===typeof g?l.preloadModule(g):l.preloadModule(g[0],g[1]);
|
39
|
+
break;case "S":"string"===typeof g?l.preinitStyle(g):l.preinitStyle(g[0],0===g[1]?void 0:g[1],3===g.length?g[2]:void 0);break;case "X":"string"===typeof g?l.preinitScript(g):l.preinitScript(g[0],g[1]);break;case "M":"string"===typeof g?l.preinitModuleScript(g):l.preinitModuleScript(g[0],g[1])}break;case 69:l=JSON.parse(l);k=l.digest;l=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
|
40
|
+
l.stack="Error: "+l.message;l.digest=k;k=g._chunks;(q=k.get(e))?P(q,l):k.set(e,new J("rejected",null,l,g));break;case 84:g._chunks.set(e,new J("fulfilled",l,null,g));break;default:k=g._chunks,(q=k.get(e))?(g=q,e=l,"pending"===g.status&&(l=g.value,k=g.reason,g.status="resolved_model",g.value=e,null!==l&&(L(g),O(g,l,k)))):k.set(e,new J("resolved_model",l,null,g))}k=p;3===m&&k++;g=e=l=m=0;h.length=0}else{n=new Uint8Array(n.buffer,q,n.byteLength-k);h.push(n);g-=n.byteLength;break}}a._rowState=m;a._rowID=
|
41
|
+
e;a._rowTag=l;a._rowLength=g;return f.read().then(c).catch(d)}}function d(h){T(a,h)}var f=b.getReader();f.read().then(c).catch(d)}exports.createFromFetch=function(a,b){var c=Y(b);a.then(function(d){Z(c,d.body)},function(d){T(c,d)});return U(c,0)};exports.createFromReadableStream=function(a,b){b=Y(b);Z(b,a);return U(b,0)};exports.createServerReference=function(a){return ra(a,X)};exports.encodeReply=function(a){return new Promise(function(b,c){F(a,"",b,c)})};
|
42
42
|
|
43
43
|
//# sourceMappingURL=react-server-dom-webpack-client.edge.production.min.js.map
|