Re: [webcomponents] Custom elements disconnected from a document should not be upgraded (#419)

> > You just need to spec a deterministic time for when the upgrade maps are cleared.
> I'm not sure this helps without a way to tell who is referencing the elements at this time, which seems equivalent to triggering a precise full GC at these times.

You don't tie to who is holding references. You spec something like "after the load event, clear the upgrade candidate map for all elements". Then you spec some way for authors to keep things alive in the map for longer, for example with waitUntil().

> > ex. How useful is upgrade after the load event as fired? Maybe we should turn that system off at that point?
> That seems like it would break lazy-loading of sections of pages along with their element definitions.

It means you might need to expose something like a waitUntil() promise on the registry. For example document.customElementRegistry.get("x-foo").waitUntil(promise) to deal with your lazy load. You're explicitly making it live in the upgrade map longer.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/419#issuecomment-193552543

Received on Tuesday, 8 March 2016 01:58:08 UTC