-
Notifications
You must be signed in to change notification settings - Fork 326
Support optional priority prop on Image component
#1245
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
Conversation
loadingprop on Image componentloading prop on Image component
|
If we change Also, if you don't mind running @elisenyang FYI |
Co-authored-by: Michelle Vinci <[email protected]>
Co-authored-by: Michelle Vinci <[email protected]>
loading prop on Image componentpriority prop on Image component
The change has been made, documentation updated, and changelog added! |
|
Just enabled the CI checks to run; looks like Prettier is complaining. You should be able to run It may also be worth checking on your side of things if |
Co-authored-by: Michelle Vinci <[email protected]>
Co-authored-by: Michelle Vinci <[email protected]>
Strange, |
I think @mcvinci 's changes may have fixed the formatting issues. In any case, I had to approve the CI jobs to run again (I thought once approved they would keep going, but I guess not?) and if they pass I'll merge! |
|
Thank you @0x15f ! |
|
@0x15f Just a heads up, after thinking about it we decided that it didn't make sense to have a separate prop that does exactly what the HTML |
|
I agree 100%! After using the `priority` attribute for a couple of days
since it was merged, the name has been very confusing to a few people
internally here.
Best regards,
Jake Casto
Jake Casto
Chief Financial Officer
(646) 762-0645 <+16467620645>
***@***.***
*WARNING:* This e-mail and/or any files or attachments transmitted with it
are confidential and intended solely for the use of the individual or
entity to whom they are addressed, and may contain information that is
privileged, confidential, and exempt from disclosure under applicable law.
If you are not the intended recipient, or the employee or agent responsible
for delivering the message to the intended recipient, you are hereby
notified that any dissemination, distribution, or copying of this e-mail
and/or any files or attachments transmitted with it is strictly forbidden.
If you have received this e-mail in error, please delete the e-mail and/or
any files or attachments, and also notify the system manager of the error.
Please note that any views or opinions presented in this e-mail are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this e-mail and any attachments for the
presence of viruses. The company accepts no liability for any damage caused
by any virus transmitted by this e-mail and/or any files or attachments
transmitted with it.
…On Mon, May 16, 2022 at 12:51 PM Anthony Frehner ***@***.***> wrote:
@0x15f <https://github.com/0x15f> Just a heads up, after thinking about
it we decided that it didn't make sense to have a separate prop that does
exactly what the HTML loading attribute does, and it would be confusing
to have them both (e.g. what if they are set to different values? Why
deviate from the HTML spec? etc.). So in #1271
<Shopify/hydrogen#1271> I removed priority and
just had it be loading
—
Reply to this email directly, view it on GitHub
<https://github.com/Shopify/hydrogen/pull/1245#issuecomment-1127905342>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEFVWGSKXJ4XVY4PFCOVB4DVKJ4JLANCNFSM5VTALHBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
By default all
imgtags rendered using theImagecomponent provided by Hydrogen have aloadingattribute oflazy. This is not ideal for images that are above the fold as it can/will delay the FCP (image below)This pull request adds
loadingas a prop that can be passed to any image/media component with a fallback to the lazy default. Currently specifying this property usingpassThroughPropsresults in twoloadingattributes on theimgelement––the browser takes the first and lazily loads the image.This same functionality is covered (much better) by the proposal in #1223. However, Shopify is pushing Plus Merchants to build on Hydrogen prior to the production-ready rollout of the framework and this will/is affect(ing) anyone going to/already in production :).
Additional context
Before submitting the PR, please make sure you do the following:
fixes #123)yarn changeset addif this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning