diff --git a/.eslintrc.js b/.eslintrc.js index eaad9393c5685..524f72214af71 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -521,6 +521,7 @@ module.exports = { spyOnProd: 'readonly', __DEV__: 'readonly', __EXPERIMENTAL__: 'readonly', + __NEXT_MAJOR__: 'readonly', __EXTENSION__: 'readonly', __PROFILE__: 'readonly', __TEST__: 'readonly', diff --git a/packages/react-devtools-core/webpack.backend.js b/packages/react-devtools-core/webpack.backend.js index 67bf81d0f9965..dbbbff65e5f3b 100644 --- a/packages/react-devtools-core/webpack.backend.js +++ b/packages/react-devtools-core/webpack.backend.js @@ -70,7 +70,7 @@ module.exports = { }), new Webpack.DefinePlugin({ __DEV__, - __EXPERIMENTAL__: true, + __EXPERIMENTAL__: 'readonly', __EXTENSION__: false, __PROFILE__: false, __TEST__: NODE_ENV === 'test', diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 8841a7bc6a4b5..57826130516f1 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -134,6 +134,38 @@ export const retryLaneExpirationMs = 5000; export const syncLaneExpirationMs = 250; export const transitionLaneExpirationMs = 5000; +// ----------------------------------------------------------------------------- +// Ready for next major. +// +// __NEXT_MAJOR__ is an alias for __EXPERIMENTAL__. +// ----------------------------------------------------------------------------- + +// Not ready to break experimental yet. +export const disableLegacyContext = __NEXT_MAJOR__; + +// Not ready to break experimental yet. +// Disable javascript: URL strings in href for XSS protection. +export const disableJavaScriptURLs = __NEXT_MAJOR__; + +// Remove IE and MsApp specific workarounds for innerHTML +export const disableIEWorkarounds = __NEXT_MAJOR__; + +// Changes the behavior for rendering custom elements in both server rendering +// and client rendering, mostly to allow JSX attributes to apply to the custom +// element's object properties instead of only HTML attributes. +// https://github.com/facebook/react/issues/11347 +export const enableCustomElementPropertySupport = __NEXT_MAJOR__; + +// Filter certain DOM attributes (e.g. src, href) if their values are empty +// strings. This prevents e.g. from making an unnecessary HTTP +// request for certain browsers. +export const enableFilterEmptyStringAttributesDOM = __NEXT_MAJOR__; + +// Modern behaviour aligns more with what components +// components will encounter in production, especially when used With . +// TODO: clean up legacy once tests pass WWW. +export const useModernStrictMode = __NEXT_MAJOR__; + // ----------------------------------------------------------------------------- // Chopping Block // @@ -150,8 +182,6 @@ export const createRootStrictEffectsByDefault = false; export const disableModulePatternComponents = false; -export const disableLegacyContext = false; - export const enableUseRefAccessWarning = false; // Enables time slicing for updates that aren't wrapped in startTransition. @@ -173,29 +203,12 @@ export const allowConcurrentByDefault = false; // in open source, but www codebase still relies on it. Need to remove. export const disableCommentsAsDOMContainers = true; -// Disable javascript: URL strings in href for XSS protection. -export const disableJavaScriptURLs = false; - export const enableTrustedTypesIntegration = false; // Prevent the value and checked attributes from syncing with their related // DOM properties export const disableInputAttributeSyncing = false; -// Remove IE and MsApp specific workarounds for innerHTML -export const disableIEWorkarounds = __EXPERIMENTAL__; - -// Filter certain DOM attributes (e.g. src, href) if their values are empty -// strings. This prevents e.g. from making an unnecessary HTTP -// request for certain browsers. -export const enableFilterEmptyStringAttributesDOM = __EXPERIMENTAL__; - -// Changes the behavior for rendering custom elements in both server rendering -// and client rendering, mostly to allow JSX attributes to apply to the custom -// element's object properties instead of only HTML attributes. -// https://github.com/facebook/react/issues/11347 -export const enableCustomElementPropertySupport = __EXPERIMENTAL__; - // Disables children for