Repository navigation
Conversation
Chromium (and WebKit) only bucket a rule by a :where()/:is() subject when it holds a single selector; multi-argument lists land in the universal bucket and are matched against every element on each style recalculation. Wrap each selector of the scope() list in its own :where(), and split the header item rule the same way. Specificity and matching are unchanged. Closes #17793 (cherry picked from commit 24ab05e)
Angular removes a ViewEncapsulation.None component's styles with its last instance and re-inserts them with the next, restyling the page. Add IgxStylesRegistrar.retain() to keep them via one detached instance per app, and retain the components the grid creates and destroys while filtering, grouping, editing and loading. Refs #17794 (cherry picked from commit f24054a)
|
@simeonoff I measured and reviewed this branch. The performance fixes hold up, but Switching the theme at runtime raises an error once a grid existsAfter a grid has been created, every change of the root Cause:
Scope:
Repro (Jasmine, zone or zoneless): import { config } from 'rxjs';
import { THEME_TOKEN } from 'igniteui-angular/core';
it('switching the theme with a grid on the page raises no errors', async () => {
const errors: unknown[] = [];
const previous = config.onUnhandledError;
config.onUnhandledError = error => errors.push(error);
try {
const fixture = TestBed.createComponent(GridHostComponent); // any component with an <igx-grid>
fixture.detectChanges();
await fixture.whenStable();
const token = TestBed.inject(THEME_TOKEN);
token.set(token.theme === 'fluent' ? 'material' : 'fluent');
await new Promise(resolve => setTimeout(resolve, 50));
expect(errors).toEqual([]); // fails on this branch, passes on 22.2.x
} finally {
config.onUnhandledError = previous;
}
});Suggested fix: make the input group's file-input getters null-safe:
CHANGELOG wordingThe entry says the ids of these components "start from
Checked, nothing found
Performance, measured independentlyI built this branch and its base from source and ran them interleaved on 3 CI runners per row count (wall time, no CPU throttling). Changes against the base:
Filter + sort and data switch are back at 22.0.8's level at both row counts. Loading stays about 6% above 22.0.8, which is the part of #17794 this PR doesn't cover. |
The detached input group kept alive by IgxStylesRegistrar.retain() has no projected igxInput, so a runtime THEME_TOKEN change ran detectChanges() on it and threw from isFileType. Make the getters null-safe.
Closes #17793
Addresses (a) of #17794. Patch of #17839 for 22.2.x.
Description
scope()mixin wraps each selector of its list in its own:where(), and the grid header item rule is split the same way. Specificity and matching are unchanged.IgxStylesRegistrar.retain(...components)keeps one detached instance of each component per application, so Angular never removes its stylesheet.IgxGridBaseDirectiveretains badge, chip, checkbox, input group, date picker and circular progress bar.Both commits are cherry-picked from master with
-x. The only conflict wasCHANGELOG.md; the entries go under22.2.3as with other patches since that tag. The registrar spec is ported from Vitest to Jasmine for this branch.Motivation / Context
Measured on this branch at 4× CPU throttle, as main-thread time:
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Grid (all variants), Theming,
IgxStylesRegistrarHow Has This Been Tested?
All checks below were run on this branch, with its own dependencies (
npm ci).test:stylesandlint:lib.MutationObserveron<head>. No retained sheet is added or removed after load.Test Configuration:
Screenshots / Recordings
N/A, no visual changes.
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)