Skip to content

🚀 Dont autogenerate sizes if the ssr image contains sizes already, or is ssr'd using a transformer#32647

Merged
kristoferbaxter merged 3 commits intoampproject:masterfrom
kristoferbaxter:ssr-sizes
Feb 16, 2021
Merged

🚀 Dont autogenerate sizes if the ssr image contains sizes already, or is ssr'd using a transformer#32647
kristoferbaxter merged 3 commits intoampproject:masterfrom
kristoferbaxter:ssr-sizes

Conversation

@kristoferbaxter
Copy link
Copy Markdown
Contributor

Fixes #32644.

@kristoferbaxter kristoferbaxter changed the title 🚀 Dont autogenerate sizes if the ssr image contains sizes already 🚀 Dont autogenerate sizes if the ssr image contains sizes already, or is ssr'd using a transformer Feb 12, 2021
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Copy link
Copy Markdown
Contributor

@rcebulko rcebulko left a comment

Choose a reason for hiding this comment

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

bundle size

@kristoferbaxter
Copy link
Copy Markdown
Contributor Author

From Slack conversation with @lannka and @powerivq:

"Ads never generate these things (srcset/sizes) on ssr'ed img tag."

@kristoferbaxter kristoferbaxter merged commit 11b1fca into ampproject:master Feb 16, 2021
Copy link
Copy Markdown
Contributor

@lannka lannka left a comment

Choose a reason for hiding this comment

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

sorry being late. the change looks good to me

@kristoferbaxter kristoferbaxter deleted the ssr-sizes branch February 16, 2021 17:25
@dvoytenko
Copy link
Copy Markdown
Contributor

Hi all! Sorry for delay. I was OOO. If I'm reading this right, this will disable sizes generation in cached pages. Not sure if that's what you were going for? If we want to do this, IMHO, we might as well remove the concept sizes-generation entirely from the amp-img.

@kristoferbaxter
Copy link
Copy Markdown
Contributor Author

kristoferbaxter commented Feb 16, 2021

If I'm reading this right, this will disable sizes generation in cached pages.

This will only disable automatic sizes generation.

In general: agree with removing the concept, if we can prove its non-breaking.

@dvoytenko
Copy link
Copy Markdown
Contributor

In general: agree with removing the concept, if we can prove its non-breaking.

To confirm: this PR does just that - disables automatic sizes generation for cached pages. Is that right?

@kristoferbaxter
Copy link
Copy Markdown
Contributor Author

It removes the auto-generation for images with the attribute i-amphtml-ssr.

I am quite nervous about the backward compatibility, asked here: https://github.com/ampproject/amphtml/pull/32647/files#r575565890.

@dvoytenko
Copy link
Copy Markdown
Contributor

There's pretty much my question as well. The i-amphtml-ssr, I think, will be produced for most of amp-img tags on cache.

@sebastianbenz
Copy link
Copy Markdown
Contributor

Afaik it'll only be generated for server-side generated img elements, which currently only happens for ads and in AMP Optimizer. AMP caches only render the layout, but not the actual img element and don't set the I-amphtml-ssr flag.

@dvoytenko
Copy link
Copy Markdown
Contributor

/cc @jridgewell to confirm in which cases we render img and i-amphtml-ssr.

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.

amp-img ssr: don't generate sizes attribute

9 participants