@samitouri / QOS-React / commits / fbcda19a23

[devtools] add filters for internal builds (#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.

Ricky committed Mar 17, 2025 at 12:14 UTC fbcda19a23da819889afdd7164b29c556fbcfc7a
1 file changed +11 -6
packages/react-devtools-shared/src/devtools/views/Settings/ComponentsSettings.js
+11 -6
@@ -42,6 +42,8 @@ import {
42 ElementTypeOtherOrUnknown,
43 ElementTypeProfiler,
44 ElementTypeSuspense,
45 + ElementTypeActivity,
46 + ElementTypeViewTransition,
47 } from 'react-devtools-shared/src/frontend/types';
48 import {getDefaultOpenInEditorURL} from 'react-devtools-shared/src/utils';
49
@@ -56,6 +58,7 @@ import type {
58 RegExpComponentFilter,
59 EnvironmentNameComponentFilter,
60 } from 'react-devtools-shared/src/frontend/types';
61 +import {isInternalFacebookBuild} from 'react-devtools-feature-flags';
62
63 const vscodeFilepath = 'vscode://file/{path}:{line}';
64
@@ -472,8 +475,9 @@ export default function ComponentsSettings({
475 ((parseInt(currentTarget.value, 10): any): ElementType),
476 )
477 }>
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 + )}
481 <option value={ElementTypeClass}>class</option>
482 <option value={ElementTypeContext}>context</option>
483 <option value={ElementTypeFunction}>function</option>
@@ -487,10 +491,11 @@ export default function ComponentsSettings({
491 <option value={ElementTypeOtherOrUnknown}>other</option>
492 <option value={ElementTypeProfiler}>profiler</option>
493 <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 + )}
499 </select>
500 )}
501 {(componentFilter.type === ComponentFilterLocation ||