Conversation
…sten solidart signals now implement package:listen's ValueListenable/ValueNotifier natively (pure Dart), so flutter_solidart no longer needs Flutter-specific signal wrappers. - solidart: ReadableSignal implements ValueListenable; Signal implements ValueNotifier (adds hasListeners/notifyListeners); Computed implements ValueListenable. ListSignal/MapSignal/SetSignal/Resource inherit via Signal. addListener/removeListener are backed by observe(), preserving auto-dispose semantics (a listener keeps an autoDispose signal alive; removing the last one disposes it). notifyListeners snapshots its listeners to stay reentrancy-safe. - flutter_solidart: now just re-exports solidart plus the widgets (SignalBuilder, Show) and the toValueNotifier/toSignal bridge. Deleted the 8 wrapper/mixin files under src/core. - Moved the interface-conformance tests into solidart's pure-Dart suite (asserting listen's types). BREAKING: signals implement listen's Listenable types, not Flutter's, so a Signal is not directly assignable to a Flutter ValueListenableBuilder/ AnimatedBuilder until flutter/flutter#189111 lands. Use SignalBuilder, or the toValueNotifier() bridge, in the meantime.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ring ReadableSignal and Computed had identical inline listener plumbing (the _listeners map, addListener/removeListener, dispose cleanup) and Signal held hasListeners/notifyListeners. Extract it all into a single _SignalListeners<T> helper; the classes now delegate to it. Also drop the dead fireImmediately getter (always false, never overridden). Behavior-preserving: the map dedup, the notifyListeners reentrancy snapshot, and the observe()-backed auto-dispose semantics are unchanged.
Bump both packages to 3.0.0-dev.2 with CHANGELOG entries for the package:listen migration. flutter_solidart now requires solidart ^3.0.0-dev.2.
solidart_hooks 4.0.0-dev.2 and solidart_lint 3.1.0-dev.2, both requiring the new solidart/flutter_solidart ^3.0.0-dev.2 (package:listen migration).
The migration removed the file's opening coverage:ignore-start (it sat above the deleted VoidCallback) but left the closing coverage:ignore-end, which made the coverage tool throw 'unmatched coverage:ignore-end' during CI. Replace the start/end pair with the idiomatic // coverage:ignore-file directive.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 19 +1
Lines 892 923 +31
=========================================
+ Hits 892 923 +31
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
solidartsignal classes now implementpackage:listen'sValueListenable/ValueNotifiernatively (pure Dart). Becauselistenprovides theListenablemachinery without Flutter,flutter_solidartno longer needs its own Flutter-specific signal wrappers — it becomes a thin layer that re-exportssolidartplus the widgets.Changes
solidartReadableSignalimplementsValueListenable;SignalimplementsValueNotifier(addshasListeners/notifyListeners);ComputedimplementsValueListenable.ListSignal/MapSignal/SetSignal/Resourceinherit throughSignal.addListener/removeListenerare backed by the existingobserve(), so auto-dispose semantics are preserved: a listener keeps anautoDisposesignal alive, and removing the last listener disposes it.notifyListeners()snapshots its listeners so a listener removing itself mid-notification can't throw.flutter_solidartexport 'package:solidart/solidart.dart'+SignalBuilder/Show/ thetoValueNotifier/toSignalbridge.lib/src/core/.Latest Flutter (stable + master) does not yet re-export
package:listen, so aSignalimplements listen'sValueNotifier, which is a distinct type from Flutter's. Until flutter/flutter#189111 ("Migrate to listen package") merges and reaches master, aSignalis not directly assignable to a FlutterValueListenableBuilder/AnimatedBuilder. UseSignalBuilder(idiomatic) orsignal.toValueNotifier()in the meantime. Once that Flutter PR lands, the twoValueNotifiertypes unify and direct interop works for free.Do not merge until flutter/flutter#189111 is in a released Flutter.
Verification
dart test packages/solidart— 185/185 passflutter test packages/flutter_solidart— 33/33 passflutter analyze(solidart, flutter_solidart, example, solidart_hooks) — no issuesNot included (follow-up for the actual dev release)