Skip to content

Adding image decoding#642

Merged
blittle merged 2 commits into
Shopify:2023-01from
rafaelstz:feature/decoding-img
Mar 13, 2023
Merged

Adding image decoding#642
blittle merged 2 commits into
Shopify:2023-01from
rafaelstz:feature/decoding-img

Conversation

@rafaelstz
Copy link
Copy Markdown
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

Comment thread templates/demo-store/.devcontainer/devcontainer.json Outdated
@rafaelstz rafaelstz force-pushed the feature/decoding-img branch from bcaf499 to f4c8762 Compare March 7, 2023 23:41
@juanpprieto
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants