Skip to content

Commit fbcda19

Browse files
authored
[devtools] add filters for internal builds (facebook#32646)
We don't have an experimental-only build of devtools, but we can at least add these filters to the internal build. A better way would be to use feature detection, but I'm not sure how and this isn't a very heavily used feautre.
1 parent cd28a94 commit fbcda19

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

packages/react-devtools-shared/src/devtools/views/Settings/ComponentsSettings.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import {
4242
ElementTypeOtherOrUnknown,
4343
ElementTypeProfiler,
4444
ElementTypeSuspense,
45+
ElementTypeActivity,
46+
ElementTypeViewTransition,
4547
} from 'react-devtools-shared/src/frontend/types';
4648
import {getDefaultOpenInEditorURL} from 'react-devtools-shared/src/utils';
4749

@@ -56,6 +58,7 @@ import type {
5658
RegExpComponentFilter,
5759
EnvironmentNameComponentFilter,
5860
} from 'react-devtools-shared/src/frontend/types';
61+
import {isInternalFacebookBuild} from 'react-devtools-feature-flags';
5962

6063
const vscodeFilepath = 'vscode://file/{path}:{line}';
6164

@@ -472,8 +475,9 @@ export default function ComponentsSettings({
472475
((parseInt(currentTarget.value, 10): any): ElementType),
473476
)
474477
}>
475-
{/* TODO: currently only experimental, only list this if it's available */}
476-
{/*<option value={ElementTypeActivity}>activity</option>*/}
478+
{isInternalFacebookBuild && (
479+
<option value={ElementTypeActivity}>activity</option>
480+
)}
477481
<option value={ElementTypeClass}>class</option>
478482
<option value={ElementTypeContext}>context</option>
479483
<option value={ElementTypeFunction}>function</option>
@@ -487,10 +491,11 @@ export default function ComponentsSettings({
487491
<option value={ElementTypeOtherOrUnknown}>other</option>
488492
<option value={ElementTypeProfiler}>profiler</option>
489493
<option value={ElementTypeSuspense}>suspense</option>
490-
{/* TODO: currently only experimental, only list this if it's available */}
491-
{/*<option value={ElementTypeViewTransition}>*/}
492-
{/* view transition*/}
493-
{/*</option>*/}
494+
{isInternalFacebookBuild && (
495+
<option value={ElementTypeViewTransition}>
496+
view transition
497+
</option>
498+
)}
494499
</select>
495500
)}
496501
{(componentFilter.type === ComponentFilterLocation ||

0 commit comments

Comments
 (0)