Closed intrnl closed 9 months ago
This is interesting. I want to put something out there so you know what we've been thinking about with Solid 2.0's reactivity.
We want to change the renderEffects to split the pure from the side effectful. Ie..
createRenderEffect(() => /*pull out values, tracking*/, (values, prev) => /*non-tracking, diff & apply changes*/)
The reason is so we can run the front half as many times as we need to (considering things like async, Suspense, Transitions) and then when everything is good to render we run the second half with the most recent values, and the prev from when the second half last ran.
This still needs to be benchmarked, proven but we were thinking we'd compile existing effects into this form. One benefit is that we wouldn't need to return prev, as we'd have it. We'd still be generating a bit more code as we'd be creating the array/object that gets passed to the second function.
Anyway.. just wanted to put that out there.
Closing in favor of #296
This pull request attempts to reduce the size of the code emitted from merging the dynamic expressions together into one effect.