mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(devtools): promote router tree to stable
Previous the router tree was an opt-in feature that required manual enablement in settings.
Now the router tree is enabled by default whenever the application supports it and routes are detected.
(cherry picked from commit 35046d3dba)
This commit is contained in:
committed by
Leon Senft
parent
4729e804ac
commit
79519409cd
@@ -21,12 +21,6 @@ export class Settings {
|
||||
initialValue: false,
|
||||
});
|
||||
|
||||
readonly routerGraphEnabled = this.settingsStore.create({
|
||||
key: 'router_graph_enabled',
|
||||
category: 'general',
|
||||
initialValue: false,
|
||||
});
|
||||
|
||||
readonly timingAPIEnabled = this.settingsStore.create({
|
||||
key: 'timing_api_enabled',
|
||||
category: 'general',
|
||||
|
||||
@@ -12,7 +12,6 @@ import {SettingsStore} from '../settings_store';
|
||||
import {ThemePreference} from '../theme_types';
|
||||
|
||||
export class SettingsMock extends Settings {
|
||||
routerGraphEnabled = signal(false);
|
||||
showCommentNodes = signal(false);
|
||||
timingAPIEnabled = signal(false);
|
||||
theme = signal<ThemePreference>('system');
|
||||
|
||||
@@ -138,15 +138,6 @@
|
||||
/>
|
||||
<span class="ng-mat-menu-label-text">Show comment nodes</span>
|
||||
</label>
|
||||
@if (supportedApis().routes) {
|
||||
<label mat-menu-item disableRipple>
|
||||
<mat-slide-toggle
|
||||
[checked]="routerGraphEnabled()"
|
||||
(change)="setRouterGraph($event.checked)"
|
||||
/>
|
||||
<span class="ng-mat-menu-label-text">Enable Router Tree</span>
|
||||
</label>
|
||||
}
|
||||
@if (supportedApis().transferState) {
|
||||
<label mat-menu-item disableRipple>
|
||||
<mat-slide-toggle
|
||||
|
||||
@@ -84,7 +84,6 @@ export class DevToolsTabsComponent {
|
||||
readonly inspectorRunning = signal(false);
|
||||
|
||||
protected readonly showCommentNodes = this.settings.showCommentNodes;
|
||||
protected readonly routerGraphEnabled = this.settings.routerGraphEnabled;
|
||||
protected readonly timingAPIEnabled = this.settings.timingAPIEnabled;
|
||||
protected readonly signalGraphEnabled = () => this.supportedApis().signals;
|
||||
protected readonly transferStateEnabled = this.settings.transferStateEnabled;
|
||||
@@ -104,7 +103,7 @@ export class DevToolsTabsComponent {
|
||||
if (supportedApis.dependencyInjection) {
|
||||
tabs.push('Injector Tree');
|
||||
}
|
||||
if (this.routerGraphEnabled() && this.routes().length > 0) {
|
||||
if (supportedApis.routes && this.routes().length > 0) {
|
||||
tabs.push('Router Tree');
|
||||
}
|
||||
if (supportedApis.transferState && this.transferStateEnabled()) {
|
||||
@@ -197,13 +196,6 @@ export class DevToolsTabsComponent {
|
||||
: this.messageBus.emit('disableTimingAPI');
|
||||
}
|
||||
|
||||
protected setRouterGraph(enabled: boolean): void {
|
||||
this.routerGraphEnabled.set(enabled);
|
||||
if (!enabled) {
|
||||
this.activeTab.set('Components');
|
||||
}
|
||||
}
|
||||
|
||||
protected setTransferStateTab(enabled: boolean): void {
|
||||
this.transferStateEnabled.set(enabled);
|
||||
if (!enabled && this.activeTab() === 'Transfer State') {
|
||||
|
||||
Reference in New Issue
Block a user