solidart
solidart copied to clipboard
feat/v2.0.0
-
CHORE: Improved
Solid
widget performance by more than 3000% in finding ancestor providers. During my performance tests, before I was able to observe up to71
signals (provided through Solid) per second, now this numbers increased to2159
signals per second. -
FEAT: The
SignalBuilder
widget now automatically tracks theSignal
s used in thebuilder
function allowing you to react to any number of signals at the same time. Before:SignalBuilder( signal: counter, builder: (context, value, child) { return Text('$value'); }, ),
Now:
SignalBuilder( builder: (context, child) { return Text('${counter.value}'); }, ),
-
BREAKING CHANGE: Removed
DualSignalBuilder
andTripleSignalBuilder
in favor ofSignalBuilder
. -
BREAKING CHANGE the
context.observe
methods (due to the performance improvements of theSolid
widget) now needs the type of signal Before:final counter = context.observe<int>();
Now:
final counter = context.observe<int, Signal<int>>(); // or final counter = context.observeSignal<int>();
So this change includes the new
observeSignal
,observeReadSignal
,observeComputed
,observeResource
,observeListSignal
,observeSetSignal
andobserveMapSignal
The PR has still some problems:
- The auto dispose of signals happens when using
SignalBuilder
because the effect tracks the dependencies in thebuild
method. This is necessary to make it performant but, for a little moment, the signals will not be watched by theEffect
. I still need to find a way to fix this. - I don't know if
context.observe<T, S>
still be exposed, due to the new specific observe methods. - Still waiting for the v2 of SolidJS that may happen at the end of January 2024, this could improve the performance of the automatic tracking system significantly (https://github.com/bubblegroup/bubble-reactivity)
TODOs
- [ ] fix unit tests
- [ ] update solidart_lint
- [ ] update docs
- The auto dispose of signals happens when using