-
Notifications
You must be signed in to change notification settings - Fork 360
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
Toward Owl 3.0 #1669
Comments
A few things that you missed or aren't currently tracked in any issues:
I like the idea of tagging templates to choose the compiler as that's pretty easy to keep separate, not sure how viable it will be to have a common runtime for both compilers though but definitely worth exploring. Might also be good if the new compiler could warn (or error) on old constructs to help with conversions. One big question that remains to be discussed and decided upon is, with a rework of the reactivity system it could be feasible to push granularity even further (eg each t-att- generates a separate render effect), similar to what's done in Solid for example. Not sure what the trade-offs are. Something to keep in mind for the signal discussion: https://github.com/tc39/proposal-signals |
i believe that solid actually group some signals together, so it is not at the absolute maximal granularity. for owl, my first intuition would be to explore the granularity of a "block", in the sense of blockdom. but this is just a thought, no real work done yet |
Toward Owl 3.0 [DRAFT!!!!!!]
Motivation
After a few years of use of Owl 2 at Odoo, I believe we have a reasonable
understanding of the strengths and weaknesses of owl.
Owl has many great qualities, we definitely want to keep that. But it can still
be improved. This document is trying to open the discussion on what owl 3.0 could
look like. Of course, at this point, it is only a discussion. Nothing concrete yet.
Main ideas/themes
Here are a few research/ideas that came up in various discussions.
Many of these ideas have already issues (see https://github.com/odoo/owl/issues?q=is%3Aissue%20state%3Aopen%20label%3Aowl-3)
Async Reactive Engine
Big change. Basically, move the fiber async code out of the rendering engine
and into the reactivity system. The goal is to give access to the strong concurrency
code from owl to other code (the model, in addition to the view). At the same time,
it feels like rendering a component (or a lazy block) should be an effect, and all
reactive values should be automatically subscribed to that effect (so,
basically, effects/signals)
Synchronous Rendering
If owl rendering is synchronous, the question is what happens when a component want
to fetch something asynchronous before it is rendering?
Currently, in owl 2.0, it looks like this:
If the rendering is synchronous, how can we do the same? An easy way is to move
the loading of the data up the component tree. It works, but it loses some
composability/ease of working with owl.
Another way would be to use async derived values:
Owl could then basically treat the component as an empty text node until all
async values are ready, and then rerender it.
But what happens if our fetch operation is long, and in the meantime, we want to
change some parameters? Currently, if it happens, owl has to destroy the component
and restart again. But i guess we could either do that, or just recompute the
async derived value.
Lazy block
Lazy block could replace slots, and named slots, but explicitely.
and in SomeComponent:
Maybe we want to keep a simple syntax for the common case of default slot:
How to reference the inner content? Maybe this?
Incremental transition?
All changes discussed above should be done with the practical transition work in mind. So, since there are obviously breaking changes, and upgrading from owl 2 to 3 will need some work, we should have a "easy" way to proceed.
The text was updated successfully, but these errors were encountered: