pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/angular/angular/pull/67497

sets/global-68dd150ce6c8e711.css" /> Improve Defer Trigger Misconfiguration by SkyZeroZx · Pull Request #67497 · angular/angular · GitHub
Skip to content

Improve Defer Trigger Misconfiguration#67497

Open
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
SkyZeroZx:refactor/improve-defer-diagnostic
Open

Improve Defer Trigger Misconfiguration#67497
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
SkyZeroZx:refactor/improve-defer-diagnostic

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Mar 6, 2026

On top #65553

Add two commits

Add diagnostics for idle prefetch triggers

Since adding support for @defer (on idle(500ms)), some idle + prefetch timing combinations are not detected correctly.

@defer (on idle(500ms); prefetch on idle(200ms) ) {
    <heavy-comp />
}

Currently, this throws an error that is actually incorrect

NG8021: Prefetch 'idle' matches the main trigger and provides no benefit. Remove the prefetch modifier.

Adds warning for prefetch without main defer trigger

Relative to #52746 and according examples in documentation

For example

@defer (prefetch when someFlag) {
  <heavy-comp />
}

This configuration may suggest that the prefetch will only run when someFlag becomes true.
However, since the main trigger still defaults to on idle, the deferred content can be fetched earlier during the browser’s idle period, effectively bypassing the intended condition.

Closes #52746

@pullapprove pullapprove bot requested a review from devversion March 6, 2026 19:26
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: compiler Issues related to `ngc`, Angular's template compiler labels Mar 6, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 6, 2026
@JeanMeche JeanMeche requested review from JeanMeche and removed request for devversion March 11, 2026 16:41
@pullapprove pullapprove bot requested a review from devversion March 11, 2026 16:41
@JeanMeche

This comment was marked as outdated.

@JeanMeche JeanMeche removed the request for review from devversion March 11, 2026 16:41
Extends the extended diagnostic for `@defer` trigger misconfiguration to include `on idle` triggers
Emit a warning when an `@defer` block uses `prefetch` triggers but does not define an explicit main trigger.

Closes angular#52746
@SkyZeroZx SkyZeroZx force-pushed the refactor/improve-defer-diagnostic branch from 46007c8 to e3e7aac Compare March 13, 2026 16:49
@JeanMeche JeanMeche added state: blocked on G3 cleanup This change requires a G3 cleanup and removed state: blocked labels Mar 13, 2026
@JeanMeche
Copy link
Member

As expected this will require a cleanup on our side to land. There are a few prefetch without main trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler detected: feature PR contains a feature commit state: blocked on G3 cleanup This change requires a G3 cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require main @defer triggers to be defined when prefetch conditions are present

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy