solidart icon indicating copy to clipboard operation
solidart copied to clipboard

feat/v2.0.0

Open nank1ro opened this issue 1 year ago • 4 comments

  • CHORE: Improved Solid widget performance by more than 3000% in finding ancestor providers. During my performance tests, before I was able to observe up to 71 signals (provided through Solid) per second, now this numbers increased to 2159 signals per second.

  • FEAT: The SignalBuilder widget now automatically tracks the Signals used in the builder 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 and TripleSignalBuilder in favor of SignalBuilder.

  • BREAKING CHANGE the context.observe methods (due to the performance improvements of the Solid 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 and observeMapSignal

    The PR has still some problems:

    1. The auto dispose of signals happens when using SignalBuilder because the effect tracks the dependencies in the build method. This is necessary to make it performant but, for a little moment, the signals will not be watched by the Effect. I still need to find a way to fix this.
    2. I don't know if context.observe<T, S> still be exposed, due to the new specific observe methods.
    3. 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

nank1ro avatar Jan 02 '24 11:01 nank1ro