-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🚀 [Story performance] Move building share menu to share-menu.js #37209
Merged
mszylkowski
merged 15 commits into
ampproject:main
from
mszylkowski:removeShare_buildMenu
Dec 20, 2021
Merged
🚀 [Story performance] Move building share menu to share-menu.js #37209
mszylkowski
merged 15 commits into
ampproject:main
from
mszylkowski:removeShare_buildMenu
Dec 20, 2021
Conversation
This file contains 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
Hey @gmajoulet, @newmuis! These files were changed:
|
gmajoulet
approved these changes
Dec 14, 2021
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.
Closes #37205
Closes #37204
Closes #29773
Contributes to I2I #37198
Moves all the logic, templates and styles necessary to create the Desktop (fallback) sharing menu into
amp-story-share-menu.js
, and creates the share menu when clicked on the share icon for the first time only (meaning it installsAmpSocialShare
also when clicked on the share icon for the first time).Removes unnecessary styles like
widget-scrollable
which is not used (I think it was used in bookends but not anymore).Functionality:
amp-story-share.js
bundled inamp-story-1.0.js
will take care of the native sharing, and determining whether we should build the fallback menu. To build the share menu it creates a host element and then callsnew AmpStoryShareMenu(hostEl)
, which will happen in the new extension once we split the bundles (by moving this line to the extension we will have split the share menu from the bundle, on follow-up PR). It takes care of analytics as well, so that native sharing and fallback sharing both report in the same way.amp-story-share-menu.js
is still bundled inamp-story-1.0.js
for now but it doesn't care about system sharing (if anAmpStoryShareMenu
is created, it will build and show). The share menu subscribes to the store service to know when to open/close and the desktop/mobile UI, and listens toESC
key events.