Skip to content

Commit

Permalink
Updating the <Picture /> component to default to async image decoding (
Browse files Browse the repository at this point in the history
…#3876)

* defaulting pictures to use decoding=async

* chore: add changeset
  • Loading branch information
Tony Sullivan committed Jul 9, 2022
1 parent 1785e56 commit f961412
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-bananas-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/image': patch
---

Bug: Updating the <Picture /> component to default to async image decoding
2 changes: 1 addition & 1 deletion packages/integrations/image/components/Picture.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface RemoteImageProps extends Omit<PictureAttributes, 'src' | 'width
export type Props = LocalImageProps | RemoteImageProps;
const { src, sizes, widths, aspectRatio, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'eager', ...attrs } = Astro.props as Props;
const { src, sizes, widths, aspectRatio, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'async', ...attrs } = Astro.props as Props;
const { image, sources } = await getPicture({ loader, src, widths, formats, aspectRatio });
---
Expand Down

0 comments on commit f961412

Please sign in to comment.