-
Notifications
You must be signed in to change notification settings - Fork 4k
🚀 [Story embeds] Remove support for expanded components like amp-twitter #36851
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
Conversation
Hey @gmajoulet, @newmuis! These files were changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still things that could be simplified further (e.g. we don't have embedded components anymore, just links) but that's an awesome first step, thank you!
The Intent to deprecate and remove: #36353 Can you test a few real world Stories and make sure their layouts are good and unchanged (cf failing Percy tests)? recipe 538052 |
We still do, and we need to click shield them + add their tooltips. This PR removes the expanded states though.
Tested the most common stories / domains and they don't break the layout |
@gmajoulet in more detail, currently interactive (expandable) tweets are re-scaled so they have This means by removing this code, we can effectively make interactive and non-interactive tweets consistently behave, and without the weird scaling, the tweets still occupy the same space as before, but now using the This is preferred and reduces the bundle size significantly, so we're moving forward with the merge. |
Closes #36353
Removes the expanded view used in amp-twitter. Uses linking instead (shows tooltip that links to the tweet).
This will allow us to get rid of a significant portion of unused code from
amp-story
, given that we will not be using the expanded view for other embedded components, and focusing on embedding interactive iframes in page attachments.Removes 8kB of uncompressed, and 1.4kB compressed
The tweet URL is
https://twitter.com/_/status/<tweet_id>
. Where the_
goes there should appear the username, but we don't want to make an API request to find that out, so we can "abuse" the fact that tweet_ids are unique and the website redirects to the correct username on load.Reference: https://blog.twitter.com/developer/en_us/topics/tips/2020/getting-to-the-canonical-url-for-a-tweet