mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): make AfterRenderImpl tree-shakable by moving PHASES (#58297)
Marked the PHASES constant within AfterRenderImpl as @__PURE__ to enable better tree-shaking during bundling. This optimization ensures that unused code is more effectively eliminated, improving overall bundle size and performance. Closes #58296 PR Close #58297
This commit is contained in:
parent
7dfb127c03
commit
cf7f8c7c03
1 changed files with 7 additions and 6 deletions
|
|
@ -33,12 +33,13 @@ export class AfterRenderManager {
|
|||
}
|
||||
|
||||
export class AfterRenderImpl {
|
||||
static readonly PHASES = [
|
||||
AfterRenderPhase.EarlyRead,
|
||||
AfterRenderPhase.Write,
|
||||
AfterRenderPhase.MixedReadWrite,
|
||||
AfterRenderPhase.Read,
|
||||
] as const;
|
||||
static readonly PHASES = /* @__PURE__ **/ (() =>
|
||||
[
|
||||
AfterRenderPhase.EarlyRead,
|
||||
AfterRenderPhase.Write,
|
||||
AfterRenderPhase.MixedReadWrite,
|
||||
AfterRenderPhase.Read,
|
||||
] as const)();
|
||||
|
||||
private readonly ngZone = inject(NgZone);
|
||||
private readonly scheduler = inject(ChangeDetectionScheduler);
|
||||
|
|
|
|||
Loading…
Reference in a new issue