Skip to content

Commit 76f14eb

Browse files
committed
Clean up experimental flags and turn some on
1 parent 9aef5d2 commit 76f14eb

File tree

6 files changed

+40
-24
lines changed

6 files changed

+40
-24
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ module.exports = {
521521
spyOnProd: 'readonly',
522522
__DEV__: 'readonly',
523523
__EXPERIMENTAL__: 'readonly',
524+
__NEXT_MAJOR__: 'readonly',
524525
__EXTENSION__: 'readonly',
525526
__PROFILE__: 'readonly',
526527
__TEST__: 'readonly',

packages/react-devtools-core/webpack.backend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = {
7070
}),
7171
new Webpack.DefinePlugin({
7272
__DEV__,
73-
__EXPERIMENTAL__: true,
73+
__EXPERIMENTAL__: 'readonly',
7474
__EXTENSION__: false,
7575
__PROFILE__: false,
7676
__TEST__: NODE_ENV === 'test',

packages/shared/ReactFeatureFlags.js

+32-23
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,38 @@ export const retryLaneExpirationMs = 5000;
134134
export const syncLaneExpirationMs = 250;
135135
export const transitionLaneExpirationMs = 5000;
136136

137+
// -----------------------------------------------------------------------------
138+
// Ready for next major.
139+
//
140+
// __NEXT_MAJOR__ is an alias for __EXPERIMENTAL__.
141+
// -----------------------------------------------------------------------------
142+
143+
// Not ready to break experimental yet.
144+
export const disableLegacyContext = __NEXT_MAJOR__;
145+
146+
// Not ready to break experimental yet.
147+
// Disable javascript: URL strings in href for XSS protection.
148+
export const disableJavaScriptURLs = __NEXT_MAJOR__;
149+
150+
// Remove IE and MsApp specific workarounds for innerHTML
151+
export const disableIEWorkarounds = __NEXT_MAJOR__;
152+
153+
// Changes the behavior for rendering custom elements in both server rendering
154+
// and client rendering, mostly to allow JSX attributes to apply to the custom
155+
// element's object properties instead of only HTML attributes.
156+
// https://github.com/facebook/react/issues/11347
157+
export const enableCustomElementPropertySupport = __NEXT_MAJOR__;
158+
159+
// Filter certain DOM attributes (e.g. src, href) if their values are empty
160+
// strings. This prevents e.g. <img src=""> from making an unnecessary HTTP
161+
// request for certain browsers.
162+
export const enableFilterEmptyStringAttributesDOM = __NEXT_MAJOR__;
163+
164+
// Modern <StrictMode /> behaviour aligns more with what components
165+
// components will encounter in production, especially when used With <Offscreen />.
166+
// TODO: clean up legacy <StrictMode /> once tests pass WWW.
167+
export const useModernStrictMode = __NEXT_MAJOR__;
168+
137169
// -----------------------------------------------------------------------------
138170
// Chopping Block
139171
//
@@ -150,8 +182,6 @@ export const createRootStrictEffectsByDefault = false;
150182

151183
export const disableModulePatternComponents = false;
152184

153-
export const disableLegacyContext = false;
154-
155185
export const enableUseRefAccessWarning = false;
156186

157187
// Enables time slicing for updates that aren't wrapped in startTransition.
@@ -173,29 +203,12 @@ export const allowConcurrentByDefault = false;
173203
// in open source, but www codebase still relies on it. Need to remove.
174204
export const disableCommentsAsDOMContainers = true;
175205

176-
// Disable javascript: URL strings in href for XSS protection.
177-
export const disableJavaScriptURLs = false;
178-
179206
export const enableTrustedTypesIntegration = false;
180207

181208
// Prevent the value and checked attributes from syncing with their related
182209
// DOM properties
183210
export const disableInputAttributeSyncing = false;
184211

185-
// Remove IE and MsApp specific workarounds for innerHTML
186-
export const disableIEWorkarounds = __EXPERIMENTAL__;
187-
188-
// Filter certain DOM attributes (e.g. src, href) if their values are empty
189-
// strings. This prevents e.g. <img src=""> from making an unnecessary HTTP
190-
// request for certain browsers.
191-
export const enableFilterEmptyStringAttributesDOM = __EXPERIMENTAL__;
192-
193-
// Changes the behavior for rendering custom elements in both server rendering
194-
// and client rendering, mostly to allow JSX attributes to apply to the custom
195-
// element's object properties instead of only HTML attributes.
196-
// https://github.com/facebook/react/issues/11347
197-
export const enableCustomElementPropertySupport = __EXPERIMENTAL__;
198-
199212
// Disables children for <textarea> elements
200213
export const disableTextareaChildren = false;
201214

@@ -245,8 +258,4 @@ export const enableProfilerNestedUpdateScheduledHook = false;
245258

246259
export const consoleManagedByDevToolsDuringStrictMode = true;
247260

248-
// Modern <StrictMode /> behaviour aligns more with what components
249-
// components will encounter in production, especially when used With <Offscreen />.
250-
// TODO: clean up legacy <StrictMode /> once tests pass WWW.
251-
export const useModernStrictMode = false;
252261
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;

scripts/flow/environment.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
declare var __PROFILE__: boolean;
1313
declare var __UMD__: boolean;
1414
declare var __EXPERIMENTAL__: boolean;
15+
declare var __NEXT_MAJOR__: boolean;
1516
declare var __VARIANT__: boolean;
1617

1718
declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{

scripts/jest/setupEnvironment.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ global.__EXPERIMENTAL__ =
1919
? RELEASE_CHANNEL === 'experimental'
2020
: true;
2121

22+
global.__NEXT_MAJOR__ = __EXPERIMENTAL__;
23+
2224
global.__VARIANT__ = !!process.env.VARIANT;
2325

2426
if (typeof window !== 'undefined') {

scripts/rollup/build.js

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const __EXPERIMENTAL__ =
3434
? RELEASE_CHANNEL === 'experimental'
3535
: true;
3636

37+
const __NEXT_MAJOR__ = __EXPERIMENTAL__;
38+
3739
// Errors in promises should be fatal.
3840
let loggedErrors = new Set();
3941
process.on('unhandledRejection', err => {
@@ -468,6 +470,7 @@ function getPlugins(
468470
? "'production'"
469471
: "'development'",
470472
__EXPERIMENTAL__,
473+
__NEXT_MAJOR__,
471474
},
472475
}),
473476
// The CommonJS plugin *only* exists to pull "art" into "react-art".

0 commit comments

Comments
 (0)