-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Introduce responsive-images to teams page #769
Conversation
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.
Hi, @simonihmig. Thank you for working on updating ember-responsive-image
and adding features.
I think it's a good idea to try out the addon in Teams page. I have a few questions before we merge the pull request:
-
Percy snapshot seems to indicate that there's no guarantee which images have started or finished loading when the snapshot is taken.
Is it possible to pursue one of these approaches?
- Update the configuration in
ember-cli-build.js
to load images as usual intesting
environment (perhaps pass an empty array to theinclude
option intesting
) - Have the addon tell us when the image has finished loading (perhaps expose the
isLoaded
tracked property as a data attribute, or provide a test helper?) - Some other solution
- Update the configuration in
-
Can you update the addon to import
htmlSafe
from@ember/template
instead of@ember/string
? The latter syntax is planned for deprecation. -
Could you address linting errors (missing commas)?
Hm, this is weird. If you look closely at percy's snapshot, you will see the "broken image" icon in the top left corner (it's clipped due to the border-radius of the parent element). This is indicating that the images could not be loaded, rather than that it is still loading! 🤔 Not sure what's going on there. I can see no issues when manually visiting the page in Firefox (seems that's what percy is using here). I don't know percy really, can you somehow see details, like the console output, or network failures (404s)?
That's not possible. Using an image with
It is not really doing much here. The load event is just used to remove the blurry background. Other than that, it is behaving just like a static But again, as said above, it seems more than something is failing to load somehow...
Oh, thanks, didn't know this. Will do as part of the next release!
Done. |
@simonihmig Thank you for addressing my feedback quickly. I will have a look at what's going on with the Percy snapshot tomorrow, see if there's something that we can do from this repo's side. |
Just found another issue: the LQIP is not rendered in FastBoot (as it uses a modifier), which is where you want it the most. 🙈 Good to have some real world testing, guess this need still a bit more work... |
@simonihmig Okay, let us know when the pull request is ready for review again. I will convert the PR to draft mode in the meantime. |
@ijlee2 I worked over the weekend on the FastBoot related parts (simonihmig/responsive-image#162 and simonihmig/responsive-image#172), which should fix that issue. The other issue regarding Percy remains though, and I am not sure how to proceed here, as I have no experience with percy. Do you know it well enough, or someone else on the team? E.g. can we see browser logs somewhere, or run it locally? I just looked at the netlify preview deployment. When starting from another page (say index), throttling bandwidth (in dev tools) to slow 3G, and then navigation to the teams page, you will see the blurry placeholder rendered correctly: So the broken image icon you see in those percy snapshots is not present. Which indicates that something in percy is behaving differently (than locally or on netlify). |
@simonihmig Yep, I can help out with Percy. |
d8b0376
to
7012931
Compare
Causes false negatives in percy.io tests
a80e4fe
to
696f18f
Compare
@ijlee2 thanks for the one-on-one today! So I was still not able to reproduce this locally, but at least I was able to get closer to the root issue. It seems that Firefox is trying to load the AVIF files. Only the very latest FF version has actually AVIF support, though I had to enable it using an And something goes wrong there. I disabled AVIF to test this out, and indeed the snapshot then looks as expected! And as I mentioned already, it is definitely not related to any async network timing issues. Now sure why this happens only in CI, not locally. One possible explanation could be that the MIME-type for .avif files is not correctly configured for the local static file server that ember-cli uses, as AVIF files are served as I did try this out locally though - running the same For now I only enable AVIF file generation in a production build. This fixes the percy issue. It still reports a visual change, but this time there are just some little changed nuances in the images, due to the modified images (scaled properly, and using WebP). I'll keep this in draft mode for now, as I still have to release a new addon version with the latest FastBoot optimizations. |
@simonihmig Thank you for investigating what happened in the Percy snapshot. It was certainly an unexpected issue and I'm glad that you figured out what happened. Yep, minor pixel differences due to a change in algorithm is not a problem. I'll attach a screenshot of Percy's debug log below for posterity. |
Updated this to the just released stable version of the addon. This improves a bunch of things, some of which were mentioned above. The addon now also does not generate AVIF files by default anymore, as they increase the build time considerably (given enough (large) images), and browser support is still limited to Chrome. So the percy issue should hopefully not happen anymore, even without the previous workaround. We might enable AVIF later, as soon as this seams reasonable (faster AVIF processing is supposed to be coming to Ready for review! |
The percy failure is just some noise in the images again, but not sure what's wrong with the linting: also there is just one linting job defined, it shows up twice here: one passing, and one failing without any logs!? 😕 |
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.
Looks good, I look forward to see what other things in the website can be improved with ember-responsive-image
. I reran the CI, which removed the duplicate the lint check.
Following up on ember-learn#769 this makes the mascots page also use responsive images.
Following up on ember-learn#769 this makes the mascots page also use responsive images.
* Make Mascots images responsive Following up on #769 this makes the mascots page also use responsive images. * Fix responsive mascot images
I have worked over the past weeks on a complete overhaul of https://github.com/kaliber5/ember-responsive-image, which brings a number of exciting new features, like support for next-gen image formats (WebP, AVIF), LQIP, and much more. See the Readme for more details. Introducing this addon has already been discussed in #184, now with the improved feature set this makes even more sense IMO. I wanted to test this out in some real apps before releasing a stable v2, so here we go...
I chose to start with the teams page, as this was most straightforward to start with (all images have a fixed, static size). But if you folks agree on this, we can roll this out step by step to other pages as well...
This makes sure that the images files all have a width of 100px (200px for retina screens), will be served as AVIF, WebP or JPEg (whatever the client supports), and have a nice Blurhash based Low Quality Image Placeholder (LQIP) while (lazily) loading, and few more improvements, see the addon's Readme.
This should improve a bunch of image-related Lighthouse metrics (I saw that you have LHCI setup, which is nice, but it seems only the entry page is measured).
Before:
After:
(no idea what that warning means!?)
Here's a little screen capture how the lazy loading with LQIP will look like (simulating slow 3G). You can see that on my machine (MBP Chrome), AVIF files with 200px (
2x
) are lazily loaded...Kapture.2021-02-20.at.13.22.02.mp4
/cc @mansona