Skip to content
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

Add defer viewport and hover triggers #51874

Closed
wants to merge 2 commits into from
Closed

Conversation

crisbeto
Copy link
Member

Adds the implementations for the on viewport and on hover triggers in defer blocks. Includes the following commits:

feat(core): support deferred hover triggers

Adds support for on hover and prefetch on hover triggers. Some code had to be moved around so it could be reused from the on interaction triggers.

feat(core): support deferred viewport triggers

Adds support for on viewport and prefetch on viewport triggers which will load the deferred content when the element comes into the view.

Adds support for `on hover` and `prefetch on hover` triggers. Some code had to be moved around so it could be reused from the `on interaction` triggers.
Adds support for `on viewport` and `prefetch on viewport` triggers which will load the deferred content when the element comes into the view.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: major This PR is targeted for the next major release labels Sep 22, 2023
@ngbot ngbot bot added this to the Backlog milestone Sep 22, 2023
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Sep 22, 2023
}

/** Keeps track of the registered `viewport` triggers. */
class DeferIntersectionManager {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to keep the injectable for the viewport triggers, because the state ended up leaking between tests.

@crisbeto crisbeto marked this pull request as ready for review September 22, 2023 20:46
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍 Nice work with IntersectionObserver APIs!

@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 22, 2023
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Sep 23, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Sep 25, 2023

This PR was merged into the repository by commit 16f5fc4.

@dylhunn dylhunn closed this in 687b961 Sep 25, 2023
dylhunn pushed a commit that referenced this pull request Sep 25, 2023
Adds support for `on viewport` and `prefetch on viewport` triggers which will load the deferred content when the element comes into the view.

PR Close #51874
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 26, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
Adds support for `on hover` and `prefetch on hover` triggers. Some code had to be moved around so it could be reused from the `on interaction` triggers.

PR Close angular#51874
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
Adds support for `on viewport` and `prefetch on viewport` triggers which will load the deferred content when the element comes into the view.

PR Close angular#51874
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime 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.

None yet

3 participants