Skip to content

[LazyImage] Deprecate the package #2813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
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
9 changes: 8 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions src/LazyImage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.27.0

- Deprecate the package

## 2.17.0

- Add support for `intervention/image` 3.0+
Expand Down
10 changes: 10 additions & 0 deletions src/LazyImage/README.md
Original file line number Diff line number Diff line change
@@ -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 (`<img loading="lazy">`).

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/).

Expand Down
3 changes: 2 additions & 1 deletion src/LazyImage/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/LazyImage/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_.

Expand Down
2 changes: 1 addition & 1 deletion src/LazyImage/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ini name="intl.error_level" value="0" />
<ini name="memory_limit" value="-1" />
<env name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=./tests/baseline-ignore&amp;max[self]=0&amp;max[direct]=0"/>
</php>

<testsuites>
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/BlurHash/BlurHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/BlurHash/BlurHashInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*/
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/LazyImageBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/Twig/BlurHashExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/LazyImage/src/Twig/BlurHashRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*/
Expand Down
1 change: 1 addition & 0 deletions src/LazyImage/tests/baseline-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%
1 change: 1 addition & 0 deletions ux.symfony.com/tests/baseline-ignore
Original file line number Diff line number Diff line change
@@ -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\.%