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

Preload Hero images doesn't work after \ServerSideRendering #204

Closed
06romix opened this issue May 19, 2021 · 4 comments
Closed

Preload Hero images doesn't work after \ServerSideRendering #204

06romix opened this issue May 19, 2021 · 4 comments
Labels
Bug Something isn't working Optimizer SSR Related to the serverside rendering of the Optimizer

Comments

@06romix
Copy link
Contributor

06romix commented May 19, 2021

If used default sequence of transformers ServerSideRendering would move media attributes to custom CSS before Optimizer preload hero images.

Media attribute is removed in Transformer\ServerSideRendering::adaptBlockingAttributes()
And here we have check Transformer\PreloadHeroImage::generatePreload()

Should transformers have a different sequence?

@westonruter
Copy link
Member

It seems you're right. The PreloadHeroImage transformer is coming after ServerSideRendering:

const DEFAULT_TRANSFORMERS = [
AmpBoilerplate::class,
ServerSideRendering::class,
AmpRuntimeCss::class,
AmpBoilerplateErrorHandler::class,
TransformedIdentifier::class,
PreloadHeroImage::class,
RewriteAmpUrls::class,
ReorderHead::class,
OptimizeAmpBind::class,
];

@westonruter westonruter added Optimizer SSR Related to the serverside rendering of the Optimizer labels May 20, 2021
@schlessera
Copy link
Collaborator

Yes, indeed, we need to move PreloadHeroImage before ServerSideRendering.

I'm wondering if we also should have a lightweight mechanism to check ordering and throw warnings if inter-dependencies are not met, as people can freely re-arrange the transformers...

@06romix
Copy link
Contributor Author

06romix commented May 22, 2021

I've created request #209 for a fast fix and going to make order checking.

@schlessera
Copy link
Collaborator

First issue fixed via #209 and second issue superseded by #219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Optimizer SSR Related to the serverside rendering of the Optimizer
Projects
None yet
Development

No branches or pull requests

3 participants