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
One Crank idiom which I really like is components which refresh on mount:
function*Component(){this.schedule(()=>this.refresh());constref=yield<Child/>;for({}ofthis){// do dirty imperative thingsyield<Copy/>}}
Unfortunately, if you have many child components which do this, each will call arrange with the parent host element, and complete on the renderer, which can degrade performance. I’m not sure if this means we should batch refreshes for the parent, but maybe that’s the solution. The bad thing about this is that it might mean the refresh of sync components has to be deferred, whereas I really would like to adhere to the pattern where sync components render synchronously. Something to think about.
The text was updated successfully, but these errors were encountered:
Making the “rearranging” step of refresh() calls happen asynchronously is tempting, but I think one possible solution is to detect synchronous refresh() calls which happen while a component is being updated and avoid running the rearranging logic when this is detected. I’m not sure if this would work, but it would be nice because it preserves the synchronous nature of refresh calls. Probably some kind of advanced logic with the IsUpdating flag. We need to make sure that async trees continue to trigger a rearrange, though then again, we would have the same problem when multiple async children components refresh and fulfill in the same microtask.
One Crank idiom which I really like is components which refresh on mount:
Unfortunately, if you have many child components which do this, each will call arrange with the parent host element, and complete on the renderer, which can degrade performance. I’m not sure if this means we should batch refreshes for the parent, but maybe that’s the solution. The bad thing about this is that it might mean the refresh of sync components has to be deferred, whereas I really would like to adhere to the pattern where sync components render synchronously. Something to think about.
The text was updated successfully, but these errors were encountered: