diff --git a/.changeset/lazy-insects-wave.md b/.changeset/lazy-insects-wave.md new file mode 100644 index 000000000000..848984c4ff71 --- /dev/null +++ b/.changeset/lazy-insects-wave.md @@ -0,0 +1,8 @@ +--- +'astro': minor +--- + +Removes redundant `fetchpriority` attributes from the output of Astro’s `` component + +Previously, Astro would always include `fetchpriority="auto"` on images not using the `priority` attribute. +However, this is the default value, so specifying it is redundant. This change omits the attribute by default. diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 63fc02ee2b76..0b2bdfb5b729 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -141,7 +141,8 @@ export async function getImage( } else { resolvedOptions.loading ??= 'lazy'; resolvedOptions.decoding ??= 'async'; - resolvedOptions.fetchpriority ??= 'auto'; + // Omit fetchpriority to use the default `"auto"` value + resolvedOptions.fetchpriority ??= undefined; } if (layout !== 'none') { diff --git a/packages/astro/test/core-image-layout.test.js b/packages/astro/test/core-image-layout.test.js index f5fb7a058532..7dcb412c7926 100755 --- a/packages/astro/test/core-image-layout.test.js +++ b/packages/astro/test/core-image-layout.test.js @@ -56,7 +56,7 @@ describe('astro:image:layout', () => { let $img = $('#local img'); assert.equal($img.attr('loading'), 'lazy'); assert.equal($img.attr('decoding'), 'async'); - assert.equal($img.attr('fetchpriority'), 'auto'); + assert.equal($img.attr('fetchpriority'), undefined); }); it('includes priority loading attributes', () => { @@ -623,7 +623,7 @@ describe('astro:image:layout', () => { let $img = $('#local img'); assert.equal($img.attr('loading'), 'lazy'); assert.equal($img.attr('decoding'), 'async'); - assert.equal($img.attr('fetchpriority'), 'auto'); + assert.equal($img.attr('fetchpriority'), undefined); }); it('includes priority loading attributes', () => { diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 3abba276f1a9..1c0267a420f0 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -8,7 +8,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/integrations/cloudflare" }, "keywords": [ diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 80231316cfd6..30e5f1987f6b 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -8,7 +8,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/integrations/netlify" }, "keywords": [ diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 443252ecb77f..e382e962511b 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -8,7 +8,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/integrations/node" }, "keywords": [ diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index 28302d2943d3..c67413171258 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -7,7 +7,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/integrations/vercel" }, "keywords": [ diff --git a/packages/language-tools/astro-check/package.json b/packages/language-tools/astro-check/package.json index e6a351142bf1..e80888305f2f 100644 --- a/packages/language-tools/astro-check/package.json +++ b/packages/language-tools/astro-check/package.json @@ -7,12 +7,13 @@ "homepage": "https://github.com/withastro/astro/tree/main/packages/language-tools/astro-check", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/language-tools/astro-check" }, "type": "module", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": "./dist/index.js" + }, "bin": { "astro-check": "./bin/astro-check.js" }, diff --git a/packages/language-tools/language-server/package.json b/packages/language-tools/language-server/package.json index 24cba6cbcedb..bf597bb69a7c 100644 --- a/packages/language-tools/language-server/package.json +++ b/packages/language-tools/language-server/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/language-tools/language-server" }, "type": "commonjs", diff --git a/packages/language-tools/ts-plugin/package.json b/packages/language-tools/ts-plugin/package.json index eb5163ca6c28..b236b14ea1de 100644 --- a/packages/language-tools/ts-plugin/package.json +++ b/packages/language-tools/ts-plugin/package.json @@ -6,7 +6,7 @@ "type": "commonjs", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/language-tools/ts-plugin" }, "keywords": [ diff --git a/packages/language-tools/vscode/package.json b/packages/language-tools/vscode/package.json index 28b59d733598..5e816e0c1593 100644 --- a/packages/language-tools/vscode/package.json +++ b/packages/language-tools/vscode/package.json @@ -37,7 +37,7 @@ "main": "./dist/node/client.js", "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/language-tools/vscode" }, "contributes": { diff --git a/packages/language-tools/yaml2ts/package.json b/packages/language-tools/yaml2ts/package.json index fc7d12042b46..c20ad97d4ef7 100644 --- a/packages/language-tools/yaml2ts/package.json +++ b/packages/language-tools/yaml2ts/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/withastro/astro.git", + "url": "git+https://github.com/withastro/astro.git", "directory": "packages/language-tools/yaml2ts" }, "type": "commonjs",