Skip to content

Commit

Permalink
[www] set enableTrustedTypesIntegration to false (#25997)
Browse files Browse the repository at this point in the history
This isn't configured to a dynamic value on www, so hardcode here to
false.

DiffTrain build for [379dd74](379dd74)
[View git log for this commit](https://github.com/facebook/react/commits/379dd741e9aabefb880af1794d3c828984f9e143)
  • Loading branch information
kassens committed Jan 13, 2023
1 parent 7a7a09e commit 269610e
Show file tree
Hide file tree
Showing 37 changed files with 56 additions and 182 deletions.
2 changes: 0 additions & 2 deletions compiled/facebook-www/JSXDEVRuntime-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
2 changes: 0 additions & 2 deletions compiled/facebook-www/JSXDEVRuntime-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
489d00fa61dd3c406b1c053a7a039d97f7fe213f
379dd741e9aabefb880af1794d3c828984f9e143
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
489d00fa61dd3c406b1c053a7a039d97f7fe213f
379dd741e9aabefb880af1794d3c828984f9e143
4 changes: 1 addition & 3 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-classic-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-classic-379dd741e-20230113";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -478,8 +478,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
4 changes: 1 addition & 3 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-modern-379dd741e-20230113";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -478,8 +478,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-489d00fa6-20230112";
exports.version = "18.3.0-www-classic-379dd741e-20230113";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-489d00fa6-20230112";
exports.version = "18.3.0-www-modern-379dd741e-20230113";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-489d00fa6-20230112";
exports.version = "18.3.0-www-classic-379dd741e-20230113";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-489d00fa6-20230112";
exports.version = "18.3.0-www-modern-379dd741e-20230113";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
4 changes: 1 addition & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-classic-379dd741e-20230113";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -167,8 +167,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
4 changes: 1 addition & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-modern-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-modern-379dd741e-20230113";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -167,8 +167,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9804,7 +9804,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-489d00fa6-20230112",
version: "18.3.0-www-classic-379dd741e-20230113",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1318 = {
Expand Down Expand Up @@ -9835,7 +9835,7 @@ var internals$jscomp$inline_1318 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-489d00fa6-20230112"
reconcilerVersion: "18.3.0-next-379dd741e-20230113"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9471,7 +9471,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-489d00fa6-20230112",
version: "18.3.0-www-modern-379dd741e-20230113",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1309 = {
Expand Down Expand Up @@ -9502,7 +9502,7 @@ var internals$jscomp$inline_1309 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-489d00fa6-20230112"
reconcilerVersion: "18.3.0-next-379dd741e-20230113"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
46 changes: 4 additions & 42 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down Expand Up @@ -69,7 +67,7 @@ var enableProfilerNestedUpdatePhase = true;
var enableProfilerNestedUpdateScheduledHook =
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
var createRootStrictEffectsByDefault = false;
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableClientRenderFallbackOnTextMismatch = false;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var enableSuspenseCallback = true;
Expand Down Expand Up @@ -1964,10 +1962,7 @@ function setValueForProperty(node, name, value, isCustomComponentTag) {
checkAttributeStringCoercion(value, name);
}

node.setAttribute(
_attributeName,
enableTrustedTypesIntegration ? value : "" + value
);
node.setAttribute(_attributeName, "" + value);
}
}

Expand Down Expand Up @@ -2007,9 +2002,7 @@ function setValueForProperty(node, name, value, isCustomComponentTag) {
} else {
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
if (enableTrustedTypesIntegration) {
attributeValue = value;
} else {
{
{
checkAttributeStringCoercion(value, attributeName);
}
Expand Down Expand Up @@ -3558,23 +3551,6 @@ var reusableSVGContainer;

var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
if (node.namespaceURI === SVG_NAMESPACE) {
{
if (enableTrustedTypesIntegration) {
// TODO: reconsider the text of this warning and when it should show
// before enabling the feature flag.
if (typeof trustedTypes !== "undefined") {
error(
"Using 'dangerouslySetInnerHTML' in an svg element with " +
"Trusted Types enabled in an Internet Explorer will cause " +
"the trusted value to be converted to string. Assigning string " +
"to 'innerHTML' will throw an error if Trusted Types are enforced. " +
"You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " +
"on the enclosing div instead."
);
}
}
}

if (!("innerHTML" in node)) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
Expand Down Expand Up @@ -5310,7 +5286,6 @@ function validateProperties$2(type, props, eventRegistry) {
}

var didWarnInvalidHydration = false;
var didWarnScriptTags = false;
var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
Expand Down Expand Up @@ -5625,19 +5600,6 @@ function createElement(type, props, rootContainerElement, parentNamespace) {
// set to true and it does not execute
var div = ownerDocument.createElement("div");

{
if (enableTrustedTypesIntegration && !didWarnScriptTags) {
error(
"Encountered a script tag while rendering React component. " +
"Scripts inside React components are never executed when rendering " +
"on the client. Consider using template tag instead " +
"(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)."
);

didWarnScriptTags = true;
}
}

div.innerHTML = "<script><" + "/script>"; // eslint-disable-line
// This is guaranteed to yield a script element.

Expand Down Expand Up @@ -42705,7 +42667,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-classic-379dd741e-20230113";

function createPortal(
children,
Expand Down
46 changes: 4 additions & 42 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
disableSchedulerTimeoutBasedOnReactExpirationTime =
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
warnAboutSpreadingKeyToJSX = dynamicFeatureFlags.warnAboutSpreadingKeyToJSX,
Expand Down Expand Up @@ -173,7 +171,7 @@ var enableProfilerNestedUpdatePhase = true;
var enableProfilerNestedUpdateScheduledHook =
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
var createRootStrictEffectsByDefault = false;
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableClientRenderFallbackOnTextMismatch = false;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var enableSuspenseCallback = true;
Expand Down Expand Up @@ -1177,10 +1175,7 @@ function setValueForProperty(node, name, value, isCustomComponentTag) {
checkAttributeStringCoercion(value, name);
}

node.setAttribute(
_attributeName,
enableTrustedTypesIntegration ? value : "" + value
);
node.setAttribute(_attributeName, "" + value);
}
}

Expand Down Expand Up @@ -1220,9 +1215,7 @@ function setValueForProperty(node, name, value, isCustomComponentTag) {
} else {
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
if (enableTrustedTypesIntegration) {
attributeValue = value;
} else {
{
{
checkAttributeStringCoercion(value, attributeName);
}
Expand Down Expand Up @@ -3027,23 +3020,6 @@ var reusableSVGContainer;

var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
if (node.namespaceURI === SVG_NAMESPACE) {
{
if (enableTrustedTypesIntegration) {
// TODO: reconsider the text of this warning and when it should show
// before enabling the feature flag.
if (typeof trustedTypes !== "undefined") {
error(
"Using 'dangerouslySetInnerHTML' in an svg element with " +
"Trusted Types enabled in an Internet Explorer will cause " +
"the trusted value to be converted to string. Assigning string " +
"to 'innerHTML' will throw an error if Trusted Types are enforced. " +
"You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " +
"on the enclosing div instead."
);
}
}
}

if (!("innerHTML" in node)) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
Expand Down Expand Up @@ -11739,7 +11715,6 @@ function getListenerSetKey(domEventName, capture) {
}

var didWarnInvalidHydration = false;
var didWarnScriptTags = false;
var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
Expand Down Expand Up @@ -12054,19 +12029,6 @@ function createElement(type, props, rootContainerElement, parentNamespace) {
// set to true and it does not execute
var div = ownerDocument.createElement("div");

{
if (enableTrustedTypesIntegration && !didWarnScriptTags) {
error(
"Encountered a script tag while rendering React component. " +
"Scripts inside React components are never executed when rendering " +
"on the client. Consider using template tag instead " +
"(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)."
);

didWarnScriptTags = true;
}
}

div.innerHTML = "<script><" + "/script>"; // eslint-disable-line
// This is guaranteed to yield a script element.

Expand Down Expand Up @@ -42429,7 +42391,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-489d00fa6-20230112";
var ReactVersion = "18.3.0-www-modern-379dd741e-20230113";

function createPortal(
children,
Expand Down
Loading

0 comments on commit 269610e

Please sign in to comment.