diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 2968744e419a..18a2771d8fa3 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -63310df2b243b6c3b2f01e8b121e7d115e839cfb +cb2439624f43c510007f65aea5c50a8bb97917e4 diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 4dec89d0262d..20163660b1e0 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -16454,7 +16454,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1784 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-42373634", + version: "18.3.0-www-modern-760a7212", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2140 = { @@ -16485,7 +16485,7 @@ var internals$jscomp$inline_2140 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-42373634" + reconcilerVersion: "18.3.0-www-modern-760a7212" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2141 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16901,4 +16901,4 @@ exports.useFormState = function () { exports.useFormStatus = function () { throw Error(formatProdErrorMessage(248)); }; -exports.version = "18.3.0-www-modern-42373634"; +exports.version = "18.3.0-www-modern-760a7212"; diff --git a/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js b/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js index 5b03c7a4e2ed..029b2587e32c 100644 --- a/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js @@ -19,6 +19,48 @@ if (__DEV__) { var ReactDOM = require("react-dom"); var React = require("react"); + // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars + var requestedClientReferencesKeys = new Set(); + var checkIsClientReference; + function setCheckIsClientReference(impl) { + checkIsClientReference = impl; + } + function registerClientReference(clientReference) {} + function isClientReference(reference) { + if (checkIsClientReference == null) { + throw new Error("Expected implementation for checkIsClientReference."); + } + + return checkIsClientReference(reference); + } + function getClientReferenceKey(clientReference) { + var moduleId = clientReference.getModuleId(); + requestedClientReferencesKeys.add(moduleId); + return clientReference.getModuleId(); + } + function resolveClientReferenceMetadata(config, clientReference) { + return { + moduleId: clientReference.getModuleId(), + exportName: "default" + }; + } + function registerServerReference(serverReference, id, exportName) { + throw new Error("registerServerReference: Not Implemented."); + } + function isServerReference(reference) { + throw new Error("isServerReference: Not Implemented."); + } + function getServerReferenceId(config, serverReference) { + throw new Error("getServerReferenceId: Not Implemented."); + } + function getRequestedClientReferencesKeys() { + return Array.from(requestedClientReferencesKeys); + } + function clearRequestedClientReferencesKeysSet() { + requestedClientReferencesKeys.clear(); + } + // This refers to a WWW module. var warningWWW = require("warning"); function error(format) { @@ -108,61 +150,6 @@ if (__DEV__) { destination.close(); } - // eslint-disable-next-line no-unused-vars - // eslint-disable-next-line no-unused-vars - var registeredClientReferences = new Map(); - var requestedClientReferencesKeys = new Set(); - function registerClientReference(clientReference, moduleId) { - var exportName = "default"; // Currently, we only support modules with `default` export - - registeredClientReferences.set(clientReference, { - moduleId: moduleId, - exportName: exportName - }); - return clientReference; - } - function isClientReference(reference) { - return registeredClientReferences.has(reference); - } - function getClientReferenceKey(clientReference) { - var reference = registeredClientReferences.get(clientReference); - - if (reference != null) { - requestedClientReferencesKeys.add(reference.moduleId); - return reference.moduleId; - } - - throw new Error( - "Expected client reference " + clientReference + " to be registered." - ); - } - function resolveClientReferenceMetadata(config, clientReference) { - var metadata = registeredClientReferences.get(clientReference); - - if (metadata != null) { - return metadata; - } - - throw new Error( - "Expected client reference " + clientReference + " to be registered." - ); - } - function registerServerReference(serverReference, exportName) { - throw new Error("registerServerReference: Not Implemented."); - } - function isServerReference(reference) { - throw new Error("isServerReference: Not Implemented."); - } - function getServerReferenceId(config, serverReference) { - throw new Error("getServerReferenceId: Not Implemented."); - } - function getRequestedClientReferencesKeys() { - return Array.from(requestedClientReferencesKeys); - } - function clearRequestedClientReferencesKeysSet() { - requestedClientReferencesKeys.clear(); - } - function getServerReferenceBoundArguments(config, serverReference) { throw new Error("getServerReferenceBoundArguments: Not Implemented."); } @@ -2546,7 +2533,7 @@ if (__DEV__) { return rootContextSnapshot; } - function renderToDestination(destination, model, bundlerConfig, options) { + function renderToDestination(destination, model, options) { if (!configured) { throw new Error( "Please make sure to call `setConfig(...)` before calling `renderToDestination`." @@ -2555,7 +2542,7 @@ if (__DEV__) { var request = createRequest( model, - bundlerConfig, + null, options ? options.onError : undefined ); startWork(request); @@ -2566,6 +2553,7 @@ if (__DEV__) { function setConfig(config) { setByteLengthOfChunkImplementation(config.byteLength); + setCheckIsClientReference(config.isClientReference); configured = true; } @@ -2575,6 +2563,7 @@ if (__DEV__) { exports.registerClientReference = registerClientReference; exports.registerServerReference = registerServerReference; exports.renderToDestination = renderToDestination; + exports.setCheckIsClientReference = setCheckIsClientReference; exports.setConfig = setConfig; })(); } diff --git a/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js b/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js index ea107940be82..ffda9963fd31 100644 --- a/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js @@ -12,24 +12,29 @@ "use strict"; var ReactDOM = require("react-dom"), - React = require("react"); + React = require("react"), + requestedClientReferencesKeys = new Set(), + checkIsClientReference; +function isClientReference(reference) { + if (null == checkIsClientReference) + throw Error("Expected implementation for checkIsClientReference."); + return checkIsClientReference(reference); +} require("ReactFeatureFlags"); var byteLengthImpl = null; function writeChunkAndReturn(destination, chunk) { destination.write(chunk); return !0; } -var registeredClientReferences = new Map(), - requestedClientReferencesKeys = new Set(), - ReactDOMFlightServerDispatcher = { - prefetchDNS: prefetchDNS, - preconnect: preconnect, - preload: preload, - preloadModule: preloadModule, - preinitStyle: preinitStyle, - preinitScript: preinitScript, - preinitModuleScript: preinitModuleScript - }; +var ReactDOMFlightServerDispatcher = { + prefetchDNS: prefetchDNS, + preconnect: preconnect, + preload: preload, + preloadModule: preloadModule, + preinitStyle: preinitStyle, + preinitScript: preinitScript, + preinitModuleScript: preinitModuleScript +}; function prefetchDNS(href) { if ("string" === typeof href && href) { var request = currentRequest ? currentRequest : null; @@ -647,8 +652,7 @@ function attemptResolveElement( "Refs cannot be used in Server Components, nor passed to Client Components." ); if ("function" === typeof type) { - if (registeredClientReferences.has(type)) - return [REACT_ELEMENT_TYPE, type, key, props]; + if (isClientReference(type)) return [REACT_ELEMENT_TYPE, type, key, props]; thenableIndexCounter = 0; thenableState = prevThenableState; props = type(props); @@ -666,8 +670,7 @@ function attemptResolveElement( ? props.children : [REACT_ELEMENT_TYPE, type, key, props]; if (null != type && "object" === typeof type) { - if (registeredClientReferences.has(type)) - return [REACT_ELEMENT_TYPE, type, key, props]; + if (isClientReference(type)) return [REACT_ELEMENT_TYPE, type, key, props]; switch (type.$$typeof) { case REACT_LAZY_TYPE: var init = type._init; @@ -727,15 +730,9 @@ function serializeByValueID(id) { return "$" + id.toString(16); } function serializeClientReference(request, parent, key, clientReference) { - var JSCompiler_inline_result = - registeredClientReferences.get(clientReference); - if (null != JSCompiler_inline_result) - requestedClientReferencesKeys.add(JSCompiler_inline_result.moduleId), - (JSCompiler_inline_result = JSCompiler_inline_result.moduleId); - else - throw Error( - "Expected client reference " + clientReference + " to be registered." - ); + var JSCompiler_inline_result = clientReference.getModuleId(); + requestedClientReferencesKeys.add(JSCompiler_inline_result); + JSCompiler_inline_result = clientReference.getModuleId(); var writtenClientReferences = request.writtenClientReferences, existingId = writtenClientReferences.get(JSCompiler_inline_result); if (void 0 !== existingId) @@ -743,16 +740,13 @@ function serializeClientReference(request, parent, key, clientReference) { ? "$L" + existingId.toString(16) : serializeByValueID(existingId); try { - var metadata = registeredClientReferences.get(clientReference); - if (null != metadata) var JSCompiler_inline_result$jscomp$0 = metadata; - else - throw Error( - "Expected client reference " + clientReference + " to be registered." - ); - clientReference = JSCompiler_inline_result$jscomp$0; + var clientReferenceMetadata = { + moduleId: clientReference.getModuleId(), + exportName: "default" + }; request.pendingChunks++; var importId = request.nextChunkId++, - json = stringify(clientReference), + json = stringify(clientReferenceMetadata), processedChunk = importId.toString(16) + ":I" + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(JSCompiler_inline_result, importId); @@ -852,7 +846,7 @@ function resolveModelToJSON(request, parent, key, value) { } if (null === value) return null; if ("object" === typeof value) { - if (registeredClientReferences.has(value)) + if (isClientReference(value)) return serializeClientReference(request, parent, key, value); parent = request.writtenObjects; key = parent.get(value); @@ -944,7 +938,7 @@ function resolveModelToJSON(request, parent, key, value) { ); if ("undefined" === typeof value) return "$undefined"; if ("function" === typeof value) { - if (registeredClientReferences.has(value)) + if (isClientReference(value)) return serializeClientReference(request, parent, key, value); throw Error("isServerReference: Not Implemented."); } @@ -1135,31 +1129,16 @@ exports.clearRequestedClientReferencesKeysSet = function () { exports.getRequestedClientReferencesKeys = function () { return Array.from(requestedClientReferencesKeys); }; -exports.registerClientReference = function (clientReference, moduleId) { - registeredClientReferences.set(clientReference, { - moduleId: moduleId, - exportName: "default" - }); - return clientReference; -}; +exports.registerClientReference = function () {}; exports.registerServerReference = function () { throw Error("registerServerReference: Not Implemented."); }; -exports.renderToDestination = function ( - destination, - model, - bundlerConfig, - options -) { +exports.renderToDestination = function (destination, model, options) { if (!configured) throw Error( "Please make sure to call `setConfig(...)` before calling `renderToDestination`." ); - model = createRequest( - model, - bundlerConfig, - options ? options.onError : void 0 - ); + model = createRequest(model, null, options ? options.onError : void 0); model.flushScheduled = null !== model.destination; performWork(model); if (1 === model.status) @@ -1175,7 +1154,11 @@ exports.renderToDestination = function ( } } }; +exports.setCheckIsClientReference = function (impl) { + checkIsClientReference = impl; +}; exports.setConfig = function (config) { byteLengthImpl = config.byteLength; + checkIsClientReference = config.isClientReference; configured = !0; }; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index a3cb3e26a28c..086f795d0011 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -25931,7 +25931,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-modern-25845ae4"; + var ReactVersion = "18.3.0-www-modern-8e6c02f7"; // Might add PROFILE later.