Skip to content

Commit 95cc203

Browse files
committed
feature #2813 [LazyImage] Deprecate the package (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [LazyImage] Deprecate the package | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #2732 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> I must admit my defeat here `@smnandre` and `@javiereguiluz`, you finally got me 😛 Commits ------- bd027c2 [LazyImage] Deprecate the package
2 parents c160eae + bd027c2 commit 95cc203

File tree

15 files changed

+45
-3
lines changed

15 files changed

+45
-3
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ jobs:
5151
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
5252
5353
# Swup and Typed have no tests, Turbo has its own workflow file
54-
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' ' ')
54+
EXCLUDED_PACKAGES="Typed|Swup|Turbo"
55+
56+
# Exclude deprecated packages when testing against lowest dependencies
57+
if [ "${{ matrix.dependency-version }}" = "lowest" ]; then
58+
EXCLUDED_PACKAGES="$EXCLUDED_PACKAGES|LazyImage"
59+
fi
60+
61+
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' ' ')
5562
echo "Packages: $PACKAGES"
5663
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
5764

src/LazyImage/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.27.0
4+
5+
- Deprecate the package
6+
37
## 2.17.0
48

59
- Add support for `intervention/image` 3.0+

src/LazyImage/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Symfony UX LazyImage
22

3+
> [!WARNING]
4+
> **Deprecated**: This package has been **deprecated** in 2.x and will be removed in the next major version.
5+
6+
The package has been deprecated in favor of [modern techniques to improve image loading performance](https://web.dev/learn/images/performance-issues) natively supported
7+
by all major browsers (`<img loading="lazy">`).
8+
9+
To keep using BlurHash functionality, you can use the package [kornrunner/php-blurhash](https://github.com/kornrunner/php-blurhash).
10+
11+
---
12+
313
Symfony UX LazyImage is a Symfony bundle providing utilities to improve
414
image loading performance. It is part of [the Symfony UX initiative](https://ux.symfony.com/).
515

src/LazyImage/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"php": ">=8.1",
3232
"symfony/config": "^5.4|^6.0|^7.0",
3333
"symfony/http-kernel": "^5.4|^6.0|^7.0",
34-
"symfony/dependency-injection": "^5.4|^6.0|^7.0"
34+
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
35+
"symfony/deprecation-contracts": "^2.5|^3"
3536
},
3637
"require-dev": {
3738
"intervention/image": "^2.5|^3.0",

src/LazyImage/doc/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Symfony UX LazyImage
77
`modern techniques to improve image loading performance`_ natively supported
88
by all major browsers.
99

10+
.. warning::
11+
12+
**Deprecated: This package has been deprecated in 2.x and will be removed in the next major version.**
13+
1014
Symfony UX LazyImage is a Symfony bundle providing utilities to improve
1115
image loading performance. It is part of `the Symfony UX initiative`_.
1216

src/LazyImage/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ini name="intl.error_level" value="0" />
1515
<ini name="memory_limit" value="-1" />
1616
<env name="SHELL_VERBOSITY" value="-1" />
17-
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
17+
<server name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=./tests/baseline-ignore&amp;max[self]=0&amp;max[direct]=0"/>
1818
</php>
1919

2020
<testsuites>

src/LazyImage/src/BlurHash/BlurHash.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use kornrunner\Blurhash\Blurhash as BlurhashEncoder;
1919
use Symfony\Contracts\Cache\CacheInterface;
2020

21+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
22+
2123
/**
2224
* @author Titouan Galopin <[email protected]>
2325
*

src/LazyImage/src/BlurHash/BlurHashInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\UX\LazyImage\BlurHash;
1313

14+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
15+
1416
/**
1517
* @author Titouan Galopin <[email protected]>
1618
*/

src/LazyImage/src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1515
use Symfony\Component\Config\Definition\ConfigurationInterface;
1616

17+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
18+
1719
/**
1820
* @author Hugo Alliaume <[email protected]>
1921
*

src/LazyImage/src/DependencyInjection/LazyImageExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use Symfony\UX\LazyImage\Twig\BlurHashExtension;
2626
use Symfony\UX\LazyImage\Twig\BlurHashRuntime;
2727

28+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
29+
2830
/**
2931
* @author Titouan Galopin <[email protected]>
3032
*

src/LazyImage/src/LazyImageBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Component\HttpKernel\Bundle\Bundle;
1515

16+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
17+
1618
/**
1719
* @author Titouan Galopin <[email protected]>
1820
*

src/LazyImage/src/Twig/BlurHashExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Twig\Extension\AbstractExtension;
1515
use Twig\TwigFunction;
1616

17+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
18+
1719
/**
1820
* @author Titouan Galopin <[email protected]>
1921
*

src/LazyImage/src/Twig/BlurHashRuntime.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Symfony\UX\LazyImage\BlurHash\BlurHashInterface;
1515
use Twig\Extension\RuntimeExtensionInterface;
1616

17+
trigger_deprecation('symfony/ux-lazy-image', '2.27.0', 'The package is deprecated and will be removed in 3.0.');
18+
1719
/**
1820
* @author Hugo Alliaume <[email protected]>
1921
*/

src/LazyImage/tests/baseline-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
%Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%

ux.symfony.com/tests/baseline-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
%Since symfony/ux-typed 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%
2+
%Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.%

0 commit comments

Comments
 (0)