diff --git a/front_end/core/common/SettingRegistration.ts b/front_end/core/common/SettingRegistration.ts index b3a05bb4c7f..b5ee9c7ad88 100644 --- a/front_end/core/common/SettingRegistration.ts +++ b/front_end/core/common/SettingRegistration.ts @@ -136,6 +136,7 @@ export const enum SettingCategory { APPEARANCE = 'APPEARANCE', SOURCES = 'SOURCES', NETWORK = 'NETWORK', + NETWORK_UNLESS_RN = '', PERFORMANCE = 'PERFORMANCE', CONSOLE = 'CONSOLE', PERSISTENCE = 'PERSISTENCE', diff --git a/front_end/core/rn_experiments/experimentsImpl.ts b/front_end/core/rn_experiments/experimentsImpl.ts index 083093a92e5..b0c216ba169 100644 --- a/front_end/core/rn_experiments/experimentsImpl.ts +++ b/front_end/core/rn_experiments/experimentsImpl.ts @@ -184,10 +184,3 @@ Instance.register({ unstable: false, enabledByDefault: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint, }); - -Instance.register({ - name: RNExperimentName.ENABLE_NETWORK_PANEL, - title: 'Enable Network panel', - unstable: true, - enabledByDefault: () => false, -}); diff --git a/front_end/core/root/Runtime.ts b/front_end/core/root/Runtime.ts index 08a67149ffe..2f72e40419b 100644 --- a/front_end/core/root/Runtime.ts +++ b/front_end/core/root/Runtime.ts @@ -305,7 +305,6 @@ export const experiments = new ExperimentsSupport(); export enum RNExperimentName { REACT_NATIVE_SPECIFIC_UI = 'react-native-specific-ui', JS_HEAP_PROFILER_ENABLE = 'js-heap-profiler-enable', - ENABLE_NETWORK_PANEL = 'enable-network-panel', } export enum ConditionName { @@ -340,7 +339,6 @@ export const enum ExperimentName { JS_HEAP_PROFILER_ENABLE = RNExperimentName.JS_HEAP_PROFILER_ENABLE, REACT_NATIVE_SPECIFIC_UI = RNExperimentName.REACT_NATIVE_SPECIFIC_UI, NOT_REACT_NATIVE_SPECIFIC_UI = '!' + RNExperimentName.REACT_NATIVE_SPECIFIC_UI, - ENABLE_NETWORK_PANEL = RNExperimentName.ENABLE_NETWORK_PANEL, } export enum GenAiEnterprisePolicyValue { @@ -515,7 +513,5 @@ export type Condition = (config?: HostConfig) => boolean; export const conditions = { canDock: () => Boolean(Runtime.queryParam('can_dock')), notSourcesHideAddFolder: () => Boolean(Runtime.queryParam(ConditionName.NOT_SOURCES_HIDE_ADD_FOLDER)), - reactNativeUnstableNetworkPanel: () => - Boolean(Runtime.queryParam(ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL)) || - experiments.isEnabled(ExperimentName.ENABLE_NETWORK_PANEL), + reactNativeExpoNetworkPanel: () => Boolean(Runtime.queryParam(ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL)), }; diff --git a/front_end/core/sdk/sdk-meta.ts b/front_end/core/sdk/sdk-meta.ts index 4d403cdabdb..b5a3472a70e 100644 --- a/front_end/core/sdk/sdk-meta.ts +++ b/front_end/core/sdk/sdk-meta.ts @@ -1009,7 +1009,7 @@ Common.Settings.registerSettingExtension({ }); Common.Settings.registerSettingExtension({ - category: Common.Settings.SettingCategory.NETWORK, + category: Common.Settings.SettingCategory.NETWORK_UNLESS_RN, title: i18nLazyString(UIStrings.networkRequestBlocking), settingName: 'request-blocking-enabled', settingType: Common.Settings.SettingType.BOOLEAN, diff --git a/front_end/entrypoints/inspector_main/inspector_main-meta.ts b/front_end/entrypoints/inspector_main/inspector_main-meta.ts index 2ee1e3fcb2b..ad8c668f15b 100644 --- a/front_end/entrypoints/inspector_main/inspector_main-meta.ts +++ b/front_end/entrypoints/inspector_main/inspector_main-meta.ts @@ -207,7 +207,7 @@ UI.ActionRegistration.registerActionExtension({ }); Common.Settings.registerSettingExtension({ - category: Common.Settings.SettingCategory.NETWORK, + category: Common.Settings.SettingCategory.NETWORK_UNLESS_RN, title: i18nLazyString(UIStrings.forceAdBlocking), settingName: 'network.ad-blocking-enabled', settingType: Common.Settings.SettingType.BOOLEAN, diff --git a/front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts b/front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts index 3eb42f1f753..4587238338e 100644 --- a/front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts +++ b/front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts @@ -17,10 +17,6 @@ import {FuseboxWindowTitleManager} from './FuseboxWindowTitleManager.js'; const {html, render} = Lit; const UIStrings = { - /** - * @description Message for the "settings changed" banner shown when a reload is required for the Network panel. - */ - reloadRequiredForNetworkPanelMessage: 'The Network panel is now available for dogfooding. Please reload to access it.', /** * @description Title shown when Network inspection is disabled due to multiple React Native hosts. */ @@ -86,8 +82,10 @@ export class FuseboxFeatureObserver implements this.#hideUnsupportedFeaturesForProfilingBuilds(); } - if (unstable_networkInspectionEnabled) { - this.#ensureNetworkPanelEnabled(); + // Hide Network panel entirely if backend support is disabled + // TODO(huntie): Remove after fbsource rollout is complete + if (!unstable_networkInspectionEnabled && !Root.Runtime.conditions.reactNativeExpoNetworkPanel()) { + this.#hideNetworkPanel(); } } @@ -127,19 +125,11 @@ export class FuseboxFeatureObserver implements }); } - #ensureNetworkPanelEnabled(): void { - if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.ENABLE_NETWORK_PANEL)) { - return; - } - - Root.Runtime.experiments.setEnabled( - Root.Runtime.ExperimentName.ENABLE_NETWORK_PANEL, - true, - ); - - UI.InspectorView?.InspectorView?.instance()?.displayReloadRequiredWarning( - i18nString(UIStrings.reloadRequiredForNetworkPanelMessage), - ); + #hideNetworkPanel(): void { + const viewManager = UI.ViewManager.ViewManager.instance(); + void viewManager.resolveLocation(UI.ViewManager.ViewLocationValues.PANEL).then(location => { + location?.removeView(viewManager.view('network')); + }); } #disableSingleHostOnlyFeatures(): void { diff --git a/front_end/panels/network/NetworkItemView.ts b/front_end/panels/network/NetworkItemView.ts index ff23b96ed1b..66f2ab80396 100644 --- a/front_end/panels/network/NetworkItemView.ts +++ b/front_end/panels/network/NetworkItemView.ts @@ -151,18 +151,12 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane { private readonly responseView: RequestResponseView|undefined; private cookiesView: RequestCookiesView|null; private initialTab?: NetworkForward.UIRequestLocation.UIRequestTabs; - private readonly isReactNative: boolean = false; constructor( request: SDK.NetworkRequest.NetworkRequest, calculator: NetworkTimeCalculator, initialTab?: NetworkForward.UIRequestLocation.UIRequestTabs) { super(); - // [RN] Used to scope down available features for React Native targets - this.isReactNative = Root.Runtime.experiments.isEnabled( - Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI, - ); - this.requestInternal = request; this.element.classList.add('network-item-view'); this.headerElement().setAttribute('jslog', `${VisualLogging.toolbar('request-details').track({ @@ -230,7 +224,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane { } } - if (!this.isReactNative || Root.Runtime.experiments.isEnabled(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL)) { + if (!Root.Runtime.conditions.reactNativeExpoNetworkPanel()) { this.appendTab( NetworkForward.UIRequestLocation.UIRequestTabs.INITIATOR, i18nString(UIStrings.initiator), new RequestInitiatorView(request), i18nString(UIStrings.requestInitiatorCallStack)); diff --git a/front_end/panels/network/NetworkPanel.test.ts b/front_end/panels/network/NetworkPanel.test.ts index 940334a85aa..8c0d367727f 100644 --- a/front_end/panels/network/NetworkPanel.test.ts +++ b/front_end/panels/network/NetworkPanel.test.ts @@ -3,7 +3,6 @@ // found in the LICENSE file. import * as Common from '../../core/common/common.js'; -import * as Root from '../../core/root/root.js'; import * as SDK from '../../core/sdk/sdk.js'; import * as Logs from '../../models/logs/logs.js'; import * as Trace from '../../models/trace/trace.js'; @@ -70,7 +69,6 @@ describeWithMockConnection('NetworkPanel', () => { registerNoopActions(['inspector-main.reload']); UI.ActionRegistration.maybeRemoveActionExtension('network.toggle-recording'); UI.ActionRegistration.maybeRemoveActionExtension('network.clear'); - Root.Runtime.experiments.register(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL, 'Network for test'); await import('./network-meta.js'); createTarget(); const dummyStorage = new Common.Settings.SettingsStorage({}); diff --git a/front_end/panels/network/network-meta.ts b/front_end/panels/network/network-meta.ts index 79191e63494..8d9398987dc 100644 --- a/front_end/panels/network/network-meta.ts +++ b/front_end/panels/network/network-meta.ts @@ -24,9 +24,9 @@ const UIStrings = { */ network: 'Network', /** - *@description Title of the Network tool (Expo, unstable) + *@description Title of the Network tool (Expo implementation) */ - networkExpoUnstable: 'Network (Expo, unstable)', + networkExpoUnstable: 'Expo Network', /** *@description Command for showing the 'Network request blocking' tool */ @@ -167,12 +167,10 @@ UI.ViewManager.registerViewExtension({ location: UI.ViewManager.ViewLocationValues.PANEL, id: 'network', commandPrompt: i18nLazyString(UIStrings.showNetwork), - title: () => Root.Runtime.experiments.isEnabled(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL) ? - i18nString(UIStrings.network) : - i18nString(UIStrings.networkExpoUnstable), + title: () => Root.Runtime.conditions.reactNativeExpoNetworkPanel() ? + i18nString(UIStrings.networkExpoUnstable) : + i18nString(UIStrings.network), order: 40, - isPreviewFeature: true, - condition: Root.Runtime.conditions.reactNativeUnstableNetworkPanel, async loadView() { const Network = await loadNetworkModule(); return Network.NetworkPanel.NetworkPanel.instance();