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
feat/v2.0.0 #85
base: main
Are you sure you want to change the base?
feat/v2.0.0 #85
Conversation
Note that SignalBuilder
|_ Container
|_ Column
|_ SizedBox
|_ SignalBuilder
|_ Text <- signal watched here will rebuild both SignalBuilders |
Thanks for reporting 🙏, need to investigate further to fix this |
@jinyus can't reproduce the issue, this is the code I used to test import 'package:flutter/material.dart';
import 'package:flutter_solidart/flutter_solidart.dart';
final a = Signal(0);
final b = Signal(100);
class TestPage extends StatelessWidget {
const TestPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SignalBuilder(
builder: (_, __) {
print('build a');
return Column(
children: [
Text(a().toString()),
const Second(),
],
);
},
),
floatingActionButton: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextButton(
onPressed: () => a.value++,
child: const Text('add to A'),
),
TextButton(
onPressed: () => b.value++,
child: const Text('add to B'),
),
],
),
);
}
}
class Second extends StatelessWidget {
const Second({super.key});
@override
Widget build(BuildContext context) {
return SignalBuilder(
builder: (_, __) {
print('build b');
return Text(b().toString());
},
);
}
} Can you share your code please? |
I'm no longer seeing this bug. I will have to investigate further. Consider this a non-issue for now. |
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 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:
Now:
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 signalBefore:
Now:
So this change includes the new
observeSignal
,observeReadSignal
,observeComputed
,observeResource
,observeListSignal
,observeSetSignal
andobserveMapSignal
The PR has still some problems:
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.context.observe<T, S>
still be exposed, due to the new specific observe methods.TODOs