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

Deprecate "owners" system #28042

Closed
dreamofabear opened this issue Apr 27, 2020 · 7 comments
Closed

Deprecate "owners" system #28042

dreamofabear opened this issue Apr 27, 2020 · 7 comments

Comments

@dreamofabear
Copy link

Follow-up to #25428.

Once resource scheduling with IntersectionObserver is stable, we should be able to simplify/remove owners-interface.js/owners-impl.js, and usages in extension code.

Should have a minor performance benefit. Curious how much of a binary size code reduction we'd get from ripping it out.

Also, there are probably other codepaths that can eventually be removed as well, e.g. hidden-observer-impl.js.

@newmuis
Copy link
Contributor

newmuis commented Apr 27, 2020

What happens for cases where extensions need ownership that's not based on viewport intersection?

@dreamofabear
Copy link
Author

Hm, can you share details of these?

/cc @ampproject/wg-runtime

@newmuis
Copy link
Contributor

newmuis commented Apr 27, 2020

I think we might (or, perhaps, should) have both:

(a) Elements that are on the screen but we want to artificially delay their layout (e.g. to mitigate race conditions between components)
(b) Elements that are not on the screen but we want to force into their lifecycle early (e.g. to do custom preloading that is not managed by the runtime)

It's good for us to have semantic control over this rather than having to trick the runtime into loading things by figuring out the "right" coordinates for something, even when those coordinates don't actually make sense for display.

/cc @ampproject/wg-stories

@dreamofabear
Copy link
Author

I think a configuration API to tweak the eagerness/laziness of resource loading could make sense. Please share any concrete use cases you have in mind.

@gmajoulet
Copy link
Contributor

Most of our use cases would be fixed by the new intersection observer methods (nested scrollboxes).
There is one cause where we use the owners system to pause an AMP component as we navigate to the next page. We could apply a display: none; and wait for the runtime to automatically pause it, but having a way to control this programmatically makes more sense.

This falls into the same category that Jon described:

It's good for us to have semantic control over this rather than having to trick the runtime into loading things by figuring out the "right" coordinates

@dreamofabear
Copy link
Author

I actually think pause/resume is unaffected by owners (there's just an extra API for it in owners-interface.js), so we should be ok.

First-class support for "pausing videos beyond viewport distance X" would be possible with IntersectionObserver and seems better than status quo. :)

@stale
Copy link

stale bot commented Nov 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Nov 29, 2021
@stale stale bot closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants