-
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
Refactor getElementPriority #3120
Conversation
77098a8
to
83604fb
Compare
@@ -109,6 +109,7 @@ import {vsyncFor} from './vsync'; | |||
* Each method is called exactly once and overriding them in subclasses | |||
* is optional. | |||
*/ | |||
|
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.
drop the line
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.
Done.
@@ -49,6 +49,11 @@ export function installAd(win) { | |||
|
|||
class AmpAd extends BaseElement { | |||
|
|||
/** @override */ | |||
getElementPriority() { | |||
return 2; |
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.
Please add something like
// loads ads after other content and analytics.
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.
Done.
Excellent, thanks! LGTM from me. Passing on to @mkhatib for final LGTM. |
@@ -27,6 +27,11 @@ export class ElementStub extends BaseElement { | |||
} | |||
|
|||
/** @override */ | |||
getPriority() { | |||
throw new Error('Cannot get priority of stubbed element'); |
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 is it ok to just through error like this here? No need to dev.assert it?
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 is fine. Both do very similar things and both we want to show up in our production error reporting, because they are not expected to actually happen.
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.
Cool! Thanks
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 not quite dev.assert
is DCE'd so it won't be in prod errors reporting. But, I agree, let's leave new Error()
here so that we actually do get the error.
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.
Cool
LGTM! Please rebase and wait for the tests to pass. |
LGTM |
cb3aa3f
to
9aa5f43
Compare
💃 💃 💃 💃 💃 💃 |
First commit? 🎆 🎊 👏 |
fixes #2714