8000 refactor(devtools): mark devtools components onpush by sheikalthaf · Pull Request #59552 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content

refactor(devtools): mark devtools components onpush #59552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import {
afterNextRender,
ChangeDetectionStrategy,
Component,
computed,
effect,
Expand All @@ -22,6 +23,7 @@ import {InjectorTreeNode, InjectorTreeVisualizer} from './injector-tree-visualiz

@Component({
selector: 'ng-resolution-path',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<section class="injector-graph">
<svg #svgContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, computed, inject, input, output, signal} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
computed,
inject,
input,
output,
signal,
} from '@angular/core';
import {MatIcon} from '@angular/material/icon';
import {MatMenu, MatMenuItem, MatMenuTrigger} from '@angular/material/menu';
import {MatSlideToggle} from '@angular/material/slide-toggle';
Expand All @@ -30,6 +38,7 @@ type Tabs = 'Components' | 'Profiler' | 'Router Tree' | 'Injector Tree';
selector: 'ng-devtools-tabs',
templateUrl: './devtools-tabs.component.html',
styleUrls: ['./devtools-tabs.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatTabNav,
MatTabNavPanel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
output,
signal,
viewChild,
ChangeDetectionStrategy,
} from '@angular/core';
import {
ComponentExplorerView,
Expand Down Expand Up @@ -67,6 +68,7 @@ const sameDirectives = (a: IndexedNode, b: IndexedNode) => {
selector: 'ng-directive-explorer',
templateUrl: './directive-explorer.component.html',
styleUrls: ['./directive-explorer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: ElementPropertyResolver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import {
ChangeDetectionStrategy,
Component,
computed,
effect,
Expand All @@ -26,6 +27,7 @@ import {MatCard} from '@angular/material/card';
selector: 'ng-breadcrumbs',
templateUrl: './breadcrumbs.component.html',
styleUrls: ['./breadcrumbs.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatCard, MatIcon, MatButton],
})
export class BreadcrumbsComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, input, output} from '@angular/core';
import {MatIcon} from '@angular/material/icon';
import {MatCard} from '@angular/material/card';

@Component({
selector: 'ng-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatCard, MatIcon],
})
export class FilterComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, input, output} from '@angular/core';
import {DirectivePosition} from 'protocol';

import {IndexedNode} from '../directive-forest/index-forest';
Expand All @@ -15,8 +15,9 @@ import {PropertyTabBodyComponent} from './property-view/property-tab-body.compon
import {PropertyTabHeaderComponent} from './property-tab-header.component';

@Component({
templateUrl: './property-tab.component.html',
selector: 'ng-property-tab',
templateUrl: './property-tab.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [PropertyTabHeaderComponent, PropertyTabBodyComponent],
})
export class PropertyTabComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
output,
signal,
viewChild,
ChangeDetectionStrategy,
} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {ContainerType} from 'protocol';
Expand All @@ -36,9 +37,10 @@ const parseValue = (value: EditorResult): EditorResult => {
};

@Component({
templateUrl: './property-editor.component.html',
selector: 'ng-property-editor',
templateUrl: './property-editor.component.html',
styleUrls: ['./property-editor.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [FormsModule],
})
export class PropertyEditorComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, computed, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, computed, input, output} from '@angular/core';
import {PropType} from 'protocol';

import {FlatNode} from '../../property-resolver/element-property-resolver';
Expand All @@ -15,6 +15,7 @@ import {FlatNode} from '../../property-resolver/element-property-resolver';
selector: 'ng-property-preview',
templateUrl: './property-preview.component.html',
styleUrls: ['./property-preview.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PropertyPreviewComponent {
readonly node = input.required<FlatNode>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, computed, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, computed, input, output} from '@angular/core';
import {DirectivePosition} from 'protocol';

import {IndexedNode} from '../../directive-forest/index-forest';
import {FlatNode} from '../../property-resolver/element-property-resolver';
import {PropertyViewComponent} from './property-view.component';

@Component({
templateUrl: './property-tab-body.component.html',
selector: 'ng-property-tab-body',
templateUrl: './property-tab-body.component.html',
styleUrls: ['./property-tab-body.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [PropertyViewComponent],
})
export class PropertyTabBodyComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
*/

import {CdkDragDrop, moveItemInArray, CdkDropList, CdkDrag} from '@angular/cdk/drag-drop';
import {Component, computed, forwardRef, input, output} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
computed,
forwardRef,
input,
output,
} from '@angular/core';
import {DirectivePosition, SerializedInjectedService} from 'protocol';

import {
Expand All @@ -26,6 +33,7 @@ import {MatExpansionModule} from '@angular/material/expansion';
selector: 'ng-property-view-body',
templateUrl: './property-view-body.component.html',
styleUrls: ['./property-view-body.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatExpansionModule,
CdkDropList,
Expand Down Expand Up @@ -106,6 +114,7 @@ export class PropertyViewBodyComponent {

@Component({
selector: 'ng-dependency-viewer',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<mat-accordion class="example-headers-align" multi>
<mat-expansion-panel>
Expand Down Expand Up @@ -173,6 +182,7 @@ export class DependencyViewerComponent {

@Component({
selector: 'ng-injected-services',
changeDetection: ChangeDetectionStrategy.OnPush,
template: ` @for (dependency of dependencies(); track dependency.position[0]) {
<ng-dependency-viewer [dependency]="dependency" />
}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, input, output} from '@angular/core';
import {MatIcon} from '@angular/material/icon';
import {MatTooltip} from '@angular/material/tooltip';
import {MatToolbar} from '@angular/material/toolbar';
Expand All @@ -15,6 +15,7 @@ import {MatToolbar} from '@angular/material/toolbar';
selector: 'ng-property-view-header',
templateUrl: './property-view-header.component.html',
styleUrls: ['./property-view-header.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatToolbar, MatTooltip, MatIcon],
})
export class PropertyViewHeaderComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {FlatTreeControl} from '@angular/cdk/tree';
import {Component, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, input, output} from '@angular/core';

import {FlatNode} from '../../property-resolver/element-property-resolver';
import {PropertyDataSource} from '../../property-resolver/property-data-source';
Expand All @@ -20,6 +20,7 @@ import {MatTree, MatTreeNode, MatTreeNodeDef, MatTreeNodePadding} from '@angular
selector: 'ng-property-view-tree',
templateUrl: './property-view-tree.component.html',
styleUrls: ['./property-view-tree.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatTree,
MatTreeNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, computed, inject, input, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, computed, inject, input, output} from '@angular/core';
import {DirectivePosition} from 'protocol';

import {ElementPropertyResolver, FlatNode} from '../../property-resolver/element-property-resolver';
Expand All @@ -17,6 +17,7 @@ import {PropertyViewHeaderComponent} from './property-view-header.component';
selector: 'ng-property-view',
templateUrl: './property-view.component.html',
styleUrls: ['./property-view.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [PropertyViewHeaderComponent, PropertyViewBodyComponent],
})
export class PropertyViewComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, computed, inject, input, signal} from '@angular/core';
import {ChangeDetectionStrategy, Component, computed, inject, input, signal} from '@angular/core';
import {MatOption} from '@angular/material/core';
import {MatFormField, MatLabel} from '@angular/material/form-field';
import {MatIcon} from '@angular/material/icon';
Expand All @@ -20,6 +20,7 @@ import {Events, MessageBus, SerializedInjector, SerializedProviderRecord} from '
selector: 'ng-injector-providers',
templateUrl: './injector-providers.component.html',
styleUrl: './injector-providers.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatTableModule,
MatIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import {
afterNextRender,
ChangeDetectionStrategy,
Component,
ElementRef,
inject,
Expand Down Expand Up @@ -46,6 +47,7 @@ import {

@Component({
selector: 'ng-injector-tree',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
SplitComponent,
SplitAreaDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, inject} from '@angular/core';
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
import {
MAT_DIALOG_DATA,
MatDialogRef,
Expand All @@ -28,6 +28,7 @@ interface DialogData {
selector: 'ng-profiler-import-dialog',
templateUrl: './profiler-import-dialog.component.html',
styleUrls: ['./profiler-import-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle, MatButton],
})
export class ProfilerImportDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, inject, signal} from '@angular/core';
import {ChangeDetectionStrategy, Component, inject, signal} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {Events, MessageBus, ProfilerFrame} from 'protocol';
import {Subject} from 'rxjs';
Expand All @@ -28,6 +28,7 @@ const PROFILER_VERSION = 1;
selector: 'ng-profiler',
templateUrl: './profiler.component.html',
styleUrls: ['./profiler.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatCard, MatIconButton, MatTooltip, MatIcon, TimelineComponent],
})
export class ProfilerComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '@angular/cdk/scrolling';
import {
afterRenderEffect,
ChangeDetectionStrategy,
Component,
computed,
ElementRef,
Expand All @@ -37,6 +38,7 @@ const ITEM_WIDTH = 30;
selector: 'ng-frame-selector',
templateUrl: './frame-selector.component.html',
styleUrls: ['./frame-selector.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatCard,
MatTooltip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {MatProgressBar} from '@angular/material/progress-bar';

@Component({
selector: 'ng-recording-dialog',
templateUrl: './recording-dialog.component.html',
styleUrls: ['./recording-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatProgressBar],
})
export class RecordingDialogComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RecordingDialogComponent} from './recording-dialog.component';

@Component({
selector: 'ng-recording-modal',
templateUrl: './recording-modal.component.html',
styleUrls: ['./recording-modal.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [RecordingDialogComponent],
})
export class RecordingModalComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, input, model, output} from '@angular/core';
import {ChangeDetectionStrategy, Component, input, model, output} from '@angular/core';
import {ProfilerFrame} from 'protocol';

import {VisualizationMode} from './visualization-mode';
Expand All @@ -22,6 +22,7 @@ import {DecimalPipe} from '@angular/common';
selector: 'ng-timeline-controls',
templateUrl: './timeline-controls.component.html',
styleUrls: ['./timeline-controls.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatFormField,
MatLabel,
Expand Down
Loading
Loading
0