-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Reactive controllers protocol #27
Comments
Yes, this would be great! There are a couple of reasons we haven't proposed this ourselves quite yet:
Very happy to work this one out though! If people are already trying to use controllers across frameworks we could get the current Lit interfaces into a common location and iterate from there. |
From a broader perspective this is interesting. I'll try to bring this for internal discussion to see how LWC can benefit of this as a native option. |
Haunted and atomico implement |
FAST would be interested in working together on this. @justinfagnani I think you've identified the primary challenge as being that FAST takes a fine-grained update approach. There's no "re-render this view" in FAST. So, we'd have to somehow shape the API to enable that. |
Coming back to this after a while, and with some experience with working with Signals... I think there likely is a path forward for fine-grained reactivity systems with reactive controllers, but would need some feedback from the other libraries. What we've done for Lit is to synchronize the reactive lifecycle (which updates the entire template) with pin-point signal changes. So we batch the signal changes and flush them together with any changes that require running the template, if any. This means that we do have before/during/after lifecycle points even with signals. And those are what can drive controllers. I assume that most signals libraries are doing batching of DOM updates triggered by signals? If so, hopefully they could tie controller lifecycle callbacks into the batch execution. A possible difference that might matter would be whether batching is global vs per component. |
does that mean that |
Recently, we've been exploring Lit's reactive controllers (ionic-team/stencil#3162) and this PR on lit was referenced. This seems interesting to explore to create a community protocol, so I wanted to open that conversation here. It seems there's some prior art around this too, linked here: lit/lit#1682
The text was updated successfully, but these errors were encountered: