🚀 [Story performance] Move open page attachment UI to extension#37278
Merged
mszylkowski merged 39 commits intoampproject:mainfrom Jan 12, 2022
Merged
🚀 [Story performance] Move open page attachment UI to extension#37278mszylkowski merged 39 commits intoampproject:mainfrom
mszylkowski merged 39 commits intoampproject:mainfrom
Conversation
|
Hey @gmajoulet, @newmuis! These files were changed: |
| @@ -94,14 +97,20 @@ const ctaLabelFromAttr = (element) => | |||
| * @param {?string} label | |||
| * @return {?string} | |||
| */ | |||
| const openLabelOrFallback = (element, attachmentEl, label) => | |||
| attachmentEl.tagName === 'AMP-STORY-SHOPPING-ATTACHMENT' | |||
| ? localize(element, LocalizedStringId_Enum.AMP_STORY_SHOPPING_CTA_LABEL) | |||
Contributor
There was a problem hiding this comment.
Why not use the localize helper?
Contributor
Author
There was a problem hiding this comment.
The localize helper is used inside amp-story because part of it is "instantiate a new LocalizationService if not instantiated already" (since the amp-story bundle has that service, it's free to do that in there). On extensions we don't want to add the service in the bundle, just fetch it from the document, so we can't use that localize helper or we would be bundling it into all the extensions that need it.
gmajoulet
approved these changes
Jan 10, 2022
This was referenced Jan 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the open page attachment UI (the "swipe up" button / hint) to the
amp-story-page-attachmentextension.Removes an extra 1.8kB of amp-story, and adds 2kB to amp-story-page-attachment.