-
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
Remove several getServiceForDoc() in extensions/* #22511
Remove several getServiceForDoc() in extensions/* #22511
Conversation
LiveListManager.forDoc(this.element).then(manager => { | ||
this.manager_ = manager; | ||
this.manager_.register(this.liveListId_, this); | ||
}); |
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.
@erwinmombay PTAL at amp-live-list code.
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.
As discussed, changes are needed to make sure that this delayed register
calls triggers polling.
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 fixed in 2491276.
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.
LGTM
'height': '1px', | ||
'overflow': 'hidden', | ||
'visibility': 'hidden', | ||
}); |
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.
@torch2424 PTAL at amp-recaptcha-input code.
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.
LGTM @choumx Thank you for this! 😄
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.
element, | ||
'position-observer' | ||
)); | ||
} |
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.
@zhouyx PTAL at PositionObserver usages above.
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.
sorry, missed the comment here. LGTM
/** | ||
* Returns a service to register callbacks we wish to execute when an | ||
* amp-form is submitted. | ||
* @param {!Element|!./service/ampdoc-impl.AmpDoc} elementOrAmpDoc | ||
* @return {!Promise<../extensions/amp-form/0.1/form-submit-service.FormSubmitService>} | ||
*/ | ||
static formSubmitPromiseForDoc(elementOrAmpDoc) { | ||
static formSubmitForDoc(elementOrAmpDoc) { |
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.
@cvializ PTAL at FormSubmitService usage above.
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.
It should be OK as it is above, since the amp-form extension registers the service. But to make it safe from future changes or races I think it would be better the save a reference to the Promise and then
it when a service reference is needed, like how the amp-analytics linker-manager.js
does it.
|
||
webPushServiceForDoc(this.element).then(service => { | ||
service.start(config).catch(() => {}); | ||
}); |
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.
@jasonpang PTAL at amp-web-push code.
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.
LGTM
/** | ||
* Returns a service to register callbacks we wish to execute when an | ||
* amp-form is submitted. | ||
* @param {!Element|!./service/ampdoc-impl.AmpDoc} elementOrAmpDoc | ||
* @return {!Promise<../extensions/amp-form/0.1/form-submit-service.FormSubmitService>} | ||
*/ | ||
static formSubmitPromiseForDoc(elementOrAmpDoc) { | ||
static formSubmitForDoc(elementOrAmpDoc) { |
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.
It should be OK as it is above, since the amp-form extension registers the service. But to make it safe from future changes or races I think it would be better the save a reference to the Promise and then
it when a service reference is needed, like how the amp-analytics linker-manager.js
does it.
* Fix fx-collection, next-page, position-observer, video-docking and web-push. * Fix test-live-list-manager.js. * Fix test-amp-user-notification. * Fix amp-recaptcha-service. * Remove sync formSubmitForDoc. * Fix types. * Fix types. * Fix test-amp-live-list.js. * Fix test-amp-recaptcha-input.js. * Add issue # to presubmit message. * Start live list polling on register(), if not already started. * Check this.poller_ instead of doc ready.
Partial for #22414. Removes synchronous service getter
getServiceForDoc
usage in extensions code.