From 4f71f25a34db0caa1c9c0b75f1f453f948272e65 Mon Sep 17 00:00:00 2001 From: Sophie Alpert Date: Mon, 10 Feb 2020 03:42:11 -0800 Subject: [PATCH] Re-enable shorthand CSS property collision warning (#18002) Originally added in https://github.com/facebook/react/pull/14181; disabled in https://github.com/facebook/react/pull/14245. Intention was to enable it in React 16.7 but we forgot. --- ...ternal.js => ReactDOMShorthandCSSPropertyCollision-test.js} | 3 --- packages/shared/ReactFeatureFlags.js | 2 +- packages/shared/forks/ReactFeatureFlags.native-fb.js | 2 +- packages/shared/forks/ReactFeatureFlags.native-oss.js | 2 +- packages/shared/forks/ReactFeatureFlags.persistent.js | 2 +- packages/shared/forks/ReactFeatureFlags.test-renderer.js | 2 +- packages/shared/forks/ReactFeatureFlags.testing.js | 2 +- packages/shared/forks/ReactFeatureFlags.www.js | 2 +- 8 files changed, 7 insertions(+), 10 deletions(-) rename packages/react-dom/src/__tests__/{ReactDOMShorthandCSSPropertyCollision-test.internal.js => ReactDOMShorthandCSSPropertyCollision-test.js} (97%) diff --git a/packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.js similarity index 97% rename from packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.internal.js rename to packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.js index fdf66002c008c..4850c18d03878 100644 --- a/packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMShorthandCSSPropertyCollision-test.js @@ -10,14 +10,11 @@ 'use strict'; describe('ReactDOMShorthandCSSPropertyCollision', () => { - let ReactFeatureFlags; let React; let ReactDOM; beforeEach(() => { jest.resetModules(); - ReactFeatureFlags = require('shared/ReactFeatureFlags'); - ReactFeatureFlags.warnAboutShorthandPropertyCollision = true; React = require('react'); ReactDOM = require('react-dom'); }); diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 469e5c5e810a5..c73997f1dcef9 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -48,7 +48,7 @@ export const disableJavaScriptURLs = false; // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; // Experimental React Flare event system and event components support. export const enableDeprecatedFlareAPI = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 3d6afec5e6e9c..c930e0ecc9be9 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -25,7 +25,7 @@ export const enableSuspenseServerRenderer = false; export const enableSelectiveHydration = false; export const enableChunksAPI = false; export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; export const enableSchedulerDebugging = false; export const debugRenderPhaseSideEffectsForStrictMode = true; export const disableJavaScriptURLs = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index c97153f3ae1d4..ee795fe1e03f0 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -24,7 +24,7 @@ export const enableChunksAPI = false; export const disableJavaScriptURLs = false; export const disableInputAttributeSyncing = false; export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; export const enableSchedulerDebugging = false; export const enableDeprecatedFlareAPI = false; export const enableFundamentalAPI = false; diff --git a/packages/shared/forks/ReactFeatureFlags.persistent.js b/packages/shared/forks/ReactFeatureFlags.persistent.js index deeeeb12b07cf..db307747c1b62 100644 --- a/packages/shared/forks/ReactFeatureFlags.persistent.js +++ b/packages/shared/forks/ReactFeatureFlags.persistent.js @@ -24,7 +24,7 @@ export const enableChunksAPI = false; export const disableJavaScriptURLs = false; export const disableInputAttributeSyncing = false; export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; export const enableSchedulerDebugging = false; export const enableDeprecatedFlareAPI = false; export const enableFundamentalAPI = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index adc9ab91061c2..5d8263c720890 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -24,7 +24,7 @@ export const enableChunksAPI = false; export const disableJavaScriptURLs = false; export const disableInputAttributeSyncing = false; export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; export const enableSchedulerDebugging = false; export const enableDeprecatedFlareAPI = false; export const enableFundamentalAPI = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index 4bcf3cc5b7914..13fcc7e198011 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -24,7 +24,7 @@ export const enableChunksAPI = false; export const disableJavaScriptURLs = false; export const disableInputAttributeSyncing = false; export const exposeConcurrentModeAPIs = __EXPERIMENTAL__; -export const warnAboutShorthandPropertyCollision = false; +export const warnAboutShorthandPropertyCollision = true; export const enableSchedulerDebugging = false; export const enableDeprecatedFlareAPI = false; export const enableFundamentalAPI = false; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 7cc5a9ae1c71a..74f346b017b52 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -16,6 +16,7 @@ export const { disableInputAttributeSyncing, enableTrustedTypesIntegration, deferPassiveEffectCleanupDuringUnmount, + warnAboutShorthandPropertyCollision, } = require('ReactFeatureFlags'); // In www, we have experimental support for gathering data @@ -32,7 +33,6 @@ export const enableSchedulerDebugging = true; export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false; export const warnAboutDeprecatedLifecycles = true; -export const warnAboutShorthandPropertyCollision = false; export const disableLegacyContext = false; export const warnAboutStringRefs = false; export const warnAboutDefaultPropsOnFunctionComponents = false;