Skip to content

Commit e1dd7af

Browse files
authored
Remove network experiment and experimental icon (#220)
1 parent e174355 commit e1dd7af

File tree

9 files changed

+19
-49
lines changed

9 files changed

+19
-49
lines changed

front_end/core/common/SettingRegistration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export const enum SettingCategory {
136136
APPEARANCE = 'APPEARANCE',
137137
SOURCES = 'SOURCES',
138138
NETWORK = 'NETWORK',
139+
NETWORK_UNLESS_RN = '',
139140
PERFORMANCE = 'PERFORMANCE',
140141
CONSOLE = 'CONSOLE',
141142
PERSISTENCE = 'PERSISTENCE',

front_end/core/rn_experiments/experimentsImpl.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,3 @@ Instance.register({
184184
unstable: false,
185185
enabledByDefault: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint,
186186
});
187-
188-
Instance.register({
189-
name: RNExperimentName.ENABLE_NETWORK_PANEL,
190-
title: 'Enable Network panel',
191-
unstable: true,
192-
enabledByDefault: () => false,
193-
});

front_end/core/root/Runtime.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ export const experiments = new ExperimentsSupport();
305305
export enum RNExperimentName {
306306
REACT_NATIVE_SPECIFIC_UI = 'react-native-specific-ui',
307307
JS_HEAP_PROFILER_ENABLE = 'js-heap-profiler-enable',
308-
ENABLE_NETWORK_PANEL = 'enable-network-panel',
309308
}
310309

311310
export enum ConditionName {
@@ -340,7 +339,6 @@ export const enum ExperimentName {
340339
JS_HEAP_PROFILER_ENABLE = RNExperimentName.JS_HEAP_PROFILER_ENABLE,
341340
REACT_NATIVE_SPECIFIC_UI = RNExperimentName.REACT_NATIVE_SPECIFIC_UI,
342341
NOT_REACT_NATIVE_SPECIFIC_UI = '!' + RNExperimentName.REACT_NATIVE_SPECIFIC_UI,
343-
ENABLE_NETWORK_PANEL = RNExperimentName.ENABLE_NETWORK_PANEL,
344342
}
345343

346344
export enum GenAiEnterprisePolicyValue {
@@ -515,7 +513,5 @@ export type Condition = (config?: HostConfig) => boolean;
515513
export const conditions = {
516514
canDock: () => Boolean(Runtime.queryParam('can_dock')),
517515
notSourcesHideAddFolder: () => Boolean(Runtime.queryParam(ConditionName.NOT_SOURCES_HIDE_ADD_FOLDER)),
518-
reactNativeUnstableNetworkPanel: () =>
519-
Boolean(Runtime.queryParam(ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL)) ||
520-
experiments.isEnabled(ExperimentName.ENABLE_NETWORK_PANEL),
516+
reactNativeExpoNetworkPanel: () => Boolean(Runtime.queryParam(ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL)),
521517
};

front_end/core/sdk/sdk-meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ Common.Settings.registerSettingExtension({
10091009
});
10101010

10111011
Common.Settings.registerSettingExtension({
1012-
category: Common.Settings.SettingCategory.NETWORK,
1012+
category: Common.Settings.SettingCategory.NETWORK_UNLESS_RN,
10131013
title: i18nLazyString(UIStrings.networkRequestBlocking),
10141014
settingName: 'request-blocking-enabled',
10151015
settingType: Common.Settings.SettingType.BOOLEAN,

front_end/entrypoints/inspector_main/inspector_main-meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ UI.ActionRegistration.registerActionExtension({
207207
});
208208

209209
Common.Settings.registerSettingExtension({
210-
category: Common.Settings.SettingCategory.NETWORK,
210+
category: Common.Settings.SettingCategory.NETWORK_UNLESS_RN,
211211
title: i18nLazyString(UIStrings.forceAdBlocking),
212212
settingName: 'network.ad-blocking-enabled',
213213
settingType: Common.Settings.SettingType.BOOLEAN,

front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import {FuseboxWindowTitleManager} from './FuseboxWindowTitleManager.js';
1717
const {html, render} = Lit;
1818

1919
const UIStrings = {
20-
/**
21-
* @description Message for the "settings changed" banner shown when a reload is required for the Network panel.
22-
*/
23-
reloadRequiredForNetworkPanelMessage: 'The Network panel is now available for dogfooding. Please reload to access it.',
2420
/**
2521
* @description Title shown when Network inspection is disabled due to multiple React Native hosts.
2622
*/
@@ -86,8 +82,10 @@ export class FuseboxFeatureObserver implements
8682
this.#hideUnsupportedFeaturesForProfilingBuilds();
8783
}
8884

89-
if (unstable_networkInspectionEnabled) {
90-
this.#ensureNetworkPanelEnabled();
85+
// Hide Network panel entirely if backend support is disabled
86+
// TODO(huntie): Remove after fbsource rollout is complete
87+
if (!unstable_networkInspectionEnabled && !Root.Runtime.conditions.reactNativeExpoNetworkPanel()) {
88+
this.#hideNetworkPanel();
9189
}
9290
}
9391

@@ -127,19 +125,11 @@ export class FuseboxFeatureObserver implements
127125
});
128126
}
129127

130-
#ensureNetworkPanelEnabled(): void {
131-
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.ENABLE_NETWORK_PANEL)) {
132-
return;
133-
}
134-
135-
Root.Runtime.experiments.setEnabled(
136-
Root.Runtime.ExperimentName.ENABLE_NETWORK_PANEL,
137-
true,
138-
);
139-
140-
UI.InspectorView?.InspectorView?.instance()?.displayReloadRequiredWarning(
141-
i18nString(UIStrings.reloadRequiredForNetworkPanelMessage),
142-
);
128+
#hideNetworkPanel(): void {
129+
const viewManager = UI.ViewManager.ViewManager.instance();
130+
void viewManager.resolveLocation(UI.ViewManager.ViewLocationValues.PANEL).then(location => {
131+
location?.removeView(viewManager.view('network'));
132+
});
143133
}
144134

145135
#disableSingleHostOnlyFeatures(): void {

front_end/panels/network/NetworkItemView.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,12 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
151151
private readonly responseView: RequestResponseView|undefined;
152152
private cookiesView: RequestCookiesView|null;
153153
private initialTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
154-
private readonly isReactNative: boolean = false;
155154

156155
constructor(
157156
request: SDK.NetworkRequest.NetworkRequest, calculator: NetworkTimeCalculator,
158157
initialTab?: NetworkForward.UIRequestLocation.UIRequestTabs) {
159158
super();
160159

161-
// [RN] Used to scope down available features for React Native targets
162-
this.isReactNative = Root.Runtime.experiments.isEnabled(
163-
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
164-
);
165-
166160
this.requestInternal = request;
167161
this.element.classList.add('network-item-view');
168162
this.headerElement().setAttribute('jslog', `${VisualLogging.toolbar('request-details').track({
@@ -230,7 +224,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
230224
}
231225
}
232226

233-
if (!this.isReactNative || Root.Runtime.experiments.isEnabled(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL)) {
227+
if (!Root.Runtime.conditions.reactNativeExpoNetworkPanel()) {
234228
this.appendTab(
235229
NetworkForward.UIRequestLocation.UIRequestTabs.INITIATOR, i18nString(UIStrings.initiator),
236230
new RequestInitiatorView(request), i18nString(UIStrings.requestInitiatorCallStack));

front_end/panels/network/NetworkPanel.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// found in the LICENSE file.
44

55
import * as Common from '../../core/common/common.js';
6-
import * as Root from '../../core/root/root.js';
76
import * as SDK from '../../core/sdk/sdk.js';
87
import * as Logs from '../../models/logs/logs.js';
98
import * as Trace from '../../models/trace/trace.js';
@@ -70,7 +69,6 @@ describeWithMockConnection('NetworkPanel', () => {
7069
registerNoopActions(['inspector-main.reload']);
7170
UI.ActionRegistration.maybeRemoveActionExtension('network.toggle-recording');
7271
UI.ActionRegistration.maybeRemoveActionExtension('network.clear');
73-
Root.Runtime.experiments.register(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL, 'Network for test');
7472
await import('./network-meta.js');
7573
createTarget();
7674
const dummyStorage = new Common.Settings.SettingsStorage({});

front_end/panels/network/network-meta.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const UIStrings = {
2424
*/
2525
network: 'Network',
2626
/**
27-
*@description Title of the Network tool (Expo, unstable)
27+
*@description Title of the Network tool (Expo implementation)
2828
*/
29-
networkExpoUnstable: 'Network (Expo, unstable)',
29+
networkExpoUnstable: 'Expo Network',
3030
/**
3131
*@description Command for showing the 'Network request blocking' tool
3232
*/
@@ -167,12 +167,10 @@ UI.ViewManager.registerViewExtension({
167167
location: UI.ViewManager.ViewLocationValues.PANEL,
168168
id: 'network',
169169
commandPrompt: i18nLazyString(UIStrings.showNetwork),
170-
title: () => Root.Runtime.experiments.isEnabled(Root.Runtime.RNExperimentName.ENABLE_NETWORK_PANEL) ?
171-
i18nString(UIStrings.network) :
172-
i18nString(UIStrings.networkExpoUnstable),
170+
title: () => Root.Runtime.conditions.reactNativeExpoNetworkPanel() ?
171+
i18nString(UIStrings.networkExpoUnstable) :
172+
i18nString(UIStrings.network),
173173
order: 40,
174-
isPreviewFeature: true,
175-
condition: Root.Runtime.conditions.reactNativeUnstableNetworkPanel,
176174
async loadView() {
177175
const Network = await loadNetworkModule();
178176
return Network.NetworkPanel.NetworkPanel.instance();

0 commit comments

Comments
 (0)