Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions front_end/core/common/SettingRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const enum SettingCategory {
APPEARANCE = 'APPEARANCE',
SOURCES = 'SOURCES',
NETWORK = 'NETWORK',
NETWORK_UNLESS_RN = '',
PERFORMANCE = 'PERFORMANCE',
CONSOLE = 'CONSOLE',
PERSISTENCE = 'PERSISTENCE',
Expand Down
7 changes: 0 additions & 7 deletions front_end/core/rn_experiments/experimentsImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
6 changes: 1 addition & 5 deletions front_end/core/root/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)),
};
2 changes: 1 addition & 1 deletion front_end/core/sdk/sdk-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
28 changes: 9 additions & 19 deletions front_end/entrypoints/rn_fusebox/FuseboxFeatureObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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();
}
}

Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 1 addition & 7 deletions front_end/panels/network/NetworkItemView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 0 additions & 2 deletions front_end/panels/network/NetworkPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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({});
Expand Down
12 changes: 5 additions & 7 deletions front_end/panels/network/network-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
Expand Down
Loading