Skip to content

Commit

Permalink
[cleanup] remove feature flags warnAboutDefaultPropsOnFunctionCompone…
Browse files Browse the repository at this point in the history
…nts and warnAboutStringRefs (#25980)

These feature flags are fully rolled out and easy to clean up. Let's
remove them!

DiffTrain build for [0fce6bb498357feb4465859912004b2e20fe7084](facebook/react@0fce6bb)
[View git log for this commit](https://github.com/facebook/react/commits/0fce6bb498357feb4465859912004b2e20fe7084)
  • Loading branch information
jerrydev0927 committed Jan 11, 2023
1 parent 457db9e commit 1d5a54d
Show file tree
Hide file tree
Showing 29 changed files with 122 additions and 163 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7002a6743ebb24ed55af8f626c89dd39460230fc
0fce6bb498357feb4465859912004b2e20fe7084
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7002a6743ebb24ed55af8f626c89dd39460230fc
0fce6bb498357feb4465859912004b2e20fe7084
2 changes: 1 addition & 1 deletion 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-7002a6743-20230110";
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion 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-7002a6743-20230110";
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";

// ATTENTION
// When adding new symbols to this file,
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-7002a6743-20230110";
exports.version = "18.3.0-www-classic-0fce6bb49-20230111";
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-7002a6743-20230110";
exports.version = "18.3.0-www-modern-0fce6bb49-20230111";
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-7002a6743-20230110";
exports.version = "18.3.0-www-classic-0fce6bb49-20230111";

/* 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-7002a6743-20230110";
exports.version = "18.3.0-www-modern-0fce6bb49-20230111";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
27 changes: 11 additions & 16 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-7002a6743-20230110";
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -201,7 +201,6 @@ var enableProfilerNestedUpdateScheduledHook =
var createRootStrictEffectsByDefault = false;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var warnAboutStringRefs = true;

var FunctionComponent = 0;
var ClassComponent = 1;
Expand Down Expand Up @@ -5558,10 +5557,8 @@ function coerceRef(returnFiber, current, element) {
typeof mixedRef !== "object"
) {
{
// TODO: Clean this up once we turn on the string ref warning for
// everyone, because the strict mode case will no longer be relevant
if (
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
// We warn in ReactElement.js if owner and self are equal for string refs
// because these cannot be automatically converted to an arrow function
// using a codemod. Therefore, we don't have to warn about string refs again.
!(
Expand All @@ -5577,17 +5574,15 @@ function coerceRef(returnFiber, current, element) {
getComponentNameFromFiber(returnFiber) || "Component";

if (!didWarnAboutStringRefs[componentName]) {
{
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);
}
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);

didWarnAboutStringRefs[componentName] = true;
}
Expand Down
27 changes: 11 additions & 16 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-7002a6743-20230110";
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -201,7 +201,6 @@ var enableProfilerNestedUpdateScheduledHook =
var createRootStrictEffectsByDefault = false;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var warnAboutStringRefs = true;

var FunctionComponent = 0;
var ClassComponent = 1;
Expand Down Expand Up @@ -5320,10 +5319,8 @@ function coerceRef(returnFiber, current, element) {
typeof mixedRef !== "object"
) {
{
// TODO: Clean this up once we turn on the string ref warning for
// everyone, because the strict mode case will no longer be relevant
if (
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
// We warn in ReactElement.js if owner and self are equal for string refs
// because these cannot be automatically converted to an arrow function
// using a codemod. Therefore, we don't have to warn about string refs again.
!(
Expand All @@ -5339,17 +5336,15 @@ function coerceRef(returnFiber, current, element) {
getComponentNameFromFiber(returnFiber) || "Component";

if (!didWarnAboutStringRefs[componentName]) {
{
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);
}
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);

didWarnAboutStringRefs[componentName] = true;
}
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-7002a6743-20230110",
version: "18.3.0-www-classic-0fce6bb49-20230111",
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-7002a6743-20230110"
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
};
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-7002a6743-20230110",
version: "18.3.0-www-modern-0fce6bb49-20230111",
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-7002a6743-20230110"
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
27 changes: 11 additions & 16 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ var createRootStrictEffectsByDefault = false;
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var warnAboutStringRefs = true;
var enableSuspenseCallback = true;
var enableCustomElementPropertySupport = false;

Expand Down Expand Up @@ -19789,10 +19788,8 @@ function coerceRef(returnFiber, current, element) {
typeof mixedRef !== "object"
) {
{
// TODO: Clean this up once we turn on the string ref warning for
// everyone, because the strict mode case will no longer be relevant
if (
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
// We warn in ReactElement.js if owner and self are equal for string refs
// because these cannot be automatically converted to an arrow function
// using a codemod. Therefore, we don't have to warn about string refs again.
!(
Expand All @@ -19808,17 +19805,15 @@ function coerceRef(returnFiber, current, element) {
getComponentNameFromFiber(returnFiber) || "Component";

if (!didWarnAboutStringRefs[componentName]) {
{
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);
}
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);

didWarnAboutStringRefs[componentName] = true;
}
Expand Down Expand Up @@ -42695,7 +42690,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-7002a6743-20230110";
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";

function createPortal(
children,
Expand Down
27 changes: 11 additions & 16 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ var createRootStrictEffectsByDefault = false;
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
var warnAboutStringRefs = true;
var enableSuspenseCallback = true;
var enableCustomElementPropertySupport = true;

Expand Down Expand Up @@ -19586,10 +19585,8 @@ function coerceRef(returnFiber, current, element) {
typeof mixedRef !== "object"
) {
{
// TODO: Clean this up once we turn on the string ref warning for
// everyone, because the strict mode case will no longer be relevant
if (
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
// We warn in ReactElement.js if owner and self are equal for string refs
// because these cannot be automatically converted to an arrow function
// using a codemod. Therefore, we don't have to warn about string refs again.
!(
Expand All @@ -19605,17 +19602,15 @@ function coerceRef(returnFiber, current, element) {
getComponentNameFromFiber(returnFiber) || "Component";

if (!didWarnAboutStringRefs[componentName]) {
{
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);
}
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
mixedRef
);

didWarnAboutStringRefs[componentName] = true;
}
Expand Down Expand Up @@ -42419,7 +42414,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-7002a6743-20230110";
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";

function createPortal(
children,
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15534,7 +15534,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1750 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-7002a6743-20230110",
version: "18.3.0-www-classic-0fce6bb49-20230111",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2134 = {
Expand Down Expand Up @@ -15564,7 +15564,7 @@ var internals$jscomp$inline_2134 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2135 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15806,4 +15806,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-7002a6743-20230110";
exports.version = "18.3.0-next-0fce6bb49-20230111";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -15095,7 +15095,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1718 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-7002a6743-20230110",
version: "18.3.0-www-modern-0fce6bb49-20230111",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2109 = {
Expand Down Expand Up @@ -15126,7 +15126,7 @@ var internals$jscomp$inline_2109 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15314,4 +15314,4 @@ exports.unstable_flushControlled = function(fn) {
}
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-7002a6743-20230110";
exports.version = "18.3.0-next-0fce6bb49-20230111";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16304,7 +16304,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1824 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-7002a6743-20230110",
version: "18.3.0-www-classic-0fce6bb49-20230111",
rendererPackageName: "react-dom"
};
(function(internals) {
Expand Down Expand Up @@ -16348,7 +16348,7 @@ var devToolsConfig$jscomp$inline_1824 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
});
assign(Internals, {
ReactBrowserEventEmitter: {
Expand Down Expand Up @@ -16577,7 +16577,7 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-7002a6743-20230110";
exports.version = "18.3.0-next-0fce6bb49-20230111";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Loading

0 comments on commit 1d5a54d

Please sign in to comment.