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