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

Adding image decoding #642

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Conversation

rafaelstz
Copy link
Contributor

WHY are these changes introduced?

The decoding property is auto by default, but in order to improve the LCP and CLS scores we can use it as sync to prioritize it.
Introducing these changes, give the dev the possibility to use it in other image elements easier.

WHAT is this pull request doing?

Adding the decoding='sync' to Hero images and adding the decoding capability to the SpreadMedia component.

HOW to test your changes?

Through the Network tab, check the feels like during the loading, the prioritization, and the browser compatibilities.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@juanpprieto
Copy link
Contributor

@rafaelstz thanks for this contribution.

Could you please add a chageset by running npm run changeset at the root and selecting

  • create-hydrogen (affected package)
  • patch release (will be selected when you ignore major and minor releases options)
  • add a changeset message 🙏🏼

@rafaelstz
Copy link
Contributor Author

All set @juanpprieto

@blittle blittle merged commit ead686e into Shopify:2023-01 Mar 13, 2023
@github-actions github-actions bot mentioned this pull request Mar 13, 2023
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.

None yet

4 participants