Closed andy-haynes closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
bos-web-engine | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 15, 2024 11:52pm |
bos-web-engine-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 15, 2024 11:52pm |
bos-web-engine-sandbox | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 15, 2024 11:52pm |
This PR updates the container render logic to request renders at the Component level. When the
commit
hook is triggered on render, the target vnode is the root for the DOM subtree that changed. However the outer application only recognizes changes at the Component/container level. This means if the rendered vnode is the descendant of a Component, that subtree render will replace the entire Component DOM in the outer window. E.g. givenThe initial render would print both
A
andB
, but if<A />
were to re-render then onlyA
would be printed. Since the outer application treats all render requests as coming directly from a Component, the updated descendant element overwrites the Component's DOM entirely.Ideally this subtree rendering would be supported, but this requires a more sophisticated approach to synchronize state across containers and the outer DOM. It seems unlikely that this would yield demonstrable performance benefits in the current implementation, although it may become a less daunting task as the render pipeline matures.
Fixes #399 (https://bos-web-engine-git-fix-399-compon-03c7d9-near-developer-console.vercel.app/bwe-demos.near/NPM.Zustand?showCode=true 🎉 )