-
Notifications
You must be signed in to change notification settings - Fork 159
fix(perf): Apply base grid scroll performance optimizations. #16708
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
Changes from all commits
66afb8a
3272733
62cd4e0
c4119a0
751d526
eb38e63
afaa5d7
8be5b52
2b1c08d
ad36859
6cb59bd
f2cf55a
61b12c2
96c7e5e
b8f2889
fc7fb34
4fdb6e5
d87fa5d
a3fcc35
3c446e8
92e3c37
db7bfb7
75fe919
571a9d6
fd21b71
2a4b72d
df72717
ae89901
3d9b892
2a143a9
95da8e5
fd25a13
65eabef
7f5bcb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| import { Component } from '@angular/core'; | ||||||
| import { Component, ViewChild } from '@angular/core'; | ||||||
| import { RouterLink, RouterOutlet, Routes } from '@angular/router'; | ||||||
| import { IgxButtonDirective } from 'igniteui-angular'; | ||||||
| import { routes } from './app.routes'; | ||||||
|
|
@@ -11,4 +11,24 @@ import { routes } from './app.routes'; | |||||
| }) | ||||||
| export class AppComponent { | ||||||
| protected routes: Routes = routes; | ||||||
|
|
||||||
| @ViewChild(RouterOutlet) outlet!: RouterOutlet; | ||||||
|
|
||||||
| public async OnPerfTest() { | ||||||
| const longTask = []; | ||||||
| const observer = new PerformanceObserver((list) => { | ||||||
| longTask.push(...list.getEntries()); | ||||||
| }); | ||||||
| observer.observe({ entryTypes: ['longtask'] }); | ||||||
| const grid = (this.outlet.component as any).grid || (this.outlet.component as any).pivotGrid; | ||||||
| for (let i = 0; i < 100; i++) { | ||||||
| grid.navigateTo(i * 50); | ||||||
| await new Promise(r => setTimeout(r, 50)); | ||||||
| } | ||||||
| const sum = longTask.reduce((acc, task) => acc + task.duration, 0); | ||||||
| const avgTime = sum / longTask.length; | ||||||
| console.log('Long Tasks:'+ longTask.length + ", ", 'Average Long Task Time:', avgTime); | ||||||
|
||||||
| console.log('Long Tasks:'+ longTask.length + ", ", 'Average Long Task Time:', avgTime); | |
| console.log('Long Tasks: ' + longTask.length + ', ', 'Average Long Task Time:', avgTime); |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||
| import { NgForOfContext } from '@angular/common'; | ||||||||||
| import { ChangeDetectorRef, ComponentRef, Directive, DoCheck, EmbeddedViewRef, EventEmitter, Input, IterableChanges, IterableDiffer, IterableDiffers, NgZone, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, TemplateRef, TrackByFunction, ViewContainerRef, AfterViewInit, booleanAttribute, DOCUMENT, inject } from '@angular/core'; | ||||||||||
| import { ChangeDetectorRef, ComponentRef, Directive, EmbeddedViewRef, EventEmitter, Input, IterableChanges, IterableDiffer, IterableDiffers, NgZone, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, TemplateRef, TrackByFunction, ViewContainerRef, AfterViewInit, booleanAttribute, DOCUMENT, inject, afterNextRender, runInInjectionContext, EnvironmentInjector } from '@angular/core'; | ||||||||||
|
|
||||||||||
| import { DisplayContainerComponent } from './display.container'; | ||||||||||
| import { HVirtualHelperComponent } from './horizontal.virtual.helper.component'; | ||||||||||
|
|
@@ -84,16 +84,17 @@ export abstract class IgxForOfToken<T, U extends T[] = T[]> { | |||||||||
| ], | ||||||||||
| standalone: true | ||||||||||
| }) | ||||||||||
| export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U> implements OnInit, OnChanges, DoCheck, OnDestroy, AfterViewInit { | ||||||||||
| export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U> implements OnInit, OnChanges, OnDestroy, AfterViewInit { | ||||||||||
| private _viewContainer = inject(ViewContainerRef); | ||||||||||
| protected _template = inject<TemplateRef<NgForOfContext<T>>>(TemplateRef); | ||||||||||
| protected _differs = inject(IterableDiffers); | ||||||||||
| protected _injector = inject(EnvironmentInjector); | ||||||||||
| public cdr = inject(ChangeDetectorRef); | ||||||||||
| protected _zone = inject(NgZone); | ||||||||||
| protected syncScrollService = inject(IgxForOfScrollSyncService); | ||||||||||
| protected platformUtil = inject(PlatformUtil); | ||||||||||
| protected document = inject(DOCUMENT); | ||||||||||
|
|
||||||||||
| private _igxForOf: U & T[] | null = null; | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * Sets the data to be rendered. | ||||||||||
|
|
@@ -102,7 +103,16 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U | |||||||||
| * ``` | ||||||||||
| */ | ||||||||||
| @Input() | ||||||||||
| public igxForOf: U & T[] | null; | ||||||||||
| public get igxForOf(): U & T[] | null { | ||||||||||
| return this._igxForOf; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| public set igxForOf(value: U & T[] | null) { | ||||||||||
| this._igxForOf = value; | ||||||||||
| if(this._differ) { | ||||||||||
|
||||||||||
| if(this._differ) { | |
| if (this._differ) { |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation/formatting. The closing brace and parenthesis formatting doesn't follow the project's style shown elsewhere in the file.
| }); | |
| }); | |
| }); | |
| }); |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as containerTopOffset - will return NaN if transform is undefined or doesn't match. Should have a fallback: Number(...) || 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name
ris non-descriptive. Use a more meaningful name likeresolvefor the Promise resolver.