Skip to content

pat-inject autoload-visible with IntersectionObserver #941

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

Merged
merged 10 commits into from
Mar 15, 2022

Conversation

thet
Copy link
Member

@thet thet commented Dec 22, 2021

pat-inject autoload visible: use intersection observer to not load too items out of viewport.

Attempt to fix #939
Alternative approach: #942

Fixes: #955

@thet thet marked this pull request as draft December 22, 2021 11:34
@thet thet changed the title use intersection observer to not load too items out of viewport. pat-inject autoload visible: use intersection observer to not load too items out of viewport. Dec 22, 2021
@thet thet changed the title pat-inject autoload visible: use intersection observer to not load too items out of viewport. pat-inject autoload-visible with IntersectionObserver Jan 27, 2022
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from 10e69e9 to e95b66e Compare February 21, 2022 17:34
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from 9d535c0 to d511b65 Compare March 7, 2022 08:47
@thet thet force-pushed the master branch 2 times, most recently from e3b2897 to 5060fa4 Compare March 14, 2022 07:50
thet added 5 commits March 14, 2022 22:50
… a BBB import.

Move utils.getCSSValue to dom.get_css_value and keep a BBB import in utils.
This change is made for these reasons:
- Avoid circular imports (even if supported).
- Code cleanup - move DOM related methods to dom module.
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from f72e1ba to 42af77e Compare March 14, 2022 22:57
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from 42af77e to ba8b978 Compare March 14, 2022 23:03
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from ba8b978 to d446771 Compare March 15, 2022 11:53
…ver.

The autoload-visible trigger of pat-inject now uses an IntersectionObserver.
This simplifies the code and improves performance because there are no more complex position calculations involved.

Fixes: #955
@thet thet force-pushed the inject-autoload-visible-intersectionobserver branch from d446771 to 4f26006 Compare March 15, 2022 11:55
@thet thet marked this pull request as ready for review March 15, 2022 11:57
@thet thet merged commit 71f6b75 into master Mar 15, 2022
@thet thet deleted the inject-autoload-visible-intersectionobserver branch March 15, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pat-inject autoload-visible with IntersectionObserver autoload-visible should not trigger injection for page elements above visible page top
1 participant