Skip to content

Commit 0e03d31

Browse files
authored
feat(performance): Add a grid sample as a project to test performance optimizations (#16050)
1 parent 912f503 commit 0e03d31

File tree

219 files changed

+2466
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+2466
-1
lines changed

angular.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,97 @@
478478
}
479479
}
480480
}
481+
},
482+
"igniteui-angular-performance": {
483+
"projectType": "application",
484+
"schematics": {
485+
"@schematics/angular:component": {
486+
"style": "scss"
487+
}
488+
},
489+
"root": "projects/igniteui-angular-performance",
490+
"sourceRoot": "projects/igniteui-angular-performance/src",
491+
"prefix": "app",
492+
"architect": {
493+
"build": {
494+
"builder": "@angular/build:application",
495+
"options": {
496+
"browser": "projects/igniteui-angular-performance/src/main.ts",
497+
"polyfills": [
498+
"zone.js"
499+
],
500+
"tsConfig": "projects/igniteui-angular-performance/tsconfig.app.json",
501+
"inlineStyleLanguage": "scss",
502+
"assets": [
503+
"projects/igniteui-angular-performance/src/assets"
504+
],
505+
"styles": [
506+
"projects/igniteui-angular-performance/src/styles.scss"
507+
],
508+
"stylePreprocessorOptions": {
509+
"includePaths": ["node_modules"]
510+
}
511+
},
512+
"configurations": {
513+
"production": {
514+
"budgets": [
515+
{
516+
"type": "initial",
517+
"maximumWarning": "500kB",
518+
"maximumError": "1MB"
519+
},
520+
{
521+
"type": "anyComponentStyle",
522+
"maximumWarning": "4kB",
523+
"maximumError": "8kB"
524+
}
525+
],
526+
"outputHashing": "all"
527+
},
528+
"development": {
529+
"optimization": false,
530+
"extractLicenses": false,
531+
"sourceMap": true
532+
}
533+
},
534+
"defaultConfiguration": "production"
535+
},
536+
"serve": {
537+
"builder": "@angular/build:dev-server",
538+
"configurations": {
539+
"production": {
540+
"buildTarget": "igniteui-angular-performance:build:production"
541+
},
542+
"development": {
543+
"buildTarget": "igniteui-angular-performance:build:development"
544+
}
545+
},
546+
"defaultConfiguration": "development"
547+
},
548+
"extract-i18n": {
549+
"builder": "@angular/build:extract-i18n"
550+
},
551+
"test": {
552+
"builder": "@angular/build:karma",
553+
"options": {
554+
"polyfills": [
555+
"zone.js",
556+
"zone.js/testing"
557+
],
558+
"tsConfig": "projects/igniteui-angular-performance/tsconfig.spec.json",
559+
"inlineStyleLanguage": "scss",
560+
"assets": [
561+
{
562+
"glob": "**/*",
563+
"input": "projects/igniteui-angular-performance/public"
564+
}
565+
],
566+
"styles": [
567+
"projects/igniteui-angular-performance/src/styles.scss"
568+
]
569+
}
570+
}
571+
}
481572
}
482573
},
483574
"cli": {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve --open --hmr",
77
"start:elements": "ng serve --project igniteui-angular-elements",
8+
"start:performance": "ng serve --project igniteui-angular-performance",
89
"build": "ng build --configuration production",
910
"test": "ng test igniteui-angular",
1011
"lint": "ng lint",
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<main class="wrapper">
2+
<div class="routes">
3+
<button igxButton="contained" routerLink="/">1K records</button>
4+
<button igxButton="contained" routerLink="/grid-100k">100K records</button>
5+
<button igxButton="contained" routerLink="/grid-1m">1M records</button>
6+
</div>
7+
<router-outlet />
8+
</main>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
:host {
2+
width: 100%;
3+
height: 100%;
4+
display: flex;
5+
}
6+
7+
.wrapper {
8+
width: 100%;
9+
height: 100%;
10+
display: flex;
11+
flex-direction: column;
12+
}
13+
14+
.routes {
15+
padding: 1rem;
16+
display: flex;
17+
gap: 1rem;
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
let component: AppComponent;
7+
let fixture: ComponentFixture<AppComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [AppComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(AppComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from '@angular/core';
2+
import { RouterLink, RouterOutlet } from '@angular/router';
3+
import { IgxButtonDirective } from 'igniteui-angular';
4+
5+
@Component({
6+
selector: 'app-root',
7+
imports: [RouterOutlet, IgxButtonDirective, RouterLink],
8+
templateUrl: './app.component.html',
9+
styleUrl: './app.component.scss'
10+
})
11+
export class AppComponent {
12+
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
import { provideAnimations } from '@angular/platform-browser/animations';
4+
5+
import { routes } from './app.routes';
6+
7+
export const appConfig: ApplicationConfig = {
8+
providers: [
9+
provideBrowserGlobalErrorListeners(),
10+
provideZoneChangeDetection({ eventCoalescing: true }),
11+
provideRouter(routes),
12+
provideAnimations()
13+
]
14+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Routes } from '@angular/router';
2+
import { GridComponent } from './grid/grid.component';
3+
4+
export const routes: Routes = [
5+
{
6+
path: "grid-100k",
7+
component: GridComponent,
8+
data: { rows: 100_000 }
9+
},
10+
{
11+
path: "grid-1m",
12+
component: GridComponent,
13+
data: { rows: 1_000_000 }
14+
},
15+
{
16+
path: "",
17+
pathMatch: 'full',
18+
component: GridComponent,
19+
data: { rows: 1000 }
20+
}
21+
];

0 commit comments

Comments
 (0)