You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah web components are asynchronous by design - there is WebComponentsReady event, similar to DOMReady, that you need to wait for before you can call methods on web components. See here and here for examples.
This asynchrony is a problem because for example you apparently can't use the onMountFocus modifier on a web component, the timing is off. To solve the issue properly, I need a deeper understanding of Web Components loading timeline and the WebComponentsReady event. I need to know at least the following:
When exactly, and how many times does this event fire? Just once per document, in all cases, even if we add some web components to the page later? If it fires only once, how do I know whether it has been fired already or not at any given time, without listening to it?
Am I correct to assume that reading anything from the web component might fail until this event fires, but providing attributes will work? What about registering event listeners?
How much of this is convention of certain libraries like Polymer vs some kind of standard?
I could of course eventually figure out these kinds of things on my own, but I don't have a personal need for Web Components, so I can't afford to spend much time here. If anyone wants to provide additional info or advice on what needs to be done in Laminar to make Web Components usage smoother, this might end up getting resolved sooner.
The text was updated successfully, but these errors were encountered:
From uosis/laminar-web-components#6 (comment):
Thanks @uosis for the initial pointer!
This asynchrony is a problem because for example you apparently can't use the
onMountFocus
modifier on a web component, the timing is off. To solve the issue properly, I need a deeper understanding of Web Components loading timeline and theWebComponentsReady
event. I need to know at least the following:When exactly, and how many times does this event fire? Just once per document, in all cases, even if we add some web components to the page later? If it fires only once, how do I know whether it has been fired already or not at any given time, without listening to it?
Am I correct to assume that reading anything from the web component might fail until this event fires, but providing attributes will work? What about registering event listeners?
How much of this is convention of certain libraries like Polymer vs some kind of standard?
I could of course eventually figure out these kinds of things on my own, but I don't have a personal need for Web Components, so I can't afford to spend much time here. If anyone wants to provide additional info or advice on what needs to be done in Laminar to make Web Components usage smoother, this might end up getting resolved sooner.
The text was updated successfully, but these errors were encountered: