Add experiment to configure internal debugger branding (#44388)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44388

Towards the open source rollout of the `rn_fusebox.ts` entry point.

NOTE: Requires https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/59, but can (and should) be landed safely beforehand.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D56883040

fbshipit-source-id: acee5d53c0f93ef9dc2d498001291b1e35237824
This commit is contained in:
Alex Hunt 2024-05-02 09:15:30 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 817f610983
Коммит 185f63b0db
4 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -20,6 +20,7 @@ describe('getDevToolsFrontendUrl', () => {
enableNetworkInspector: false,
enableNewDebugger: false,
enableOpenDebuggerRedirect: false,
useFuseboxInternalBranding: false,
};
describe('relative: false, launchId: undefined (default)', () => {

Просмотреть файл

@ -129,5 +129,6 @@ function getExperiments(config: ExperimentsConfig): Experiments {
enableNewDebugger: config.enableNewDebugger ?? false,
enableOpenDebuggerRedirect: config.enableOpenDebuggerRedirect ?? false,
enableNetworkInspector: config.enableNetworkInspector ?? false,
useFuseboxInternalBranding: config.useFuseboxInternalBranding ?? false,
};
}

Просмотреть файл

@ -28,6 +28,12 @@ export type Experiments = $ReadOnly<{
* Enables the Network panel when launching the custom debugger frontend.
*/
enableNetworkInspector: boolean,
/**
* [Meta-internal] Controls visibility of the internal "Fusebox" codename
* across the UI when using the modern `rn_fusebox` entry point.
*/
useFuseboxInternalBranding: boolean,
}>;
export type ExperimentsConfig = Partial<Experiments>;

Просмотреть файл

@ -44,6 +44,12 @@ export default function getDevToolsFrontendUrl(
if (experiments.enableNetworkInspector) {
searchParams.append('unstable_enableNetworkPanel', 'true');
}
if (
options?.useFuseboxEntryPoint === true &&
experiments.useFuseboxInternalBranding
) {
searchParams.append('unstable_useInternalBranding', 'true');
}
if (options?.launchId != null && options.launchId !== '') {
searchParams.append('launchId', options.launchId);
}