You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anything you'd like to highlight / discuss:
In the issue description, it was mentioned that the height/width resolution might have to be moved accordingly. I tried a few examples and it seems to work as normal on my side. Is this concern regarding the computeWidth function? From what I googled online, the images are loaded once it reaches calculated distance from the viewport. (Source: https://web.dev/browser-level-image-lazy-loading/) Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Adopt lazy loading for Pic component
Checklist: ☑️
Updated the documentation for feature additions and enhancements
Is this concern regarding the computeWidth function? From what I googled online, the images are loaded once it reaches calculated distance from the viewport. (Source: https://web.dev/browser-level-image-lazy-loading/)
Thanks for investigating this. My concern was indeed around whether naturalWidth / Height would be populated correctly or at all if using the lazy attribute. Good to hear its unfounded 😀
Other than that, wondering if we should document that lazy loading is used by default and provide a simple prop to disable this behaviour. Sometimes it might be preferable to load all the images in the document in one go for better ux.
Other than that, wondering if we should document that lazy loading is used by default and provide a simple prop to disable this behaviour. Sometimes it might be preferable to load all the images in the document in one go for better ux.
Sounds good to me! WDYT about adding a eager prop if user wants to load images eagerly?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Resolves #1559
Overview of changes:
Use
loading=lazyattribute to defer loading of images for Pic componentsImage is only loaded lazily as seen in the video
https://user-images.githubusercontent.com/60393696/124390276-5bde0880-dd1d-11eb-9cc9-f972f4995ad0.mp4
Anything you'd like to highlight / discuss:
In the issue description, it was mentioned that the height/width resolution might have to be moved accordingly. I tried a few examples and it seems to work as normal on my side. Is this concern regarding the
computeWidthfunction? From what I googled online, the images are loaded once it reaches calculated distance from the viewport. (Source: https://web.dev/browser-level-image-lazy-loading/)Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Adopt lazy loading for Pic component
Checklist: ☑️