-
Notifications
You must be signed in to change notification settings - Fork 4.1k
add private properties of base-element to amp.extern #3628
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
src/base-element.js
Outdated
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.
|
@cramforce PTAL. wasn't sure how to refer to the types in an extern, couldn't get the relative paths to the types to work. |
build-system/amp.extern.js
Outdated
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.
Why private properties?
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 will prevent closure compiler from renaming the properties. right now theres a chance that these properties if renamed will have a collision with a renamed property in the extension (symbol reuse).
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.
we're only really worried about BaseElement, since its the only code that travels across compilation units
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.
@dvoytenko This is special because the extensions subclass a class from a different compilation unit.
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.
I see. That's pretty annoying. So, actually, none of these vars are really needed there. We can easily delegate these methods to the element instance as most of methods do now. Not sure why I singled out these properties to be honest :)
|
LGTM |
src/base-element.js
Outdated
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.
nit: The warning art seems to be broken.
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.
haha i think its that way, i used the star wars font for it
No description provided.