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 unloading capability to the image loader #1065

Merged
merged 21 commits into from
May 7, 2020

Conversation

heyhippari
Copy link
Contributor

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.

@heyhippari heyhippari requested a review from a team April 11, 2020 21:05
@heyhippari heyhippari requested a review from a team April 16, 2020 12:51
@dkanada
Copy link
Member

dkanada commented Apr 16, 2020

@MrTimscampi can this be added to the backports or did we never add the original improvements?

@heyhippari
Copy link
Contributor Author

@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)

@heyhippari
Copy link
Contributor Author

It also uses a lot of ES6, which 10.5.0 doesn't support.

@heyhippari heyhippari requested a review from a team April 18, 2020 14:25
@heyhippari heyhippari mentioned this pull request Apr 22, 2020
@heyhippari heyhippari added the es6 label Apr 25, 2020
@JustAMan JustAMan added the merge conflict Conflicts prevent merging label Apr 29, 2020
@heyhippari heyhippari removed the merge conflict Conflicts prevent merging label May 1, 2020
Copy link
Contributor

@dmitrylyzo dmitrylyzo left a 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).

@heyhippari
Copy link
Contributor Author

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: import * as whatever from 'whatever' for it to work, at least for userSettings.

if (entry.target) {
source = entry.target.getAttribute('data-src');
} else {
source = entry;
Copy link
Contributor

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);

Copy link
Contributor

@dmitrylyzo dmitrylyzo left a 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.

Comment on lines +72 to +73
elem.classList.remove('lazy-image-fadein-fast');
elem.classList.remove('lazy-image-fadein');
Copy link
Contributor

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?

@JustAMan
Copy link
Contributor

JustAMan commented May 6, 2020

@MrTimscampi you got merge conflicts here

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
10.0% 10.0% Duplication

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.

4 participants