From 83bd88ff8dfabb7b1958e2aff62b54c298b0707a Mon Sep 17 00:00:00 2001 From: Aden Margheriti Date: Tue, 3 Dec 2024 11:13:33 +1100 Subject: [PATCH 1/5] add support for webp and avif image formats --- packages/sku/config/webpack/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sku/config/webpack/utils/index.js b/packages/sku/config/webpack/utils/index.js index 05a583524..5e69d2297 100644 --- a/packages/sku/config/webpack/utils/index.js +++ b/packages/sku/config/webpack/utils/index.js @@ -13,6 +13,6 @@ module.exports = { resolvePackage, TYPESCRIPT: new RegExp(`\.(${extensions.ts.join('|')})$`), JAVASCRIPT: new RegExp(`\.(${extensions.js.join('|')})$`), - IMAGE: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/], + IMAGE: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.webp$/, /\.avif$/], SVG: /\.svg$/, }; From 8543a734796fac569f48cb83d65d00d67160f012 Mon Sep 17 00:00:00 2001 From: Aden Margheriti Date: Tue, 3 Dec 2024 11:30:52 +1100 Subject: [PATCH 2/5] document support for avif and webp --- docs/docs/extra-features.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/docs/extra-features.md b/docs/docs/extra-features.md index 409d39cc8..e1dd84049 100644 --- a/docs/docs/extra-features.md +++ b/docs/docs/extra-features.md @@ -3,7 +3,16 @@ ## Images The following images types are supported in sku: -`bmp`, `gif`, `jpeg`, `png` and `svg`. +`bmp`, `gif`, `jpeg`, `png`, `svg`, `webp` and `avif`. + +> Browser support for `webp` and `avif` varies. To ensure compatability across browsers, consider providing fallback image formats using the [`picture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) element. +> +> ```html +> +> +> +> +> ``` If you want to use a currently unsupported format feel free to submit a PR or contact #sku-support. From 85779541f65401be6a91d08c3a43afcbe35dee9e Mon Sep 17 00:00:00 2001 From: Aden Margheriti Date: Tue, 3 Dec 2024 13:25:19 +1100 Subject: [PATCH 3/5] reformat docs --- docs/docs/extra-features.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/docs/extra-features.md b/docs/docs/extra-features.md index e1dd84049..0c35fb0ce 100644 --- a/docs/docs/extra-features.md +++ b/docs/docs/extra-features.md @@ -5,14 +5,15 @@ The following images types are supported in sku: `bmp`, `gif`, `jpeg`, `png`, `svg`, `webp` and `avif`. -> Browser support for `webp` and `avif` varies. To ensure compatability across browsers, consider providing fallback image formats using the [`picture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) element. -> -> ```html -> -> -> -> -> ``` +?> Browser support for `webp` and `avif` varies. To ensure compatability across browsers, consider providing fallback image formats using the [`picture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) element. + +```html + + + + + +``` If you want to use a currently unsupported format feel free to submit a PR or contact #sku-support. From 2ed65e313c1763385ffc8aae59ae6b51069218f6 Mon Sep 17 00:00:00 2001 From: Aden Margheriti Date: Wed, 4 Dec 2024 10:14:41 +1100 Subject: [PATCH 4/5] add changeset --- .changeset/eighty-masks-hang.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/eighty-masks-hang.md diff --git a/.changeset/eighty-masks-hang.md b/.changeset/eighty-masks-hang.md new file mode 100644 index 000000000..63f20cb4d --- /dev/null +++ b/.changeset/eighty-masks-hang.md @@ -0,0 +1,6 @@ +--- +'sku': minor +--- +Add WebP and AVIF image format support to sku + +Added support for `webp` and `avif` image formats in, and updated documentation to include these formats in the list of supported image types. From 7a2ea670a052fa78f83a7aaa4c7b5af2eae3cc3d Mon Sep 17 00:00:00 2001 From: Aden Margheriti Date: Wed, 4 Dec 2024 10:47:24 +1100 Subject: [PATCH 5/5] update changeset --- .changeset/eighty-masks-hang.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/eighty-masks-hang.md b/.changeset/eighty-masks-hang.md index 63f20cb4d..466fd0f99 100644 --- a/.changeset/eighty-masks-hang.md +++ b/.changeset/eighty-masks-hang.md @@ -3,4 +3,4 @@ --- Add WebP and AVIF image format support to sku -Added support for `webp` and `avif` image formats in, and updated documentation to include these formats in the list of supported image types. +Support for `webp` and `avif` image formats has been added. Note that browser support for these formats may vary. To ensure compatibility across browsers, consumers are advised to use the `` element with fallback formats.