diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js
index c70d48ec0b..468d3f546e 100644
--- a/compiled/facebook-www/React-dev.classic.js
+++ b/compiled/facebook-www/React-dev.classic.js
@@ -27,7 +27,7 @@ if (
}
"use strict";
-var ReactVersion = "18.3.0-www-classic-e98225485-20221129";
+var ReactVersion = "18.3.0-www-classic-fa11bd6ec-20221130";
// ATTENTION
// When adding new symbols to this file,
diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js
index 6f4755c8c9..939526754c 100644
--- a/compiled/facebook-www/React-dev.modern.js
+++ b/compiled/facebook-www/React-dev.modern.js
@@ -27,7 +27,7 @@ if (
}
"use strict";
-var ReactVersion = "18.3.0-www-modern-e98225485-20221129";
+var ReactVersion = "18.3.0-www-modern-fa11bd6ec-20221130";
// ATTENTION
// When adding new symbols to this file,
diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js
index 2bac42fe76..a267a530f7 100644
--- a/compiled/facebook-www/React-prod.classic.js
+++ b/compiled/facebook-www/React-prod.classic.js
@@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
-exports.version = "18.3.0-www-classic-e98225485-20221129";
+exports.version = "18.3.0-www-classic-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js
index 45873fa0ed..cf62c729ae 100644
--- a/compiled/facebook-www/React-prod.modern.js
+++ b/compiled/facebook-www/React-prod.modern.js
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
-exports.version = "18.3.0-www-modern-e98225485-20221129";
+exports.version = "18.3.0-www-modern-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js
index 6685bce70f..2d52172b9c 100644
--- a/compiled/facebook-www/React-profiling.classic.js
+++ b/compiled/facebook-www/React-profiling.classic.js
@@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
-exports.version = "18.3.0-www-classic-e98225485-20221129";
+exports.version = "18.3.0-www-classic-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js
index 04b17ff20b..22ce5d5181 100644
--- a/compiled/facebook-www/React-profiling.modern.js
+++ b/compiled/facebook-www/React-profiling.modern.js
@@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
-exports.version = "18.3.0-www-modern-e98225485-20221129";
+exports.version = "18.3.0-www-modern-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js
index b176e3232d..dca7ef454c 100644
--- a/compiled/facebook-www/ReactART-dev.classic.js
+++ b/compiled/facebook-www/ReactART-dev.classic.js
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
-var ReactVersion = "18.3.0-www-classic-e98225485-20221129";
+var ReactVersion = "18.3.0-www-classic-fa11bd6ec-20221130";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js
index b63d240efe..b35c983180 100644
--- a/compiled/facebook-www/ReactART-dev.modern.js
+++ b/compiled/facebook-www/ReactART-dev.modern.js
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
-var ReactVersion = "18.3.0-www-modern-e98225485-20221129";
+var ReactVersion = "18.3.0-www-modern-fa11bd6ec-20221130";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js
index 3a6dd1f8c5..50b22ce67b 100644
--- a/compiled/facebook-www/ReactART-prod.classic.js
+++ b/compiled/facebook-www/ReactART-prod.classic.js
@@ -9806,7 +9806,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
- version: "18.3.0-www-classic-e98225485-20221129",
+ version: "18.3.0-www-classic-fa11bd6ec-20221130",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1336 = {
@@ -9837,7 +9837,7 @@ var internals$jscomp$inline_1336 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1337 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js
index ec830d78e4..4ff4445261 100644
--- a/compiled/facebook-www/ReactART-prod.modern.js
+++ b/compiled/facebook-www/ReactART-prod.modern.js
@@ -9473,7 +9473,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
- version: "18.3.0-www-modern-e98225485-20221129",
+ version: "18.3.0-www-modern-fa11bd6ec-20221130",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1327 = {
@@ -9504,7 +9504,7 @@ var internals$jscomp$inline_1327 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1328 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js
index f0d2991c4f..09a045382b 100644
--- a/compiled/facebook-www/ReactDOM-dev.classic.js
+++ b/compiled/facebook-www/ReactDOM-dev.classic.js
@@ -42595,7 +42595,7 @@ function createFiberRoot(
return root;
}
-var ReactVersion = "18.3.0-www-classic-e98225485-20221129";
+var ReactVersion = "18.3.0-www-classic-fa11bd6ec-20221130";
function createPortal(
children,
diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js
index 5590bf8b88..e5d9842a67 100644
--- a/compiled/facebook-www/ReactDOM-dev.modern.js
+++ b/compiled/facebook-www/ReactDOM-dev.modern.js
@@ -42319,7 +42319,7 @@ function createFiberRoot(
return root;
}
-var ReactVersion = "18.3.0-www-modern-e98225485-20221129";
+var ReactVersion = "18.3.0-www-modern-fa11bd6ec-20221130";
function createPortal(
children,
diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js
index b16ba6ffe6..faecd245ba 100644
--- a/compiled/facebook-www/ReactDOM-prod.classic.js
+++ b/compiled/facebook-www/ReactDOM-prod.classic.js
@@ -15556,7 +15556,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1773 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-classic-e98225485-20221129",
+ version: "18.3.0-www-classic-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2154 = {
@@ -15586,7 +15586,7 @@ var internals$jscomp$inline_2154 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2155 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15829,4 +15829,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js
index cd24e592e7..95d3d34a0a 100644
--- a/compiled/facebook-www/ReactDOM-prod.modern.js
+++ b/compiled/facebook-www/ReactDOM-prod.modern.js
@@ -15117,7 +15117,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1741 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-modern-e98225485-20221129",
+ version: "18.3.0-www-modern-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2129 = {
@@ -15148,7 +15148,7 @@ var internals$jscomp$inline_2129 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2130 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15337,4 +15337,4 @@ exports.unstable_flushControlled = function(fn) {
};
exports.unstable_isNewReconciler = !1;
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js
index 3466de1cee..caed7eecd7 100644
--- a/compiled/facebook-www/ReactDOM-profiling.classic.js
+++ b/compiled/facebook-www/ReactDOM-profiling.classic.js
@@ -16329,7 +16329,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1847 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-classic-e98225485-20221129",
+ version: "18.3.0-www-classic-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
(function(internals) {
@@ -16373,7 +16373,7 @@ var devToolsConfig$jscomp$inline_1847 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
});
assign(Internals, {
ReactBrowserEventEmitter: {
@@ -16603,7 +16603,7 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js
index 4ff4829b86..ad025e3c83 100644
--- a/compiled/facebook-www/ReactDOM-profiling.modern.js
+++ b/compiled/facebook-www/ReactDOM-profiling.modern.js
@@ -15880,7 +15880,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1815 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-modern-e98225485-20221129",
+ version: "18.3.0-www-modern-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
(function(internals) {
@@ -15925,7 +15925,7 @@ var devToolsConfig$jscomp$inline_1815 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function(children, container) {
@@ -16101,7 +16101,7 @@ exports.unstable_flushControlled = function(fn) {
};
exports.unstable_isNewReconciler = !1;
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/ReactDOMForked-dev.classic.js b/compiled/facebook-www/ReactDOMForked-dev.classic.js
index 3d2e1d5ea8..c0e6ee4c07 100644
--- a/compiled/facebook-www/ReactDOMForked-dev.classic.js
+++ b/compiled/facebook-www/ReactDOMForked-dev.classic.js
@@ -42595,7 +42595,7 @@ function createFiberRoot(
return root;
}
-var ReactVersion = "18.3.0-www-classic-e98225485-20221129";
+var ReactVersion = "18.3.0-www-classic-fa11bd6ec-20221130";
function createPortal(
children,
diff --git a/compiled/facebook-www/ReactDOMForked-dev.modern.js b/compiled/facebook-www/ReactDOMForked-dev.modern.js
index 1d22c0415d..8dd30cb17d 100644
--- a/compiled/facebook-www/ReactDOMForked-dev.modern.js
+++ b/compiled/facebook-www/ReactDOMForked-dev.modern.js
@@ -42319,7 +42319,7 @@ function createFiberRoot(
return root;
}
-var ReactVersion = "18.3.0-www-modern-e98225485-20221129";
+var ReactVersion = "18.3.0-www-modern-fa11bd6ec-20221130";
function createPortal(
children,
diff --git a/compiled/facebook-www/ReactDOMForked-prod.classic.js b/compiled/facebook-www/ReactDOMForked-prod.classic.js
index 748e2b4f9d..4f101c90b7 100644
--- a/compiled/facebook-www/ReactDOMForked-prod.classic.js
+++ b/compiled/facebook-www/ReactDOMForked-prod.classic.js
@@ -15556,7 +15556,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1773 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-classic-e98225485-20221129",
+ version: "18.3.0-www-classic-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2154 = {
@@ -15586,7 +15586,7 @@ var internals$jscomp$inline_2154 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2155 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15829,4 +15829,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/ReactDOMForked-prod.modern.js b/compiled/facebook-www/ReactDOMForked-prod.modern.js
index 868406d163..3c2a39fa1f 100644
--- a/compiled/facebook-www/ReactDOMForked-prod.modern.js
+++ b/compiled/facebook-www/ReactDOMForked-prod.modern.js
@@ -15117,7 +15117,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1741 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-modern-e98225485-20221129",
+ version: "18.3.0-www-modern-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2129 = {
@@ -15148,7 +15148,7 @@ var internals$jscomp$inline_2129 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2130 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15337,4 +15337,4 @@ exports.unstable_flushControlled = function(fn) {
};
exports.unstable_isNewReconciler = !0;
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
diff --git a/compiled/facebook-www/ReactDOMForked-profiling.classic.js b/compiled/facebook-www/ReactDOMForked-profiling.classic.js
index 0e9bc1f2b7..75deb1fcd2 100644
--- a/compiled/facebook-www/ReactDOMForked-profiling.classic.js
+++ b/compiled/facebook-www/ReactDOMForked-profiling.classic.js
@@ -16329,7 +16329,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1847 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-classic-e98225485-20221129",
+ version: "18.3.0-www-classic-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
(function(internals) {
@@ -16373,7 +16373,7 @@ var devToolsConfig$jscomp$inline_1847 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
});
assign(Internals, {
ReactBrowserEventEmitter: {
@@ -16603,7 +16603,7 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/ReactDOMForked-profiling.modern.js b/compiled/facebook-www/ReactDOMForked-profiling.modern.js
index ff752bc0b7..2c32dcd9e0 100644
--- a/compiled/facebook-www/ReactDOMForked-profiling.modern.js
+++ b/compiled/facebook-www/ReactDOMForked-profiling.modern.js
@@ -15880,7 +15880,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1815 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-modern-e98225485-20221129",
+ version: "18.3.0-www-modern-fa11bd6ec-20221130",
rendererPackageName: "react-dom"
};
(function(internals) {
@@ -15925,7 +15925,7 @@ var devToolsConfig$jscomp$inline_1815 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-next-e98225485-20221129"
+ reconcilerVersion: "18.3.0-next-fa11bd6ec-20221130"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function(children, container) {
@@ -16101,7 +16101,7 @@ exports.unstable_flushControlled = function(fn) {
};
exports.unstable_isNewReconciler = !0;
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-next-e98225485-20221129";
+exports.version = "18.3.0-next-fa11bd6ec-20221130";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js
index ac50e6977f..c9fc17c947 100644
--- a/compiled/facebook-www/ReactDOMServer-dev.classic.js
+++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
-var ReactVersion = "18.3.0-www-classic-e98225485-20221129";
+var ReactVersion = "18.3.0-www-classic-fa11bd6ec-20221130";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -2877,8 +2877,12 @@ function preinit(href, options) {
return;
}
- var resources = currentResources;
+ preinitImpl(currentResources, href, options);
+} // On the server, preinit may be called outside of render when sending an
+// external SSR runtime as part of the initial resources payload. Since this
+// is an internal React call, we do not need to use the resources stack.
+function preinitImpl(resources, href, options) {
{
validatePreinitArguments(href, options);
}
@@ -3610,7 +3614,10 @@ function cleanupAfterRender(previousDispatcher) {
finishRenderingResources();
ReactDOMCurrentDispatcher.current = previousDispatcher;
} // Used to distinguish these contexts from ones used in other renderers.
+var ScriptStreamingFormat = 0;
+var DataStreamingFormat = 1; // Per response, global state that is not contextual to the rendering subtree.
+var dataElementQuotedEnd = stringToPrecomputedChunk('">');
var startInlineScript = stringToPrecomputedChunk("");
var startScriptSrc = stringToPrecomputedChunk('');
+var completeSegmentScriptEnd = stringToPrecomputedChunk('")');
+var completeSegmentData1 = stringToPrecomputedChunk(
+ '");
+var completeBoundaryScript3a = stringToPrecomputedChunk('",');
+var completeBoundaryScript3b = stringToPrecomputedChunk('"');
+var completeBoundaryScriptEnd = stringToPrecomputedChunk(")");
+var completeBoundaryData1 = stringToPrecomputedChunk(
+ '");
var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(",");
+var clientRenderScriptEnd = stringToPrecomputedChunk(")");
+var clientRenderData1 = stringToPrecomputedChunk(
+ '
+ return writeChunkAndReturn(destination, clientRenderDataEnd);
+ }
}
var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g;
@@ -5995,7 +6113,28 @@ var precedencePlaceholderStart = stringToPrecomputedChunk(
'');
-function writeInitialResources(destination, resources, responseState) {
+function writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ // Write initially discovered resources after the shell completes
+ if (!willFlushAllSegments && responseState.externalRuntimeConfig) {
+ // If the root segment is incomplete due to suspended tasks
+ // (e.g. willFlushAllSegments = false) and we are using data
+ // streaming format, ensure the external runtime is sent.
+ // (User code could choose to send this even earlier by calling
+ // preinit(...), if they know they will suspend).
+ var _responseState$extern = responseState.externalRuntimeConfig,
+ src = _responseState$extern.src,
+ integrity = _responseState$extern.integrity;
+ preinitImpl(resources, src, {
+ as: "script",
+ integrity: integrity
+ });
+ }
+
function flushLinkResource(resource) {
if (!resource.flushed) {
pushLinkImpl(target, resource.props, responseState);
@@ -6217,21 +6356,23 @@ function hasStyleResourceDependencies(boundaryResources) {
var arrayFirstOpenBracket = stringToPrecomputedChunk("[");
var arraySubsequentOpenBracket = stringToPrecomputedChunk(",[");
var arrayInterstitial = stringToPrecomputedChunk(",");
-var arrayCloseBracket = stringToPrecomputedChunk("]");
+var arrayCloseBracket = stringToPrecomputedChunk("]"); // This function writes a 2D array of strings to be embedded in javascript.
+// E.g.
+// [["JS_escaped_string1", "JS_escaped_string2"]]
-function writeStyleResourceDependencies(destination, boundaryResources) {
+function writeStyleResourceDependenciesInJS(destination, boundaryResources) {
writeChunk(destination, arrayFirstOpenBracket);
var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
boundaryResources.forEach(function(resource) {
if (resource.inShell);
else if (resource.flushed) {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependencyHrefOnly(destination, resource.href);
+ writeStyleResourceDependencyHrefOnlyInJS(destination, resource.href);
writeChunk(destination, arrayCloseBracket);
nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
} else {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependency(
+ writeStyleResourceDependencyInJS(
destination,
resource.href,
resource.precedence,
@@ -6245,8 +6386,9 @@ function writeStyleResourceDependencies(destination, boundaryResources) {
});
writeChunk(destination, arrayCloseBracket);
}
+/* Helper functions */
-function writeStyleResourceDependencyHrefOnly(destination, href) {
+function writeStyleResourceDependencyHrefOnlyInJS(destination, href) {
// We should actually enforce this earlier when the resource is created but for
// now we make sure we are actually dealing with a string here.
{
@@ -6260,7 +6402,12 @@ function writeStyleResourceDependencyHrefOnly(destination, href) {
);
}
-function writeStyleResourceDependency(destination, href, precedence, props) {
+function writeStyleResourceDependencyInJS(
+ destination,
+ href,
+ precedence,
+ props
+) {
{
checkAttributeStringCoercion(href, "href");
}
@@ -6309,7 +6456,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
// eslint-disable-next-line-no-fallthrough
default:
- writeStyleResourceAttribute(destination, propKey, propValue);
+ writeStyleResourceAttributeInJS(destination, propKey, propValue);
break;
}
}
@@ -6318,7 +6465,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
return null;
}
-function writeStyleResourceAttribute(destination, name, value) {
+function writeStyleResourceAttributeInJS(destination, name, value) {
var attributeName = name.toLowerCase();
var attributeValue;
@@ -6396,23 +6543,224 @@ function writeStyleResourceAttribute(destination, name, value) {
destination,
stringToChunk(escapeJSObjectForInstructionScripts(attributeValue))
);
+} // This function writes a 2D array of strings to be embedded in an attribute
+// value and read with JSON.parse in ReactDOMServerExternalRuntime.js
+// E.g.
+// [["JSON_escaped_string1", "JSON_escaped_string2"]]
+
+function writeStyleResourceDependenciesInAttr(destination, boundaryResources) {
+ writeChunk(destination, arrayFirstOpenBracket);
+ var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
+ boundaryResources.forEach(function(resource) {
+ if (resource.inShell);
+ else if (resource.flushed) {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyHrefOnlyInAttr(destination, resource.href);
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ } else {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyInAttr(
+ destination,
+ resource.href,
+ resource.precedence,
+ resource.props
+ );
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ resource.flushed = true;
+ resource.hint.flushed = true;
+ }
+ });
+ writeChunk(destination, arrayCloseBracket);
+}
+/* Helper functions */
+
+function writeStyleResourceDependencyHrefOnlyInAttr(destination, href) {
+ // We should actually enforce this earlier when the resource is created but for
+ // now we make sure we are actually dealing with a string here.
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
}
-function createResponseState$1(generateStaticMarkup, identifierPrefix) {
- var responseState = createResponseState(identifierPrefix, undefined);
+function writeStyleResourceDependencyInAttr(
+ destination,
+ href,
+ precedence,
+ props
+) {
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ sanitizeURL(coercedHref);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
+
+ {
+ checkAttributeStringCoercion(precedence, "precedence");
+ }
+
+ var coercedPrecedence = "" + precedence;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedPrecedence)))
+ );
+
+ for (var propKey in props) {
+ if (hasOwnProperty.call(props, propKey)) {
+ var propValue = props[propKey];
+
+ if (propValue == null) {
+ continue;
+ }
+
+ switch (propKey) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence": {
+ break;
+ }
+
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw new Error(
+ "link" +
+ " is a self-closing tag and must neither have `children` nor " +
+ "use `dangerouslySetInnerHTML`."
+ );
+ // eslint-disable-next-line-no-fallthrough
+
+ default:
+ writeStyleResourceAttributeInAttr(destination, propKey, propValue);
+ break;
+ }
+ }
+ }
+
+ return null;
+}
+
+function writeStyleResourceAttributeInAttr(destination, name, value) {
+ var attributeName = name.toLowerCase();
+ var attributeValue;
+
+ switch (typeof value) {
+ case "function":
+ case "symbol":
+ return;
+ }
+
+ switch (name) {
+ // Reserved names
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ // Ignored
+ return;
+ // Attribute renames
+
+ case "className":
+ attributeName = "class";
+ break;
+ // Booleans
+
+ case "hidden":
+ if (value === false) {
+ return;
+ }
+
+ attributeValue = "";
+ break;
+ // Santized URLs
+
+ case "src":
+ case "href": {
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ sanitizeURL(attributeValue);
+ break;
+ }
+
+ default: {
+ if (!isAttributeNameSafe(name)) {
+ return;
+ }
+ }
+ }
+
+ if (
+ // shouldIgnoreAttribute
+ // We have already filtered out null/undefined and reserved words.
+ name.length > 2 &&
+ (name[0] === "o" || name[0] === "O") &&
+ (name[1] === "n" || name[1] === "N")
+ ) {
+ return;
+ }
+
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeName)))
+ );
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeValue)))
+ );
+}
+
+function createResponseState$1(
+ generateStaticMarkup,
+ identifierPrefix,
+ externalRuntimeConfig
+) {
+ var responseState = createResponseState(
+ identifierPrefix,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ externalRuntimeConfig
+ );
return {
// Keep this in sync with ReactDOMServerFormatConfig
bootstrapChunks: responseState.bootstrapChunks,
- startInlineScript: responseState.startInlineScript,
placeholderPrefix: responseState.placeholderPrefix,
segmentPrefix: responseState.segmentPrefix,
boundaryPrefix: responseState.boundaryPrefix,
idPrefix: responseState.idPrefix,
nextSuspenseID: responseState.nextSuspenseID,
+ streamingFormat: responseState.streamingFormat,
+ startInlineScript: responseState.startInlineScript,
sentCompleteSegmentFunction: responseState.sentCompleteSegmentFunction,
sentCompleteBoundaryFunction: responseState.sentCompleteBoundaryFunction,
sentClientRenderFunction: responseState.sentClientRenderFunction,
sentStyleInsertionFunction: responseState.sentStyleInsertionFunction,
+ externalRuntimeConfig: responseState.externalRuntimeConfig,
// This is an extra field for the legacy renderer
generateStaticMarkup: generateStaticMarkup
};
@@ -10811,8 +11159,18 @@ function flushSegment(request, destination, segment) {
}
}
-function flushInitialResources(destination, resources, responseState) {
- writeInitialResources(destination, resources, responseState);
+function flushInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+ );
}
function flushImmediateResources(destination, request) {
@@ -10957,7 +11315,8 @@ function flushCompletedQueues(request, destination) {
flushInitialResources(
destination,
request.resources,
- request.responseState
+ request.responseState,
+ request.allPendingTasks === 0
);
}
@@ -11136,7 +11495,8 @@ function renderToStringImpl(
children,
options,
generateStaticMarkup,
- abortReason
+ abortReason,
+ unstable_externalRuntimeSrc
) {
var didFatal = false;
var fatalError = null;
@@ -11164,7 +11524,8 @@ function renderToStringImpl(
children,
createResponseState$1(
generateStaticMarkup,
- options ? options.identifierPrefix : undefined
+ options ? options.identifierPrefix : undefined,
+ unstable_externalRuntimeSrc
),
createRootFormatContext(),
Infinity,
diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js
index e2a36ca2c8..15a5da478e 100644
--- a/compiled/facebook-www/ReactDOMServer-dev.modern.js
+++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
-var ReactVersion = "18.3.0-www-modern-e98225485-20221129";
+var ReactVersion = "18.3.0-www-modern-fa11bd6ec-20221130";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -2881,8 +2881,12 @@ function preinit(href, options) {
return;
}
- var resources = currentResources;
+ preinitImpl(currentResources, href, options);
+} // On the server, preinit may be called outside of render when sending an
+// external SSR runtime as part of the initial resources payload. Since this
+// is an internal React call, we do not need to use the resources stack.
+function preinitImpl(resources, href, options) {
{
validatePreinitArguments(href, options);
}
@@ -3614,7 +3618,10 @@ function cleanupAfterRender(previousDispatcher) {
finishRenderingResources();
ReactDOMCurrentDispatcher.current = previousDispatcher;
} // Used to distinguish these contexts from ones used in other renderers.
+var ScriptStreamingFormat = 0;
+var DataStreamingFormat = 1; // Per response, global state that is not contextual to the rendering subtree.
+var dataElementQuotedEnd = stringToPrecomputedChunk('">');
var startInlineScript = stringToPrecomputedChunk("");
var startScriptSrc = stringToPrecomputedChunk('');
+var completeSegmentScriptEnd = stringToPrecomputedChunk('")');
+var completeSegmentData1 = stringToPrecomputedChunk(
+ '");
+var completeBoundaryScript3a = stringToPrecomputedChunk('",');
+var completeBoundaryScript3b = stringToPrecomputedChunk('"');
+var completeBoundaryScriptEnd = stringToPrecomputedChunk(")");
+var completeBoundaryData1 = stringToPrecomputedChunk(
+ '");
var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(",");
+var clientRenderScriptEnd = stringToPrecomputedChunk(")");
+var clientRenderData1 = stringToPrecomputedChunk(
+ '
+ return writeChunkAndReturn(destination, clientRenderDataEnd);
+ }
}
var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g;
@@ -6020,7 +6138,28 @@ var precedencePlaceholderStart = stringToPrecomputedChunk(
'');
-function writeInitialResources(destination, resources, responseState) {
+function writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ // Write initially discovered resources after the shell completes
+ if (!willFlushAllSegments && responseState.externalRuntimeConfig) {
+ // If the root segment is incomplete due to suspended tasks
+ // (e.g. willFlushAllSegments = false) and we are using data
+ // streaming format, ensure the external runtime is sent.
+ // (User code could choose to send this even earlier by calling
+ // preinit(...), if they know they will suspend).
+ var _responseState$extern = responseState.externalRuntimeConfig,
+ src = _responseState$extern.src,
+ integrity = _responseState$extern.integrity;
+ preinitImpl(resources, src, {
+ as: "script",
+ integrity: integrity
+ });
+ }
+
function flushLinkResource(resource) {
if (!resource.flushed) {
pushLinkImpl(target, resource.props, responseState);
@@ -6242,21 +6381,23 @@ function hasStyleResourceDependencies(boundaryResources) {
var arrayFirstOpenBracket = stringToPrecomputedChunk("[");
var arraySubsequentOpenBracket = stringToPrecomputedChunk(",[");
var arrayInterstitial = stringToPrecomputedChunk(",");
-var arrayCloseBracket = stringToPrecomputedChunk("]");
+var arrayCloseBracket = stringToPrecomputedChunk("]"); // This function writes a 2D array of strings to be embedded in javascript.
+// E.g.
+// [["JS_escaped_string1", "JS_escaped_string2"]]
-function writeStyleResourceDependencies(destination, boundaryResources) {
+function writeStyleResourceDependenciesInJS(destination, boundaryResources) {
writeChunk(destination, arrayFirstOpenBracket);
var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
boundaryResources.forEach(function(resource) {
if (resource.inShell);
else if (resource.flushed) {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependencyHrefOnly(destination, resource.href);
+ writeStyleResourceDependencyHrefOnlyInJS(destination, resource.href);
writeChunk(destination, arrayCloseBracket);
nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
} else {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependency(
+ writeStyleResourceDependencyInJS(
destination,
resource.href,
resource.precedence,
@@ -6270,8 +6411,9 @@ function writeStyleResourceDependencies(destination, boundaryResources) {
});
writeChunk(destination, arrayCloseBracket);
}
+/* Helper functions */
-function writeStyleResourceDependencyHrefOnly(destination, href) {
+function writeStyleResourceDependencyHrefOnlyInJS(destination, href) {
// We should actually enforce this earlier when the resource is created but for
// now we make sure we are actually dealing with a string here.
{
@@ -6285,7 +6427,12 @@ function writeStyleResourceDependencyHrefOnly(destination, href) {
);
}
-function writeStyleResourceDependency(destination, href, precedence, props) {
+function writeStyleResourceDependencyInJS(
+ destination,
+ href,
+ precedence,
+ props
+) {
{
checkAttributeStringCoercion(href, "href");
}
@@ -6334,7 +6481,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
// eslint-disable-next-line-no-fallthrough
default:
- writeStyleResourceAttribute(destination, propKey, propValue);
+ writeStyleResourceAttributeInJS(destination, propKey, propValue);
break;
}
}
@@ -6343,7 +6490,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
return null;
}
-function writeStyleResourceAttribute(destination, name, value) {
+function writeStyleResourceAttributeInJS(destination, name, value) {
var attributeName = name.toLowerCase();
var attributeValue;
@@ -6421,23 +6568,224 @@ function writeStyleResourceAttribute(destination, name, value) {
destination,
stringToChunk(escapeJSObjectForInstructionScripts(attributeValue))
);
+} // This function writes a 2D array of strings to be embedded in an attribute
+// value and read with JSON.parse in ReactDOMServerExternalRuntime.js
+// E.g.
+// [["JSON_escaped_string1", "JSON_escaped_string2"]]
+
+function writeStyleResourceDependenciesInAttr(destination, boundaryResources) {
+ writeChunk(destination, arrayFirstOpenBracket);
+ var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
+ boundaryResources.forEach(function(resource) {
+ if (resource.inShell);
+ else if (resource.flushed) {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyHrefOnlyInAttr(destination, resource.href);
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ } else {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyInAttr(
+ destination,
+ resource.href,
+ resource.precedence,
+ resource.props
+ );
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ resource.flushed = true;
+ resource.hint.flushed = true;
+ }
+ });
+ writeChunk(destination, arrayCloseBracket);
+}
+/* Helper functions */
+
+function writeStyleResourceDependencyHrefOnlyInAttr(destination, href) {
+ // We should actually enforce this earlier when the resource is created but for
+ // now we make sure we are actually dealing with a string here.
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
}
-function createResponseState$1(generateStaticMarkup, identifierPrefix) {
- var responseState = createResponseState(identifierPrefix, undefined);
+function writeStyleResourceDependencyInAttr(
+ destination,
+ href,
+ precedence,
+ props
+) {
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ sanitizeURL(coercedHref);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
+
+ {
+ checkAttributeStringCoercion(precedence, "precedence");
+ }
+
+ var coercedPrecedence = "" + precedence;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedPrecedence)))
+ );
+
+ for (var propKey in props) {
+ if (hasOwnProperty.call(props, propKey)) {
+ var propValue = props[propKey];
+
+ if (propValue == null) {
+ continue;
+ }
+
+ switch (propKey) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence": {
+ break;
+ }
+
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw new Error(
+ "link" +
+ " is a self-closing tag and must neither have `children` nor " +
+ "use `dangerouslySetInnerHTML`."
+ );
+ // eslint-disable-next-line-no-fallthrough
+
+ default:
+ writeStyleResourceAttributeInAttr(destination, propKey, propValue);
+ break;
+ }
+ }
+ }
+
+ return null;
+}
+
+function writeStyleResourceAttributeInAttr(destination, name, value) {
+ var attributeName = name.toLowerCase();
+ var attributeValue;
+
+ switch (typeof value) {
+ case "function":
+ case "symbol":
+ return;
+ }
+
+ switch (name) {
+ // Reserved names
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ // Ignored
+ return;
+ // Attribute renames
+
+ case "className":
+ attributeName = "class";
+ break;
+ // Booleans
+
+ case "hidden":
+ if (value === false) {
+ return;
+ }
+
+ attributeValue = "";
+ break;
+ // Santized URLs
+
+ case "src":
+ case "href": {
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ sanitizeURL(attributeValue);
+ break;
+ }
+
+ default: {
+ if (!isAttributeNameSafe(name)) {
+ return;
+ }
+ }
+ }
+
+ if (
+ // shouldIgnoreAttribute
+ // We have already filtered out null/undefined and reserved words.
+ name.length > 2 &&
+ (name[0] === "o" || name[0] === "O") &&
+ (name[1] === "n" || name[1] === "N")
+ ) {
+ return;
+ }
+
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeName)))
+ );
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeValue)))
+ );
+}
+
+function createResponseState$1(
+ generateStaticMarkup,
+ identifierPrefix,
+ externalRuntimeConfig
+) {
+ var responseState = createResponseState(
+ identifierPrefix,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ externalRuntimeConfig
+ );
return {
// Keep this in sync with ReactDOMServerFormatConfig
bootstrapChunks: responseState.bootstrapChunks,
- startInlineScript: responseState.startInlineScript,
placeholderPrefix: responseState.placeholderPrefix,
segmentPrefix: responseState.segmentPrefix,
boundaryPrefix: responseState.boundaryPrefix,
idPrefix: responseState.idPrefix,
nextSuspenseID: responseState.nextSuspenseID,
+ streamingFormat: responseState.streamingFormat,
+ startInlineScript: responseState.startInlineScript,
sentCompleteSegmentFunction: responseState.sentCompleteSegmentFunction,
sentCompleteBoundaryFunction: responseState.sentCompleteBoundaryFunction,
sentClientRenderFunction: responseState.sentClientRenderFunction,
sentStyleInsertionFunction: responseState.sentStyleInsertionFunction,
+ externalRuntimeConfig: responseState.externalRuntimeConfig,
// This is an extra field for the legacy renderer
generateStaticMarkup: generateStaticMarkup
};
@@ -10586,8 +10934,18 @@ function flushSegment(request, destination, segment) {
}
}
-function flushInitialResources(destination, resources, responseState) {
- writeInitialResources(destination, resources, responseState);
+function flushInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+ );
}
function flushImmediateResources(destination, request) {
@@ -10732,7 +11090,8 @@ function flushCompletedQueues(request, destination) {
flushInitialResources(
destination,
request.resources,
- request.responseState
+ request.responseState,
+ request.allPendingTasks === 0
);
}
@@ -10911,7 +11270,8 @@ function renderToStringImpl(
children,
options,
generateStaticMarkup,
- abortReason
+ abortReason,
+ unstable_externalRuntimeSrc
) {
var didFatal = false;
var fatalError = null;
@@ -10939,7 +11299,8 @@ function renderToStringImpl(
children,
createResponseState$1(
generateStaticMarkup,
- options ? options.identifierPrefix : undefined
+ options ? options.identifierPrefix : undefined,
+ unstable_externalRuntimeSrc
),
createRootFormatContext(),
Infinity,
diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js
index 657fcb751c..d3688da13a 100644
--- a/compiled/facebook-www/ReactDOMServer-prod.classic.js
+++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js
@@ -339,40 +339,40 @@ function preload(href, options) {
}
}
function preinit(href, options) {
- if (currentResources) {
- var resources = currentResources;
- if (
- "string" === typeof href &&
- href &&
- "object" === typeof options &&
- null !== options
- )
- switch (options.as) {
- case "style":
- var resource = resources.stylesMap.get(href);
+ currentResources && preinitImpl(currentResources, href, options);
+}
+function preinitImpl(resources, href, options) {
+ if (
+ "string" === typeof href &&
+ href &&
+ "object" === typeof options &&
+ null !== options
+ )
+ switch (options.as) {
+ case "style":
+ var resource = resources.stylesMap.get(href);
+ resource ||
+ ((resource = options.precedence || "default"),
+ (resource = createStyleResource(resources, href, resource, {
+ rel: "stylesheet",
+ href: href,
+ "data-precedence": resource,
+ crossOrigin: options.crossOrigin
+ })));
+ resource.set.add(resource);
+ resources.explicitStylePreloads.add(resource.hint);
+ break;
+ case "script":
+ (resource = resources.scriptsMap.get(href)),
resource ||
- ((resource = options.precedence || "default"),
- (resource = createStyleResource(resources, href, resource, {
- rel: "stylesheet",
- href: href,
- "data-precedence": resource,
- crossOrigin: options.crossOrigin
- })));
- resource.set.add(resource);
- resources.explicitStylePreloads.add(resource.hint);
- break;
- case "script":
- (resource = resources.scriptsMap.get(href)),
- resource ||
- ((resource = createScriptResource(resources, href, {
- src: href,
- async: !0,
- crossOrigin: options.crossOrigin,
- integrity: options.integrity
- })),
- resources.scripts.add(resource));
- }
- }
+ ((resource = createScriptResource(resources, href, {
+ src: href,
+ async: !0,
+ crossOrigin: options.crossOrigin,
+ integrity: options.integrity
+ })),
+ resources.scripts.add(resource));
+ }
}
function preloadAsStylePropsFromProps(href, props) {
return {
@@ -1449,15 +1449,27 @@ function escapeJSObjectForInstructionScripts(input) {
}
});
}
-function writeInitialResources(destination, resources, responseState) {
+function writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
function flushLinkResource(resource) {
resource.flushed ||
(pushLinkImpl(target, resource.props, responseState),
(resource.flushed = !0));
}
- var target = [],
- charset = resources.charset,
- bases = resources.bases,
+ !willFlushAllSegments &&
+ responseState.externalRuntimeConfig &&
+ ((willFlushAllSegments = responseState.externalRuntimeConfig),
+ preinitImpl(resources, willFlushAllSegments.src, {
+ as: "script",
+ integrity: willFlushAllSegments.integrity
+ }));
+ var target = [];
+ willFlushAllSegments = resources.charset;
+ var bases = resources.bases,
preconnects = resources.preconnects,
fontPreloads = resources.fontPreloads,
precedences = resources.precedences,
@@ -1467,9 +1479,9 @@ function writeInitialResources(destination, resources, responseState) {
explicitStylePreloads = resources.explicitStylePreloads,
explicitScriptPreloads = resources.explicitScriptPreloads,
headResources = resources.headResources;
- charset &&
- (pushSelfClosing(target, charset.props, "meta", responseState),
- (charset.flushed = !0),
+ willFlushAllSegments &&
+ (pushSelfClosing(target, willFlushAllSegments.props, "meta", responseState),
+ (willFlushAllSegments.flushed = !0),
(resources.charset = null));
bases.forEach(function(r) {
pushSelfClosing(target, r.props, "base", responseState);
@@ -1529,11 +1541,12 @@ function writeInitialResources(destination, resources, responseState) {
r.flushed = !0;
});
headResources.clear();
- charset = !0;
+ willFlushAllSegments = !0;
for (resources = 0; resources < target.length - 1; resources++)
destination.push(target[resources]);
- resources < target.length && (charset = destination.push(target[resources]));
- return charset;
+ resources < target.length &&
+ (willFlushAllSegments = destination.push(target[resources]));
+ return willFlushAllSegments;
}
function writeImmediateResources(destination, resources, responseState) {
function flushLinkResource(resource) {
@@ -1600,7 +1613,7 @@ function writeImmediateResources(destination, resources, responseState) {
resources < target.length && (charset = destination.push(target[resources]));
return charset;
}
-function writeStyleResourceDependencies(destination, boundaryResources) {
+function writeStyleResourceDependenciesInJS(destination, boundaryResources) {
destination.push("[");
var nextArrayOpenBrackChunk = "[";
boundaryResources.forEach(function(resource) {
@@ -1693,20 +1706,127 @@ function writeStyleResourceDependencies(destination, boundaryResources) {
});
destination.push("]");
}
-function createResponseState$1(generateStaticMarkup, identifierPrefix) {
+function writeStyleResourceDependenciesInAttr(destination, boundaryResources) {
+ destination.push("[");
+ var nextArrayOpenBrackChunk = "[";
+ boundaryResources.forEach(function(resource) {
+ if (!resource.inShell)
+ if (resource.flushed)
+ destination.push(nextArrayOpenBrackChunk),
+ (resource = escapeTextForBrowser(JSON.stringify("" + resource.href))),
+ destination.push(resource),
+ destination.push("]"),
+ (nextArrayOpenBrackChunk = ",[");
+ else {
+ destination.push(nextArrayOpenBrackChunk);
+ var precedence = resource.precedence,
+ props = resource.props,
+ coercedHref = "" + resource.href;
+ sanitizeURL(coercedHref);
+ coercedHref = escapeTextForBrowser(JSON.stringify(coercedHref));
+ destination.push(coercedHref);
+ precedence = "" + precedence;
+ destination.push(",");
+ precedence = escapeTextForBrowser(JSON.stringify(precedence));
+ destination.push(precedence);
+ for (var propKey in props)
+ if (hasOwnProperty.call(props, propKey)) {
+ var propValue = props[propKey];
+ if (null != propValue)
+ switch (propKey) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence":
+ break;
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(formatProdErrorMessage(399, "link"));
+ default:
+ a: {
+ precedence = destination;
+ var name = propKey;
+ coercedHref = name.toLowerCase();
+ switch (typeof propValue) {
+ case "function":
+ case "symbol":
+ break a;
+ }
+ switch (name) {
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ break a;
+ case "className":
+ coercedHref = "class";
+ break;
+ case "hidden":
+ if (!1 === propValue) break a;
+ break;
+ case "src":
+ case "href":
+ sanitizeURL("" + propValue);
+ break;
+ default:
+ if (!isAttributeNameSafe(name)) break a;
+ }
+ if (
+ !(2 < name.length) ||
+ ("o" !== name[0] && "O" !== name[0]) ||
+ ("n" !== name[1] && "N" !== name[1])
+ )
+ (propValue = "" + propValue),
+ precedence.push(","),
+ (coercedHref = escapeTextForBrowser(
+ JSON.stringify(coercedHref)
+ )),
+ precedence.push(coercedHref),
+ precedence.push(","),
+ (coercedHref = escapeTextForBrowser(
+ JSON.stringify(propValue)
+ )),
+ precedence.push(coercedHref);
+ }
+ }
+ }
+ destination.push("]");
+ nextArrayOpenBrackChunk = ",[";
+ resource.flushed = !0;
+ resource.hint.flushed = !0;
+ }
+ });
+ destination.push("]");
+}
+function createResponseState$1(
+ generateStaticMarkup,
+ identifierPrefix,
+ externalRuntimeConfig
+) {
identifierPrefix = void 0 === identifierPrefix ? "" : identifierPrefix;
+ var externalRuntimeDesc = null,
+ streamingFormat = 0;
+ void 0 !== externalRuntimeConfig &&
+ ((streamingFormat = 1),
+ (externalRuntimeDesc =
+ "string" === typeof externalRuntimeConfig
+ ? { src: externalRuntimeConfig, integrity: void 0 }
+ : externalRuntimeConfig));
return {
bootstrapChunks: [],
- startInlineScript: "");
var startScriptSrc = stringToPrecomputedChunk('');
+var completeSegmentScriptEnd = stringToPrecomputedChunk('")');
+var completeSegmentData1 = stringToPrecomputedChunk(
+ '");
+var completeBoundaryScript3a = stringToPrecomputedChunk('",');
+var completeBoundaryScript3b = stringToPrecomputedChunk('"');
+var completeBoundaryScriptEnd = stringToPrecomputedChunk(")");
+var completeBoundaryData1 = stringToPrecomputedChunk(
+ '");
var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(",");
+var clientRenderScriptEnd = stringToPrecomputedChunk(")");
+var clientRenderData1 = stringToPrecomputedChunk(
+ '
+ return writeChunkAndReturn(destination, clientRenderDataEnd);
+ }
}
var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g;
@@ -6027,7 +6145,28 @@ var precedencePlaceholderStart = stringToPrecomputedChunk(
'');
-function writeInitialResources(destination, resources, responseState) {
+function writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ // Write initially discovered resources after the shell completes
+ if (!willFlushAllSegments && responseState.externalRuntimeConfig) {
+ // If the root segment is incomplete due to suspended tasks
+ // (e.g. willFlushAllSegments = false) and we are using data
+ // streaming format, ensure the external runtime is sent.
+ // (User code could choose to send this even earlier by calling
+ // preinit(...), if they know they will suspend).
+ var _responseState$extern = responseState.externalRuntimeConfig,
+ src = _responseState$extern.src,
+ integrity = _responseState$extern.integrity;
+ preinitImpl(resources, src, {
+ as: "script",
+ integrity: integrity
+ });
+ }
+
function flushLinkResource(resource) {
if (!resource.flushed) {
pushLinkImpl(target, resource.props, responseState);
@@ -6249,21 +6388,23 @@ function hasStyleResourceDependencies(boundaryResources) {
var arrayFirstOpenBracket = stringToPrecomputedChunk("[");
var arraySubsequentOpenBracket = stringToPrecomputedChunk(",[");
var arrayInterstitial = stringToPrecomputedChunk(",");
-var arrayCloseBracket = stringToPrecomputedChunk("]");
+var arrayCloseBracket = stringToPrecomputedChunk("]"); // This function writes a 2D array of strings to be embedded in javascript.
+// E.g.
+// [["JS_escaped_string1", "JS_escaped_string2"]]
-function writeStyleResourceDependencies(destination, boundaryResources) {
+function writeStyleResourceDependenciesInJS(destination, boundaryResources) {
writeChunk(destination, arrayFirstOpenBracket);
var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
boundaryResources.forEach(function(resource) {
if (resource.inShell);
else if (resource.flushed) {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependencyHrefOnly(destination, resource.href);
+ writeStyleResourceDependencyHrefOnlyInJS(destination, resource.href);
writeChunk(destination, arrayCloseBracket);
nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
} else {
writeChunk(destination, nextArrayOpenBrackChunk);
- writeStyleResourceDependency(
+ writeStyleResourceDependencyInJS(
destination,
resource.href,
resource.precedence,
@@ -6277,8 +6418,9 @@ function writeStyleResourceDependencies(destination, boundaryResources) {
});
writeChunk(destination, arrayCloseBracket);
}
+/* Helper functions */
-function writeStyleResourceDependencyHrefOnly(destination, href) {
+function writeStyleResourceDependencyHrefOnlyInJS(destination, href) {
// We should actually enforce this earlier when the resource is created but for
// now we make sure we are actually dealing with a string here.
{
@@ -6292,7 +6434,12 @@ function writeStyleResourceDependencyHrefOnly(destination, href) {
);
}
-function writeStyleResourceDependency(destination, href, precedence, props) {
+function writeStyleResourceDependencyInJS(
+ destination,
+ href,
+ precedence,
+ props
+) {
{
checkAttributeStringCoercion(href, "href");
}
@@ -6341,7 +6488,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
// eslint-disable-next-line-no-fallthrough
default:
- writeStyleResourceAttribute(destination, propKey, propValue);
+ writeStyleResourceAttributeInJS(destination, propKey, propValue);
break;
}
}
@@ -6350,7 +6497,7 @@ function writeStyleResourceDependency(destination, href, precedence, props) {
return null;
}
-function writeStyleResourceAttribute(destination, name, value) {
+function writeStyleResourceAttributeInJS(destination, name, value) {
var attributeName = name.toLowerCase();
var attributeValue;
@@ -6428,6 +6575,194 @@ function writeStyleResourceAttribute(destination, name, value) {
destination,
stringToChunk(escapeJSObjectForInstructionScripts(attributeValue))
);
+} // This function writes a 2D array of strings to be embedded in an attribute
+// value and read with JSON.parse in ReactDOMServerExternalRuntime.js
+// E.g.
+// [["JSON_escaped_string1", "JSON_escaped_string2"]]
+
+function writeStyleResourceDependenciesInAttr(destination, boundaryResources) {
+ writeChunk(destination, arrayFirstOpenBracket);
+ var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
+ boundaryResources.forEach(function(resource) {
+ if (resource.inShell);
+ else if (resource.flushed) {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyHrefOnlyInAttr(destination, resource.href);
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ } else {
+ writeChunk(destination, nextArrayOpenBrackChunk);
+ writeStyleResourceDependencyInAttr(
+ destination,
+ resource.href,
+ resource.precedence,
+ resource.props
+ );
+ writeChunk(destination, arrayCloseBracket);
+ nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
+ resource.flushed = true;
+ resource.hint.flushed = true;
+ }
+ });
+ writeChunk(destination, arrayCloseBracket);
+}
+/* Helper functions */
+
+function writeStyleResourceDependencyHrefOnlyInAttr(destination, href) {
+ // We should actually enforce this earlier when the resource is created but for
+ // now we make sure we are actually dealing with a string here.
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
+}
+
+function writeStyleResourceDependencyInAttr(
+ destination,
+ href,
+ precedence,
+ props
+) {
+ {
+ checkAttributeStringCoercion(href, "href");
+ }
+
+ var coercedHref = "" + href;
+ sanitizeURL(coercedHref);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedHref)))
+ );
+
+ {
+ checkAttributeStringCoercion(precedence, "precedence");
+ }
+
+ var coercedPrecedence = "" + precedence;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(coercedPrecedence)))
+ );
+
+ for (var propKey in props) {
+ if (hasOwnProperty.call(props, propKey)) {
+ var propValue = props[propKey];
+
+ if (propValue == null) {
+ continue;
+ }
+
+ switch (propKey) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence": {
+ break;
+ }
+
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw new Error(
+ "link" +
+ " is a self-closing tag and must neither have `children` nor " +
+ "use `dangerouslySetInnerHTML`."
+ );
+ // eslint-disable-next-line-no-fallthrough
+
+ default:
+ writeStyleResourceAttributeInAttr(destination, propKey, propValue);
+ break;
+ }
+ }
+ }
+
+ return null;
+}
+
+function writeStyleResourceAttributeInAttr(destination, name, value) {
+ var attributeName = name.toLowerCase();
+ var attributeValue;
+
+ switch (typeof value) {
+ case "function":
+ case "symbol":
+ return;
+ }
+
+ switch (name) {
+ // Reserved names
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ // Ignored
+ return;
+ // Attribute renames
+
+ case "className":
+ attributeName = "class";
+ break;
+ // Booleans
+
+ case "hidden":
+ if (value === false) {
+ return;
+ }
+
+ attributeValue = "";
+ break;
+ // Santized URLs
+
+ case "src":
+ case "href": {
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ sanitizeURL(attributeValue);
+ break;
+ }
+
+ default: {
+ if (!isAttributeNameSafe(name)) {
+ return;
+ }
+ }
+ }
+
+ if (
+ // shouldIgnoreAttribute
+ // We have already filtered out null/undefined and reserved words.
+ name.length > 2 &&
+ (name[0] === "o" || name[0] === "O") &&
+ (name[1] === "n" || name[1] === "N")
+ ) {
+ return;
+ }
+
+ {
+ checkAttributeStringCoercion(value, attributeName);
+ }
+
+ attributeValue = "" + value;
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeName)))
+ );
+ writeChunk(destination, arrayInterstitial);
+ writeChunk(
+ destination,
+ stringToChunk(escapeTextForBrowser(JSON.stringify(attributeValue)))
+ );
}
// ATTENTION
@@ -10492,8 +10827,18 @@ function flushSegment(request, destination, segment) {
}
}
-function flushInitialResources(destination, resources, responseState) {
- writeInitialResources(destination, resources, responseState);
+function flushInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
+ writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+ );
}
function flushImmediateResources(destination, request) {
@@ -10638,7 +10983,8 @@ function flushCompletedQueues(request, destination) {
flushInitialResources(
destination,
request.resources,
- request.responseState
+ request.responseState,
+ request.allPendingTasks === 0
);
}
@@ -10817,7 +11163,8 @@ function renderToStream(children, options) {
undefined,
options ? options.bootstrapScriptContent : undefined,
options ? options.bootstrapScripts : undefined,
- options ? options.bootstrapModules : undefined
+ options ? options.bootstrapModules : undefined,
+ options ? options.unstable_externalRuntimeSrc : undefined
),
createRootFormatContext(undefined),
options ? options.progressiveChunkSize : undefined,
diff --git a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
index 7ffe2df50e..512d1c79d2 100644
--- a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
+++ b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
@@ -333,40 +333,40 @@ function preload(href, options) {
}
}
function preinit(href, options) {
- if (currentResources) {
- var resources = currentResources;
- if (
- "string" === typeof href &&
- href &&
- "object" === typeof options &&
- null !== options
- )
- switch (options.as) {
- case "style":
- var resource = resources.stylesMap.get(href);
+ currentResources && preinitImpl(currentResources, href, options);
+}
+function preinitImpl(resources, href, options) {
+ if (
+ "string" === typeof href &&
+ href &&
+ "object" === typeof options &&
+ null !== options
+ )
+ switch (options.as) {
+ case "style":
+ var resource = resources.stylesMap.get(href);
+ resource ||
+ ((resource = options.precedence || "default"),
+ (resource = createStyleResource(resources, href, resource, {
+ rel: "stylesheet",
+ href: href,
+ "data-precedence": resource,
+ crossOrigin: options.crossOrigin
+ })));
+ resource.set.add(resource);
+ resources.explicitStylePreloads.add(resource.hint);
+ break;
+ case "script":
+ (resource = resources.scriptsMap.get(href)),
resource ||
- ((resource = options.precedence || "default"),
- (resource = createStyleResource(resources, href, resource, {
- rel: "stylesheet",
- href: href,
- "data-precedence": resource,
- crossOrigin: options.crossOrigin
- })));
- resource.set.add(resource);
- resources.explicitStylePreloads.add(resource.hint);
- break;
- case "script":
- (resource = resources.scriptsMap.get(href)),
- resource ||
- ((resource = createScriptResource(resources, href, {
- src: href,
- async: !0,
- crossOrigin: options.crossOrigin,
- integrity: options.integrity
- })),
- resources.scripts.add(resource));
- }
- }
+ ((resource = createScriptResource(resources, href, {
+ src: href,
+ async: !0,
+ crossOrigin: options.crossOrigin,
+ integrity: options.integrity
+ })),
+ resources.scripts.add(resource));
+ }
}
function preloadAsStylePropsFromProps(href, props) {
return {
@@ -1504,15 +1504,27 @@ function escapeJSObjectForInstructionScripts(input) {
}
});
}
-function writeInitialResources(destination, resources, responseState) {
+function writeInitialResources(
+ destination,
+ resources,
+ responseState,
+ willFlushAllSegments
+) {
function flushLinkResource(resource) {
resource.flushed ||
(pushLinkImpl(target, resource.props, responseState),
(resource.flushed = !0));
}
- var target = [],
- charset = resources.charset,
- bases = resources.bases,
+ !willFlushAllSegments &&
+ responseState.externalRuntimeConfig &&
+ ((willFlushAllSegments = responseState.externalRuntimeConfig),
+ preinitImpl(resources, willFlushAllSegments.src, {
+ as: "script",
+ integrity: willFlushAllSegments.integrity
+ }));
+ var target = [];
+ willFlushAllSegments = resources.charset;
+ var bases = resources.bases,
preconnects = resources.preconnects,
fontPreloads = resources.fontPreloads,
precedences = resources.precedences,
@@ -1522,9 +1534,9 @@ function writeInitialResources(destination, resources, responseState) {
explicitStylePreloads = resources.explicitStylePreloads,
explicitScriptPreloads = resources.explicitScriptPreloads,
headResources = resources.headResources;
- charset &&
- (pushSelfClosing(target, charset.props, "meta", responseState),
- (charset.flushed = !0),
+ willFlushAllSegments &&
+ (pushSelfClosing(target, willFlushAllSegments.props, "meta", responseState),
+ (willFlushAllSegments.flushed = !0),
(resources.charset = null));
bases.forEach(function(r) {
pushSelfClosing(target, r.props, "base", responseState);
@@ -1584,12 +1596,15 @@ function writeInitialResources(destination, resources, responseState) {
r.flushed = !0;
});
headResources.clear();
- charset = !0;
+ willFlushAllSegments = !0;
for (resources = 0; resources < target.length - 1; resources++)
destination.buffer += target[resources];
resources < target.length &&
- (charset = writeChunkAndReturn(destination, target[resources]));
- return charset;
+ (willFlushAllSegments = writeChunkAndReturn(
+ destination,
+ target[resources]
+ ));
+ return willFlushAllSegments;
}
function writeImmediateResources(destination, resources, responseState) {
function flushLinkResource(resource) {
@@ -1657,7 +1672,7 @@ function writeImmediateResources(destination, resources, responseState) {
(charset = writeChunkAndReturn(destination, target[resources]));
return charset;
}
-function writeStyleResourceDependencies(destination, boundaryResources) {
+function writeStyleResourceDependenciesInJS(destination, boundaryResources) {
destination.buffer += "[";
var nextArrayOpenBrackChunk = "[";
boundaryResources.forEach(function(resource) {
@@ -1758,6 +1773,107 @@ function writeStyleResourceDependencies(destination, boundaryResources) {
});
destination.buffer += "]";
}
+function writeStyleResourceDependenciesInAttr(destination, boundaryResources) {
+ destination.buffer += "[";
+ var nextArrayOpenBrackChunk = "[";
+ boundaryResources.forEach(function(resource) {
+ if (!resource.inShell)
+ if (resource.flushed)
+ (destination.buffer += nextArrayOpenBrackChunk),
+ writeChunk(
+ destination,
+ escapeTextForBrowser(JSON.stringify("" + resource.href))
+ ),
+ (destination.buffer += "]"),
+ (nextArrayOpenBrackChunk = ",[");
+ else {
+ destination.buffer += nextArrayOpenBrackChunk;
+ var precedence = resource.precedence,
+ props = resource.props,
+ coercedHref = "" + resource.href;
+ sanitizeURL(coercedHref);
+ writeChunk(
+ destination,
+ escapeTextForBrowser(JSON.stringify(coercedHref))
+ );
+ precedence = "" + precedence;
+ writeChunk(destination, ",");
+ writeChunk(
+ destination,
+ escapeTextForBrowser(JSON.stringify(precedence))
+ );
+ for (var propKey in props)
+ if (hasOwnProperty.call(props, propKey)) {
+ var propValue = props[propKey];
+ if (null != propValue)
+ switch (propKey) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence":
+ break;
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
+ );
+ default:
+ a: {
+ precedence = destination;
+ var name = propKey;
+ coercedHref = name.toLowerCase();
+ switch (typeof propValue) {
+ case "function":
+ case "symbol":
+ break a;
+ }
+ switch (name) {
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ break a;
+ case "className":
+ coercedHref = "class";
+ break;
+ case "hidden":
+ if (!1 === propValue) break a;
+ break;
+ case "src":
+ case "href":
+ sanitizeURL("" + propValue);
+ break;
+ default:
+ if (!isAttributeNameSafe(name)) break a;
+ }
+ if (
+ !(2 < name.length) ||
+ ("o" !== name[0] && "O" !== name[0]) ||
+ ("n" !== name[1] && "N" !== name[1])
+ )
+ (propValue = "" + propValue),
+ (precedence.buffer += ","),
+ (coercedHref = escapeTextForBrowser(
+ JSON.stringify(coercedHref)
+ )),
+ (precedence.buffer += coercedHref),
+ (precedence.buffer += ","),
+ (coercedHref = escapeTextForBrowser(
+ JSON.stringify(propValue)
+ )),
+ (precedence.buffer += coercedHref);
+ }
+ }
+ }
+ destination.buffer += "]";
+ nextArrayOpenBrackChunk = ",[";
+ resource.flushed = !0;
+ resource.hint.flushed = !0;
+ }
+ });
+ destination.buffer += "]";
+}
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -2707,7 +2823,7 @@ function renderNode(request, task, node) {
null !== node &&
"function" === typeof node.then)
) {
- var thenableState$18 = getThenableStateAfterSuspending(),
+ var thenableState$16 = getThenableStateAfterSuspending(),
segment = task.blockedSegment,
newSegment = createPendingSegment(
request,
@@ -2721,7 +2837,7 @@ function renderNode(request, task, node) {
segment.lastPushedText = !1;
request = createTask(
request,
- thenableState$18,
+ thenableState$16,
task.node,
task.blockedBoundary,
newSegment,
@@ -2933,54 +3049,66 @@ function flushCompletedBoundary(request, destination, boundary) {
i = boundary.rootSegmentID;
boundary = boundary.resources;
var hasStyleDependencies;
- a: {
+ b: {
for (hasStyleDependencies = boundary.values(); ; ) {
var resource = hasStyleDependencies.next().value;
if (!resource) break;
if (!resource.inShell) {
hasStyleDependencies = !0;
- break a;
+ break b;
}
}
hasStyleDependencies = !1;
}
- writeChunk(destination, request.startInlineScript);
- hasStyleDependencies
- ? request.sentCompleteBoundaryFunction
- ? request.sentStyleInsertionFunction
- ? writeChunk(destination, '$RR("')
- : ((request.sentStyleInsertionFunction = !0),
+ (resource = 0 === request.streamingFormat)
+ ? (writeChunk(destination, request.startInlineScript),
+ hasStyleDependencies
+ ? request.sentCompleteBoundaryFunction
+ ? request.sentStyleInsertionFunction
+ ? writeChunk(destination, '$RR("')
+ : ((request.sentStyleInsertionFunction = !0),
+ writeChunk(
+ destination,
+ '$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
+ ))
+ : ((request.sentCompleteBoundaryFunction = !0),
+ (request.sentStyleInsertionFunction = !0),
+ writeChunk(
+ destination,
+ '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
+ ))
+ : request.sentCompleteBoundaryFunction
+ ? writeChunk(destination, '$RC("')
+ : ((request.sentCompleteBoundaryFunction = !0),
writeChunk(
destination,
- '$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
- ))
- : ((request.sentCompleteBoundaryFunction = !0),
- (request.sentStyleInsertionFunction = !0),
- writeChunk(
- destination,
- '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
- ))
- : request.sentCompleteBoundaryFunction
- ? writeChunk(destination, '$RC("')
- : ((request.sentCompleteBoundaryFunction = !0),
- writeChunk(
- destination,
- '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RC("'
- ));
+ '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RC("'
+ )))
+ : hasStyleDependencies
+ ? writeChunk(destination, '");
+ ? resource
+ ? (writeChunk(destination, '",'),
+ writeStyleResourceDependenciesInJS(destination, boundary))
+ : (writeChunk(destination, '" data-sty="'),
+ writeStyleResourceDependenciesInAttr(destination, boundary))
+ : resource && writeChunk(destination, '"');
+ destination = resource
+ ? writeChunkAndReturn(destination, ")\x3c/script>")
+ : writeChunkAndReturn(destination, '">');
+ return destination;
}
function flushPartiallyCompletedSegment(
request,
@@ -2999,21 +3127,28 @@ function flushPartiallyCompletedSegment(
}
flushSegmentContainer(request, destination, segment);
request = request.responseState;
- writeChunk(destination, request.startInlineScript);
- request.sentCompleteSegmentFunction
- ? writeChunk(destination, '$RS("')
- : ((request.sentCompleteSegmentFunction = !0),
- writeChunk(
- destination,
- '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("'
- ));
+ (boundary = 0 === request.streamingFormat)
+ ? (writeChunk(destination, request.startInlineScript),
+ request.sentCompleteSegmentFunction
+ ? writeChunk(destination, '$RS("')
+ : ((request.sentCompleteSegmentFunction = !0),
+ writeChunk(
+ destination,
+ '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("'
+ )))
+ : writeChunk(destination, '');
+ destination = boundary
+ ? writeChunkAndReturn(destination, '")\x3c/script>')
+ : writeChunkAndReturn(destination, '">');
+ return destination;
}
function flushCompletedQueues(request, destination) {
try {
@@ -3026,7 +3161,8 @@ function flushCompletedQueues(request, destination) {
writeInitialResources(
destination,
request.resources,
- request.responseState
+ request.responseState,
+ 0 === request.allPendingTasks
);
flushSegment(request, destination, completedRootSegment);
request.completedRootSegment = null;
@@ -3057,39 +3193,61 @@ function flushCompletedQueues(request, destination) {
boundaryID = boundary.id,
errorDigest = boundary.errorDigest,
errorMessage = boundary.errorMessage,
- errorComponentStack = boundary.errorComponentStack;
- bootstrapChunks.buffer += responseState.startInlineScript;
- responseState.sentClientRenderFunction
- ? (bootstrapChunks.buffer += '$RX("')
- : ((responseState.sentClientRenderFunction = !0),
- (bootstrapChunks.buffer +=
- '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("'));
+ errorComponentStack = boundary.errorComponentStack,
+ scriptFormat = 0 === responseState.streamingFormat;
+ scriptFormat
+ ? ((bootstrapChunks.buffer += responseState.startInlineScript),
+ responseState.sentClientRenderFunction
+ ? (bootstrapChunks.buffer += '$RX("')
+ : ((responseState.sentClientRenderFunction = !0),
+ (bootstrapChunks.buffer +=
+ '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("')))
+ : (bootstrapChunks.buffer += '")) {
+ scriptFormat && (bootstrapChunks.buffer += '"');
+ if (errorDigest || errorMessage || errorComponentStack)
+ if (scriptFormat) {
+ bootstrapChunks.buffer += ",";
+ var chunk = escapeJSStringsForInstructionScripts(errorDigest || "");
+ bootstrapChunks.buffer += chunk;
+ } else {
+ bootstrapChunks.buffer += '" data-dgst="';
+ var chunk$jscomp$0 = escapeTextForBrowser(errorDigest || "");
+ bootstrapChunks.buffer += chunk$jscomp$0;
+ }
+ if (errorMessage || errorComponentStack)
+ if (scriptFormat) {
+ bootstrapChunks.buffer += ",";
+ var chunk$jscomp$1 = escapeJSStringsForInstructionScripts(
+ errorMessage || ""
+ );
+ bootstrapChunks.buffer += chunk$jscomp$1;
+ } else {
+ bootstrapChunks.buffer += '" data-msg="';
+ var chunk$jscomp$2 = escapeTextForBrowser(errorMessage || "");
+ bootstrapChunks.buffer += chunk$jscomp$2;
+ }
+ if (errorComponentStack)
+ if (scriptFormat) {
+ bootstrapChunks.buffer += ",";
+ var chunk$jscomp$3 = escapeJSStringsForInstructionScripts(
+ errorComponentStack
+ );
+ bootstrapChunks.buffer += chunk$jscomp$3;
+ } else {
+ bootstrapChunks.buffer += '" data-stck="';
+ var chunk$jscomp$4 = escapeTextForBrowser(errorComponentStack);
+ bootstrapChunks.buffer += chunk$jscomp$4;
+ }
+ if (
+ scriptFormat
+ ? !writeChunkAndReturn(bootstrapChunks, ")\x3c/script>")
+ : !writeChunkAndReturn(bootstrapChunks, '">')
+ ) {
request.destination = null;
i++;
clientRenderedBoundaries.splice(0, i);
@@ -3110,13 +3268,13 @@ function flushCompletedQueues(request, destination) {
completedBoundaries.splice(0, i);
var partialBoundaries = request.partialBoundaries;
for (i = 0; i < partialBoundaries.length; i++) {
- var boundary$20 = partialBoundaries[i];
+ var boundary$18 = partialBoundaries[i];
a: {
clientRenderedBoundaries = request;
boundary = destination;
clientRenderedBoundaries.resources.boundaryResources =
- boundary$20.resources;
- var completedSegments = boundary$20.completedSegments;
+ boundary$18.resources;
+ var completedSegments = boundary$18.completedSegments;
for (
responseState = 0;
responseState < completedSegments.length;
@@ -3126,7 +3284,7 @@ function flushCompletedQueues(request, destination) {
!flushPartiallyCompletedSegment(
clientRenderedBoundaries,
boundary,
- boundary$20,
+ boundary$18,
completedSegments[responseState]
)
) {
@@ -3183,8 +3341,8 @@ function abort(request, reason) {
}
null !== request.destination &&
flushCompletedQueues(request, request.destination);
- } catch (error$23) {
- logRecoverableError(request, error$23), fatalError(request, error$23);
+ } catch (error$21) {
+ logRecoverableError(request, error$21), fatalError(request, error$21);
}
}
exports.abortStream = function(stream) {
@@ -3324,34 +3482,49 @@ exports.renderToStream = function(children, options) {
identifierPrefix = options ? options.identifierPrefix : void 0,
bootstrapScriptContent = options ? options.bootstrapScriptContent : void 0,
bootstrapScripts = options ? options.bootstrapScripts : void 0,
- bootstrapModules = options ? options.bootstrapModules : void 0;
+ bootstrapModules = options ? options.bootstrapModules : void 0,
+ externalRuntimeConfig = options
+ ? options.unstable_externalRuntimeSrc
+ : void 0;
identifierPrefix = void 0 === identifierPrefix ? "" : identifierPrefix;
var JSCompiler_inline_result = [];
+ var externalRuntimeDesc = null,
+ streamingFormat = 0;
void 0 !== bootstrapScriptContent &&
JSCompiler_inline_result.push(
"