-
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
✨[amp-story-player] Upgrading amp-story-player to CE #27320
Conversation
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.
Asking questions because I don't know much about CustomElements! :(
@jridgewell could you please help reviewing this PR, since I don't have much experience using CEs and I'm not sure if I'm doing something wrong 😄 |
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.
Whoops, didn't mean to approve
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.
PTAL
Friendly ping @gmajoulet @jridgewell |
This LGTM, but I'll let @jridgewell give the approval as he understands this code a lot better than I do :) |
@jridgewell friendly ping :) |
bumping this up for @jridgewell |
I've been OOO. Sorry for the delay. |
No worries @jridgewell, thanks for taking a look! @newmuis could you PTAL? |
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.
This mostly LGTM. Approving to unblock.
Quick question @jridgewell: does Closure compiler not do anything to wrap private methods in a closure or something? Also, won't these member and function names all be minified? If so, should we keep the _
as a trailing suffix to match the Prettier rules and the rest of the repository?
This isn't possible for objects without considerable memory increases (every object must close over its functions and variables). This is generally frowned upon.
They should. We should check.
Oh, in that case, yah, why not just use trailing and let the mangler make them "private"? |
This reverts commit 3118d00c06085d325f1c40d5a3d462e3f24e70e9.
… each player responsible to call them individually.
Reverted the commit that changed the trailing underscore to a suffix for private properties (we'll use the trailing |
Could/should we move the source into its own directory? I find it a bit weird to see it mixed with core AMP. |
On the original design and at the time of launch we thought it was appropriate for it to live in the AMPHTL repo, especially since we plan on developing an AMP version of it as well. This way we could leverage the existing tools and infra of the repo, while potentially sharing tests between the two versions since the goal is to have an identical API. Recently, it has been brought to us that users could potentially benefit from this becoming a standalone package that could be installed via npm. This would require moving this to its own repo, I have filed #27615 to track this and tackle it when appropriate. |
Does it really have to be its own repo? Wouldn't a directory with its own package.json work? I was simply making a point about code-organization and not having a single mega-directory here. |
Oh, my bad. Yes we should be able to move it to its own directory. |
Changing the player to use
CustomElements
. This will help us open up an API for the player.load
event listener in the window to initialize the player, instead of overriding theonload
function.Tracker #26308
To be merged after #27324