Skip to content
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 measure APIs from amp-auto-lightbox #33663

Merged
merged 4 commits into from
Apr 7, 2021

Conversation

dvoytenko
Copy link
Contributor

@dvoytenko dvoytenko commented Apr 6, 2021

Partial for #31540.
Partial for #33678.

This blocks #33649.

* @param {!Element} element
* @return {!Promise<!ClientRect>}
*/
export function measure(ampdoc, element) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we promote this to src/dom.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, was going to comment on that and forgot. @samouri has already created src/utils/intersection and I can reuse that. The only nit is that the src/utils/intersection uses an IntersectionObserver{root:document}, which triggers the polyfill path in more cases than a simple {root:null} that I do here. So I wasn't sure if it's worth reusing the existing util or rolling this as a single-use utility for the extension. LMK what you think.

Copy link
Member

@samouri samouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with whichever way you decide:

  1. Add a TODO comment re. merging the helper with measureIntersection once iOS support for document as root improves
  2. and/or promoting the helper to a utils area

@dvoytenko
Copy link
Contributor Author

I'm okay with whichever way you decide:

  1. Add a TODO comment re. merging the helper with measureIntersection once iOS support for document as root improves
  2. and/or promoting the helper to a utils area

I did both: promoted it to src/utils and left a TODO(#33678) to cleanup utils once the IntersectionObserver{root:document} is better supported.

@dvoytenko dvoytenko merged commit d71ab50 into ampproject:master Apr 7, 2021
@dvoytenko dvoytenko deleted the run3/measure/auto-lightbox branch April 7, 2021 18:26
rochapablo pushed a commit to rochapablo/amphtml that referenced this pull request Aug 30, 2021
* Remove measure APIs from amp-auto-lightbox

* fix presubmits

* moved measurer to src/utils

* lints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants