-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 unloading capability to the image loader #1065
Conversation
@MrTimscampi can this be added to the backports or did we never add the original improvements? |
The original changes (adding animations) were in 10.5.0. However, this feels a little large to be backported (It's completely changing a module) |
It also uses a lot of ES6, which 10.5.0 doesn't support. |
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.
Now it works.
It seems that our export default {}
doesn't work as we expected. At current moment, they may be broken for some modules (at least, userSettings
).
Seems like we need to replace the imports with: |
if (entry.target) { | ||
source = entry.target.getAttribute('data-src'); | ||
} else { | ||
source = entry; |
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.
I think that if we get here, we will fail in fillImageElement(entry.target, source);
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.
One thing left https://github.com/jellyfin/jellyfin-web/pull/1065/files#r418583694
But that just looks redundant to me.
elem.classList.remove('lazy-image-fadein-fast'); | ||
elem.classList.remove('lazy-image-fadein'); |
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.
cannot we combine them in one line?
@MrTimscampi you got merge conflicts here |
Kudos, SonarCloud Quality Gate passed!
|
Changes
Removes the scroll lazy loader (since IntersectionObserver is polyfilled), changes the lazy loader to pass the entry instead of the element and adds unloading to the image loader.
Issues
Should improve any low-memory device (Smart TV, mobile), contribute to improving #858 and improve responsiveness when the library limit is set to 0.