symfony / recipes

Symfony Recipes Repository
https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
MIT License
964 stars 476 forks source link

[UX LazyImage] Add initial recipe #1319

Closed Kocal closed 4 months ago

Kocal commented 4 months ago
Q A
License MIT
Doc issue/PR symfony/symfony-docs#...

Hi everyone, this PR adds the recipe for symfony/ux-lazy-image. It does not configure anything, instead it gives some hints about the bundle possibilities :)

github-actions[bot] commented 4 months ago

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1319/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1319/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/ux-lazy-image:^2.18'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

symfony/ux-lazy-image

2.17 vs 2.18 ```diff diff --git a/symfony/ux-lazy-image/2.17/config/packages/lazy_image.yaml b/symfony/ux-lazy-image/2.18/config/packages/lazy_image.yaml index c701d01..0ea8aa9 100644 --- a/symfony/ux-lazy-image/2.17/config/packages/lazy_image.yaml +++ b/symfony/ux-lazy-image/2.18/config/packages/lazy_image.yaml @@ -1,4 +1,9 @@ # lazy_image: + # By default, images are fetched through "file_get_contents" function, but you can use your own implementation + # with an invokable service or a callable. + # https://symfony.com/bundles/ux-lazy-image/current/index.html#customizing-images-fetching + # fetch_image_content: 'App\BlurHash\FetchImageContent' + # It is recommended to cache the generated BlurHash for performance reasons, to avoid generating it for each request. # https://symfony.com/bundles/ux-lazy-image/current/index.html#performance-considerations # cache: cache.lazy_image ```