-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
feat: lazy load images #1969
feat: lazy load images #1969
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-docs canceled.
|
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Works also on my iOS iPhone XS in Opera |
Why remove the |
Because it would load every image twice! (I tested it) |
But then, with this change, you don't have the blur brush anymore. I guess to have the best of both world, we could have the blurbrush image behind the image so it still renders before the image it loaded. Then we could hook |
Rewritten to use https://unlazy.byjohann.dev/integrations/nuxt.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
Hey @Shinigami92 – you were fast! I was about to open a PR with unlazy. Thank you for the effort. Some notes: <UnLazyImage :lazy-load="shouldLoadImage" /> If Regarding |
scrolled through the preview app and seems to work 👌 |
@Shinigami92 check this weird behavior on the deployed preview. The page is reloaded when switching tabs. |
@ayoayco can you check if images have width and height set? |
If anybody wants to try to fix this tab behavior, feel free to take over the PR, because I don't know what the Unlazy component is doing behind the scene |
Honestly, I'm unsure why this reload happens. Maybe because of some service worker magic under the hood in the preview environment? |
Yeah will do later, need to rest currently 😴 |
I don't think this issue is related to this PR. I was also able to reproduce it with other PRs like #2019. So maybe it is a regression in our test user. (also interesting, in your video you aren't always signed in to the Elk Dev Team Test user 🤔) |
I think @patak-dev also saw this on other PRs' preview environments! Will also check later. |
Yes it was signed out to make sure both environments were fetching from the same server (ie, because elk dev test user fetches from universeodon), to compare behavior but was hard due to auto reload. |
1113173
to
b434838
Compare
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
📊 Modified Dependency Overview:
|
I cant reproduce @ayoayco behavior on my local machine Peek.2023-04-26.18-22.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works great for me! Awesome work @johannschopplich and @Shinigami92!
theoretically closes #1954
https://caniuse.com/intersectionobserver