Skip to content

Commit 94913cb

Browse files
authored
[flags] cleanup renameElementSymbol (facebook#35600)
Removed the feature flag completely, enabled by default. Will land once I have everything ready on xplat side.
1 parent 2d8e7f1 commit 94913cb

14 files changed

+4
-22
lines changed

packages/react-client/src/__tests__/ReactFlight-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,6 @@ describe('ReactFlight', () => {
10851085
});
10861086
});
10871087

1088-
// @gate renameElementSymbol
10891088
it('should emit descriptions of errors in dev', async () => {
10901089
const ClientErrorBoundary = clientReference(ErrorBoundary);
10911090

packages/react-dom/src/__tests__/ReactComponent-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ describe('ReactComponent', () => {
498498
);
499499
});
500500

501-
// @gate renameElementSymbol
502501
it('throws if a legacy element is used as a child', async () => {
503502
const inlinedElement = {
504503
$$typeof: Symbol.for('react.element'),

packages/react-dom/src/__tests__/ReactDOMOption-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,11 @@ describe('ReactDOMOption', () => {
138138
}).rejects.toThrow('Objects are not valid as a React child');
139139
});
140140

141-
// @gate www && !renameElementSymbol
142141
it('should support element-ish child', async () => {
143142
// This is similar to <fbt>.
144143
// We don't toString it because you must instead provide a value prop.
145144
const obj = {
146-
$$typeof: Symbol.for('react.element'),
145+
$$typeof: Symbol.for('react.transitional.element'),
147146
type: props => props.content,
148147
ref: null,
149148
key: null,

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ export const enableInternalInstanceMap: boolean = false;
159159

160160
// const __NEXT_MAJOR__ = __EXPERIMENTAL__;
161161

162-
// Renames the internal symbol for elements since they have changed signature/constructor
163-
export const renameElementSymbol: boolean = true;
164-
165162
/**
166163
* Enables a fix to run insertion effect cleanup on hidden subtrees.
167164
*/

packages/shared/ReactSymbols.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
* @flow
88
*/
99

10-
import {renameElementSymbol} from 'shared/ReactFeatureFlags';
11-
1210
// ATTENTION
1311
// When adding new symbols to this file,
1412
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1513

1614
// The Symbol used to tag the ReactElement-like types.
1715
export const REACT_LEGACY_ELEMENT_TYPE: symbol = Symbol.for('react.element');
18-
export const REACT_ELEMENT_TYPE: symbol = renameElementSymbol
19-
? Symbol.for('react.transitional.element')
20-
: REACT_LEGACY_ELEMENT_TYPE;
16+
export const REACT_ELEMENT_TYPE: symbol = Symbol.for(
17+
'react.transitional.element',
18+
);
2119
export const REACT_PORTAL_TYPE: symbol = Symbol.for('react.portal');
2220
export const REACT_FRAGMENT_TYPE: symbol = Symbol.for('react.fragment');
2321
export const REACT_STRICT_MODE_TYPE: symbol = Symbol.for('react.strict_mode');

packages/shared/__tests__/ReactSymbols-test.internal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ describe('ReactSymbols', () => {
2323
});
2424
};
2525

26-
// @gate renameElementSymbol
2726
it('Symbol values should be unique', () => {
2827
expectToBeUnique(Object.entries(require('shared/ReactSymbols')));
2928
});

packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const enableObjectFiber = __VARIANT__;
2222
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
2323
export const enableEagerAlternateStateNodeCleanup = __VARIANT__;
2424
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
25-
export const renameElementSymbol = __VARIANT__;
2625
export const enableFragmentRefs = __VARIANT__;
2726
export const enableFragmentRefsScrollIntoView = __VARIANT__;
2827
export const enableFragmentRefsInstanceHandles = __VARIANT__;

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const {
2424
enableObjectFiber,
2525
enableEagerAlternateStateNodeCleanup,
2626
passChildrenWhenCloningPersistedNodes,
27-
renameElementSymbol,
2827
enableFragmentRefs,
2928
enableFragmentRefsScrollIntoView,
3029
enableFragmentRefsInstanceHandles,

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export const enableTaint: boolean = true;
5252
export const enableTransitionTracing: boolean = false;
5353
export const enableTrustedTypesIntegration: boolean = false;
5454
export const passChildrenWhenCloningPersistedNodes: boolean = false;
55-
export const renameElementSymbol: boolean = true;
5655
export const retryLaneExpirationMs = 5000;
5756
export const syncLaneExpirationMs = 250;
5857
export const transitionLaneExpirationMs = 5000;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const disableClientCache: boolean = true;
5555

5656
export const enableInfiniteRenderLoopDetection: boolean = false;
5757

58-
export const renameElementSymbol: boolean = true;
5958
export const enableEagerAlternateStateNodeCleanup: boolean = true;
6059

6160
export const enableYieldingBeforePassive: boolean = true;

0 commit comments

Comments
 (0)