Content-Length: 374502 | pFad | https://github.com/angular/angular/pull/67497

43 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
Copy Markdown
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
@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
Copy Markdown
Member

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

@JeanMeche JeanMeche removed the state: blocked on G3 cleanup This change requires a G3 cleanup label Mar 31, 2026
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Mar 31, 2026
@ngbot
Copy link
Copy Markdown

ngbot bot commented Mar 31, 2026

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@JeanMeche JeanMeche added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Mar 31, 2026
@JeanMeche
Copy link
Copy Markdown
Member

Passing TGP

@SkyZeroZx SkyZeroZx force-pushed the refactor/improve-defer-diagnostic branch from e3e7aac to ead72c6 Compare April 1, 2026 01:21
@angular-robot angular-robot bot requested a review from JeanMeche April 1, 2026 01:21
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 ead72c6 to 62837cd Compare April 1, 2026 01:23
@SkyZeroZx
Copy link
Copy Markdown
Contributor Author

I updated some broken tests in language-service due to the latest change in defer prefetch.

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

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler detected: feature PR contains a feature commit target: major This PR is targeted for the next major release

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









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


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

Fetched URL: https://github.com/angular/angular/pull/67497

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy