DrSensor / nusa

incremental runtime that bring both simplicity and power into webdev (buildless, cross-language, data-driven)
MIT License
4 stars 0 forks source link

<render-scope> glitched when registered using <script async> #45

Closed DrSensor closed 1 year ago

DrSensor commented 1 year ago

Cause: connectedCallback() doesn't guarantee all children are connected when the browser still parsing (explanation)

Solution: move children to shadow root on every slotchange then remove that <slot/> when <render-scope> has nextSibling.

In my previous prototype, the glitch are really clear when override the attribute value from class module at load time or infer the accessor value from attribute.