Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/lazy-insects-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'astro': minor
---

Removes redundant `fetchpriority` attributes from the output of Astro’s `<Image>` 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.
3 changes: 2 additions & 1 deletion packages/astro/src/assets/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/core-image-layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
7 changes: 4 additions & 3 deletions packages/language-tools/astro-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/language-tools/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/language-tools/ts-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/language-tools/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-tools/yaml2ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading