diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml
index 7891d8c39a2..2d0d8b52b95 100644
--- a/.github/workflows/unit-tests.yaml
+++ b/.github/workflows/unit-tests.yaml
@@ -51,7 +51,14 @@ jobs:
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
# Swup and Typed have no tests, Turbo has its own workflow file
- PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "Swup|Turbo|Typed" | sort | tr '\n' ' ')
+ EXCLUDED_PACKAGES="Typed|Swup|Turbo"
+
+ # Exclude deprecated packages when testing against lowest dependencies
+ if [ "${{ matrix.dependency-version }}" = "lowest" ]; then
+ EXCLUDED_PACKAGES="$EXCLUDED_PACKAGES|LazyImage"
+ fi
+
+ PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "$EXCLUDED_PACKAGES" | sort | tr '\n' ' ')
echo "Packages: $PACKAGES"
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
diff --git a/src/LazyImage/CHANGELOG.md b/src/LazyImage/CHANGELOG.md
index bb989a0eee0..7a27e2ba7fe 100644
--- a/src/LazyImage/CHANGELOG.md
+++ b/src/LazyImage/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## 2.27.0
+
+- Deprecate the package
+
## 2.17.0
- Add support for `intervention/image` 3.0+
diff --git a/src/LazyImage/README.md b/src/LazyImage/README.md
index 8a771c401dd..2578b75bfac 100644
--- a/src/LazyImage/README.md
+++ b/src/LazyImage/README.md
@@ -1,5 +1,15 @@
# Symfony UX LazyImage
+> [!WARNING]
+> **Deprecated**: This package has been **deprecated** in 2.x and will be removed in the next major version.
+
+The package has been deprecated in favor of [modern techniques to improve image loading performance](https://web.dev/learn/images/performance-issues) natively supported
+by all major browsers (`
`).
+
+To keep using BlurHash functionality, you can use the package [kornrunner/php-blurhash](https://github.com/kornrunner/php-blurhash).
+
+---
+
Symfony UX LazyImage is a Symfony bundle providing utilities to improve
image loading performance. It is part of [the Symfony UX initiative](https://ux.symfony.com/).
diff --git a/src/LazyImage/composer.json b/src/LazyImage/composer.json
index b964763c412..f15a99eda48 100644
--- a/src/LazyImage/composer.json
+++ b/src/LazyImage/composer.json
@@ -31,7 +31,8 @@
"php": ">=8.1",
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0"
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/deprecation-contracts": "^2.5|^3"
},
"require-dev": {
"intervention/image": "^2.5|^3.0",
diff --git a/src/LazyImage/doc/index.rst b/src/LazyImage/doc/index.rst
index 89126924ff6..fd767d0024e 100644
--- a/src/LazyImage/doc/index.rst
+++ b/src/LazyImage/doc/index.rst
@@ -7,6 +7,10 @@ Symfony UX LazyImage
`modern techniques to improve image loading performance`_ natively supported
by all major browsers.
+.. warning::
+
+ **Deprecated: This package has been deprecated in 2.x and will be removed in the next major version.**
+
Symfony UX LazyImage is a Symfony bundle providing utilities to improve
image loading performance. It is part of `the Symfony UX initiative`_.
diff --git a/src/LazyImage/phpunit.xml.dist b/src/LazyImage/phpunit.xml.dist
index ba15dfc214b..8fe2e0f23dc 100644
--- a/src/LazyImage/phpunit.xml.dist
+++ b/src/LazyImage/phpunit.xml.dist
@@ -14,7 +14,7 @@
-
+
diff --git a/src/LazyImage/src/BlurHash/BlurHash.php b/src/LazyImage/src/BlurHash/BlurHash.php
index 447a6f4f9eb..6778e029f0d 100644
--- a/src/LazyImage/src/BlurHash/BlurHash.php
+++ b/src/LazyImage/src/BlurHash/BlurHash.php
@@ -18,6 +18,8 @@
use kornrunner\Blurhash\Blurhash as BlurhashEncoder;
use Symfony\Contracts\Cache\CacheInterface;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Titouan Galopin
*
diff --git a/src/LazyImage/src/BlurHash/BlurHashInterface.php b/src/LazyImage/src/BlurHash/BlurHashInterface.php
index c4ac1d7f47b..aaad364b580 100644
--- a/src/LazyImage/src/BlurHash/BlurHashInterface.php
+++ b/src/LazyImage/src/BlurHash/BlurHashInterface.php
@@ -11,6 +11,8 @@
namespace Symfony\UX\LazyImage\BlurHash;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Titouan Galopin
*/
diff --git a/src/LazyImage/src/DependencyInjection/Configuration.php b/src/LazyImage/src/DependencyInjection/Configuration.php
index 4c2fd632a33..9e4927d674e 100644
--- a/src/LazyImage/src/DependencyInjection/Configuration.php
+++ b/src/LazyImage/src/DependencyInjection/Configuration.php
@@ -14,6 +14,8 @@
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Hugo Alliaume
*
diff --git a/src/LazyImage/src/DependencyInjection/LazyImageExtension.php b/src/LazyImage/src/DependencyInjection/LazyImageExtension.php
index ccddfd34d9a..52405f71bbb 100644
--- a/src/LazyImage/src/DependencyInjection/LazyImageExtension.php
+++ b/src/LazyImage/src/DependencyInjection/LazyImageExtension.php
@@ -25,6 +25,8 @@
use Symfony\UX\LazyImage\Twig\BlurHashExtension;
use Symfony\UX\LazyImage\Twig\BlurHashRuntime;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Titouan Galopin
*
diff --git a/src/LazyImage/src/LazyImageBundle.php b/src/LazyImage/src/LazyImageBundle.php
index b222a688e05..b39725c98a8 100644
--- a/src/LazyImage/src/LazyImageBundle.php
+++ b/src/LazyImage/src/LazyImageBundle.php
@@ -13,6 +13,8 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Titouan Galopin
*
diff --git a/src/LazyImage/src/Twig/BlurHashExtension.php b/src/LazyImage/src/Twig/BlurHashExtension.php
index 5ac2f3b520f..1b31a2331d3 100644
--- a/src/LazyImage/src/Twig/BlurHashExtension.php
+++ b/src/LazyImage/src/Twig/BlurHashExtension.php
@@ -14,6 +14,8 @@
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Titouan Galopin
*
diff --git a/src/LazyImage/src/Twig/BlurHashRuntime.php b/src/LazyImage/src/Twig/BlurHashRuntime.php
index 49d931cab8b..25a96466847 100644
--- a/src/LazyImage/src/Twig/BlurHashRuntime.php
+++ b/src/LazyImage/src/Twig/BlurHashRuntime.php
@@ -14,6 +14,8 @@
use Symfony\UX\LazyImage\BlurHash\BlurHashInterface;
use Twig\Extension\RuntimeExtensionInterface;
+trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
+
/**
* @author Hugo Alliaume
*/
diff --git a/src/LazyImage/tests/baseline-ignore b/src/LazyImage/tests/baseline-ignore
new file mode 100644
index 00000000000..8661cedc451
--- /dev/null
+++ b/src/LazyImage/tests/baseline-ignore
@@ -0,0 +1 @@
+%Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%
diff --git a/ux.symfony.com/tests/baseline-ignore b/ux.symfony.com/tests/baseline-ignore
index ed1c435d62e..b6c26bc279e 100644
--- a/ux.symfony.com/tests/baseline-ignore
+++ b/ux.symfony.com/tests/baseline-ignore
@@ -1 +1,2 @@
%Since symfony/ux-typed 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%
+%Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%