-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(image-jsx): automatic compression and transcoding for AVIF, WebP… #6161
base: main
Are you sure you want to change the base?
Conversation
…, and original formats Provides smaller image formats while ensuring proper display on low-end devices.
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.
The idea is good but then you also need to change the jsx output so that it uses <picture>
instead of <img>
, because srcset doesn't let you tell the browser what the type is
I'll work on implementing it and testing its effectiveness as soon as possible. Thanks for the reminder! |
3bec36a
to
9de4ac0
Compare
Is there anything else I need to do ? |
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
@wmertens is this ready? |
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.
This looks good, but:
- it is slightly breaking in terms of CSS, no? I'm not sure if this should wait for v2 or if a new major is enough. @PatrickJS ?
- it would be great if we had some unit tests of the output, just provide fake imagedata and show what the result should be.
if we have unit/e2e tests we should be fine |
I think we should make this configurable, and in V2 we enable it by default. So right now, by default keep the img output as-is, but allow avif with picture via a setting. What do you think @xhcy1314 ? |
I think this approach is reasonable. By making this feature configurable, we can introduce the new format without disrupting the current workflow. Enabling it by default in V2 will reduce the cognitive load on users, allowing them to focus on their business code. However, i need your suggestion on what to name this configuration key. |
@xhcy1314 how about this:
|
Okay, I need some time to tweak this part of the code. |
Automatic compression and transcoding for AVIF, WebP, and original formats.
Provides smaller image formats while ensuring proper display on low-end devices.
Overview
This commit enhances the image processing functionality. Now, the image tools automatically compress and transcode AVIF, WebP, and original formats, providing smaller image formats while ensuring proper display on low-end devices.
What is it?
Description
This commit enhances the image processing functionality. Now, the image tools automatically compress and transcode AVIF, WebP, and original formats. It provides smaller image formats while ensuring proper display on low-end devices. This improvement contributes to enhancing user experience, particularly for users with lower-performance devices.
Use cases and why
Checklist: