Skip to content
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

Deprecate PreloadHeroImage for OptimizeHeroImages #262

Merged
merged 9 commits into from Jun 30, 2021

Conversation

schlessera
Copy link
Collaborator

@schlessera schlessera commented Jun 26, 2021

This PR adds a new OptimizeHeroImages transformer and deprecates the PreloadHeroImage transformer for it.

The PreloadHeroImage transformer now produces a deprecation error and then forward the transform() call to the new OptimizeHeroImages transformer. This should provide a clean upgrade path for current consumers without breaking things.

Note that we still keep the constants within PreloadHeroImage around, as they were not marked as private for lack of language support at PHP 5.6+ and third-party code might thus directly reference them.

Fixes #55

@schlessera schlessera added this to the 0.6.0 milestone Jun 26, 2021
Copy link
Collaborator

@ediamin ediamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

src/Optimizer/Transformer/OptimizeHeroImages.php Outdated Show resolved Hide resolved
src/Optimizer/Transformer/OptimizeHeroImages.php Outdated Show resolved Hide resolved
src/Optimizer/Transformer/OptimizeHeroImages.php Outdated Show resolved Hide resolved
@schlessera schlessera force-pushed the add/55-optimize-hero-images-transformer branch from af51a46 to 9f5be3d Compare June 30, 2021 14:46
@schlessera schlessera merged commit 4bd2dd2 into main Jun 30, 2021
@schlessera schlessera deleted the add/55-optimize-hero-images-transformer branch June 30, 2021 15:16
pierlon pushed a commit to pierlon/amp-wp that referenced this pull request Aug 15, 2021
dritter added a commit to dritter/amp-toolbox-php that referenced this pull request Aug 31, 2021
As PreloadHeroImages is deprecated (see ampproject#262)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt PreloadHeroImages to support new OptimizeHeroImage configuration arguments
3 participants