Skip to content
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

upgrade solidart to 2.0 version #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions bin/solidart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class _SolidartReactiveFramework extends ReactiveFramework {
@override
Computed<T> computed<T>(T Function() fn) {
final inner = solidart.Computed(fn);
return createComputed(() => inner());
return createComputed(() => inner.value);
}

@override
Expand All @@ -20,19 +20,23 @@ final class _SolidartReactiveFramework extends ReactiveFramework {

@override
Signal<T> signal<T>(T value) {
final solidart.Signal<T>(:call, :set) = solidart.Signal(value);
return createSignal(call, set);
final inner = solidart.Signal<T>(value);
return createSignal(
() => inner.value,
(value) => inner.value = value,
);
}

@override
void withBatch<T>(T Function() fn) {
fn();
solidart.batch(fn);
}

@override
T withBuild<T>(T Function() fn) => fn();
}

void main() {
solidart.SolidartConfig.devToolsEnabled = false;
runFrameworkBench(const _SolidartReactiveFramework(), testPullCounts: true);
}
12 changes: 2 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
logger:
dependency: "direct main"
description:
name: logger
sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1
url: "https://pub.dev"
source: hosted
version: "2.5.0"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -290,10 +282,10 @@ packages:
dependency: "direct main"
description:
name: solidart
sha256: "2d15608b60fff6cf1ed39b4161bde03caddacf6656275d3bedeb3605edfc60e9"
sha256: d1cd846db91abb2c6b7854b68520036ec1aa93fdd6e2b9c5baf8e0eb8cb9299d
url: "https://pub.dev"
source: hosted
version: "1.5.4"
version: "2.0.0-dev.3"
source_map_stack_trace:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:

dependencies:
alien_signals: ^0.0.4
solidart: ^1.5.4
solidart: ^2.0.0-dev.3
signals_core: ^6.0.2
preact_signals: ^1.8.3

Expand Down