diff options
author | 2022-07-09 18:44:31 +0000 | |
---|---|---|
committer | 2022-07-09 18:44:31 +0000 | |
commit | f9614128622583cba6f65cb4202d56a71b4269a3 (patch) | |
tree | 29541ce76c1825f41ec94c86c89bb58d72870246 | |
parent | 1785e568a003a38b17fb5584dedab4e6143a9b3c (diff) | |
download | astro-f9614128622583cba6f65cb4202d56a71b4269a3.tar.gz astro-f9614128622583cba6f65cb4202d56a71b4269a3.tar.zst astro-f9614128622583cba6f65cb4202d56a71b4269a3.zip |
Updating the <Picture /> component to default to async image decoding (#3876)
* defaulting pictures to use decoding=async
* chore: add changeset
-rw-r--r-- | .changeset/quiet-bananas-obey.md | 5 | ||||
-rw-r--r-- | packages/integrations/image/components/Picture.astro | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/quiet-bananas-obey.md b/.changeset/quiet-bananas-obey.md new file mode 100644 index 000000000..42ed93312 --- /dev/null +++ b/.changeset/quiet-bananas-obey.md @@ -0,0 +1,5 @@ +--- +'@astrojs/image': patch +--- + +Bug: Updating the <Picture /> component to default to async image decoding diff --git a/packages/integrations/image/components/Picture.astro b/packages/integrations/image/components/Picture.astro index ed2cfd49e..fb1f1e2bd 100644 --- a/packages/integrations/image/components/Picture.astro +++ b/packages/integrations/image/components/Picture.astro @@ -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 }); --- |