-
-
Notifications
You must be signed in to change notification settings - Fork 9
Solidart v3: Refactor v3 core API and align ecosystem packages #167
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
Closed
Closed
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
5de440c
Replace custom reactive system with alien_signals preset
medz 8581735
Migrate to alien_signals for reactive system management
medz bbb2534
Replace alien_signals imports with internal deps re-exports
medz 4f05c94
Refactor Effect to extend preset.EffectNode directly
medz bce576c
Add v3 API implementation
medz 29c4d87
Rename v3 module to next
medz 67953d0
WIP: Remove legacy next.dart and introduce simplified v3 API
medz 9b8876f
legacy: Rename update method to didUpdate in internal signals
medz 87f31dd
Add Disposable interface and mixin for reactive primitives
medz 587defa
Add v3.dart as a re-export entry point
medz 1da2f7e
Add Configuration interface and global autoDispose setting
medz 8e02cfb
Add name and autoDispose parameters to Effect constructor
medz 4c8716b
Replace signal name with unique identifier
medz 8bc45ef
Update import path to use solidart/v3.dart
medz fa8f95b
Export SolidartConifg and remove unused exports from v3
medz b0712d4
Add advanced exports for v3 features
medz bc52a7c
Add isInitialized getter to LazySignal
medz 87f0de1
Add toReadonly method to Signal class
medz 05115ef
Update TODO comments for naming discussions
medz 817d305
Add TODO for code comments in v3.dart
medz 6826300
Simplify LazySignal.value getter by removing braces
medz 39c8ed1
Add dispose method to Effect class
medz e06c647
Enable auto-dispose by default and implement cascade disposal
medz 17367c9
Fix typo in DisposableMixin and SolidartConfig class names
medz 1c7ec6f
Fix typo in SolidartConfig class name
medz fc6036c
Add untrackedValue getter to ReadonlySignal
medz 87adb8e
Add disposal assertions to Signal and Computed value getters
medz c01647b
Add custom equality comparator to signals and computed
medz 423fa65
Add tests for custom equals comparators in Signal and Computed
medz ed24f93
Change default autoDispose to false and add detach flag
medz a3e301b
Add Effect.delay factory and refactor Effect.run
medz c634c85
Fix missing semicolon in Effect timer callback
medz f1ba8f2
Add fake_async dev dependency and test Effect.delay
medz 7a87815
WIP: *
medz d9cd023
Remove delayed effect support from Effect
medz d2b3d4e
Add previous value tracking to signals and computeds
medz fabc9d1
Add batch and untracked utility functions
medz b2e34d7
Add reactive collections and resource API
medz f18c69f
Add DevTools integration and observer pattern for signals
medz 68d9cfa
Fix LazySignal value check and add no-op mutation tests
medz 50e059a
Add documentation for v3 reactive primitives
medz edcf1ce
Bump solidart version to 3.0.0-dev.1
medz 72ba974
Update to solidart v3.0.0-dev.1
medz 24d05d3
Clean v2 code and align v3 entry points
medz 806956e
Align ecosystem to solidart v3
medz 002e952
Guard SignalBuilder effect after unmount
medz 90d31a5
Merge branch 'main' into refactor/3.0-dev
medz d1a06c3
Trim devtools extension to v3 signals
medz 84c11dc
Adapt solidart_hooks to v3 APIs
medz 1eb0ae9
Fix v3 tests and examples
medz 9176c69
Bump v3 package versions
medz 3310baf
Update docs to v3
medz e3daf23
Bump alien_signals and fix toggle_theme icons
medz 15cd0ee
Enable web builds for examples
medz a2b0eef
Handle SignalBuilder build errors
medz 922d5a3
Fix ReactiveMap addAll no-op check
medz 6dfced8
Clarify auto-dispose behavior
medz 77fa10b
Improve ReactiveMap docs
medz 1deea46
Guard devtools JSON against cycles
medz 2b0bba0
Refine docs and JSON guard
medz c365bf8
Use idiomatic Effect disposal in docs
medz 47f9e4a
Use ReactiveMap _copy helper
medz b16729e
Clarify Effect disposal guidance
medz d98e7f6
Use untracked in Computed
medz 1ae1974
Fix collections_test lint
medz 0212397
Rename ReactiveList, ReactiveSet, and ReactiveMap to ListSignal,
medz c5c3bd1
remove unused config
medz e10b10e
Add comprehensive collection signal tests and fix formatting
medz cd8c336
Rename reactive collection hooks to use *Signal naming
medz c672ead
Fix unused expression warnings in test files
medz e439676
Add comprehensive tests for collection signals and utilities
medz a6e3cd8
Add test coverage for edge cases and improve test reliability
medz 509f4aa
Add coverage ignore comment to SolidartObserver constructor
medz 4fb826b
Fix capitalization in LazySignal error message
medz fcf6393
Update docs-v2/src/content/docs/advanced/automatic_disposal.mdx
medz 4f18591
Update docs-v2/src/content/docs/advanced/automatic_disposal.mdx
medz 81b5168
Update docs-v2/src/content/docs/advanced/automatic_disposal.mdx
medz bff3e0c
Update docs-v2/src/content/docs/advanced/automatic_disposal.mdx
medz e5e23a3
Update docs-v2/src/content/docs/flutter/signal_builder.mdx
medz 10ec687
Update docs-v2/src/content/docs/advanced/automatic_disposal.mdx
medz f46eddd
Update v3 docs and signal builder checks
medz 3c19459
Add call operator to Signal, ReadonlySignal, and Computed
medz cbed8ea
Add SignalBuilder and Show widget tests
medz d8c775d
Update sidebar order for collection signal documentation
medz c868bb9
Fix SignalBuilder test line length
medz 25e43e0
Fix call operator test to use type inference
medz 81d1659
Fix SignalBuilder doc grammar
medz 927ff39
Document effect disposal in collection examples
medz a986632
Rename solidart_hooks example pages
medz 3f156cc
Wrap Computed and Resource as Listenable
medz 801a650
Add Listenable Signal wrapper
medz ee87fae
Document listenable wrappers
medz 56deddf
Wrap collection signals as listenable
medz f15e443
Align listenable signal wrappers
medz 8c1e727
Restore observe extension
medz 6644bc2
Drop v3 from devtools extension names
medz b5a8304
Rename v3 templates
medz 01746eb
Add ObserveSignal tests
medz 99dc334
Add listenable wrapper coverage tests
medz 22a935b
Refine listenable wrapper coverage test
medz f6fef93
Guard null devtools signal ids
medz 073e1dc
CHANGELOG formatting and consolidate v3 dev entries
medz 609bff5
Revert docs-v2 to main
medz ea0fcf0
Update CHANGELOG for v3.0.0-dev.0 release
medz f4cdc29
Update CHANGELOG for v3.0.0-dev.0 breaking changes
medz a2c0007
Align flutter_solidart dev versions
medz a4deb66
format
medz 4995285
Remove unused cupertino_icons dependency
medz 16f948b
Remove cupertino_icons dependency from example apps
medz 678e79d
Update lazy counter example to use Signal.lazy factory
medz 7c88383
Add isInitialized property to Signal base class
medz 6efa689
Simplify lazy counter pattern matching
medz aade791
sort member
medz ca20d43
Restore until helpers in v3
medz 383445e
Split solidart.dart into part files
medz cc3b50f
Fix coverage ignore markers
medz 2ee55ce
Update migration guide for v3 API changes
medz 5874663
Update migration guide with correct v3 counter increment example
medz ecdc6cb
Fix lazy signal update and resource refresh
medz e1612f4
Add observe callbacks to collection signal examples
medz bb97122
Translate Chinese debug messages to English in example pages
medz 847d9ba
Simplify example signal logging
medz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| --- | ||
| title: Migration (v2 -> v3) | ||
| description: Upgrade guide for solidart v3 | ||
| --- | ||
|
|
||
| This guide is generated by comparing **v2** with **v3**. It reflects the actual | ||
| public API changes in | ||
| `solidart`, `flutter_solidart`, and `solidart_hooks`. | ||
|
|
||
| ## 1) Update package versions (upgrade together) | ||
|
|
||
| ```yaml | ||
| # pubspec.yaml | ||
|
|
||
| dependencies: | ||
| solidart: 3.0.0-dev.0 | ||
| flutter_solidart: 3.0.0-dev.0 | ||
| solidart_hooks: 3.2.0-dev.0 | ||
|
|
||
| dev_dependencies: | ||
| solidart_lint: 3.0.3 | ||
| ``` | ||
|
|
||
| ## 2) Entry points and exports | ||
|
|
||
| ### solidart | ||
|
|
||
| **v2 (main) exported:** | ||
|
|
||
| - `src/core/core.dart` | ||
| - `src/extensions/until.dart` | ||
| - `src/utils.dart` (Debouncer / SolidartException, etc.) | ||
|
|
||
| **v3 (current) exported:** | ||
|
|
||
| - `Signal`, `Computed`, `Effect`, `Resource`, `ListSignal`, `MapSignal`, `SetSignal` | ||
| - `ReadonlySignal`, `SolidartConfig`, `SolidartObserver` | ||
| - `ObserveSignal`, `UntilSignal` | ||
| - `batch`, `untracked` | ||
| - `DisposeObservation`, `ObserveCallback`, `ValueComparator` | ||
|
|
||
| **New advanced entry point:** | ||
|
|
||
| ```dart | ||
| import 'package:solidart/advanced.dart'; | ||
| ``` | ||
|
|
||
| Exports `Configuration`, `Disposable`, `DisposableMixin`, `Identifier`, | ||
| `Option`, `Some`, `None` (previously in core/utils). | ||
|
|
||
| ## 3) Core API changes (main -> current) | ||
|
|
||
| ### 3.1 Types and naming | ||
|
|
||
| | v2 (main) | v3 (current) | Notes | | ||
| | ------------------------------------- | --------------------------------- | ---------------------------------------------- | | ||
| | `SignalBase<T>` | `ReadonlySignal<T>` / `Signal<T>` | `SignalBase` removed | | ||
| | `ReadSignal<T>` / `ReadableSignal<T>` | `ReadonlySignal<T>` | ReadSignal types removed | | ||
| | `toReadSignal()` | `toReadonly()` | Rename | | ||
| | `disposed` | `isDisposed` | Rename | | ||
| | `hasValue` | `LazySignal.isInitialized` | Normal `Signal` is always initialized | | ||
| | `hasPreviousValue` | Removed | Use `previousValue` / `untrackedPreviousValue` | | ||
| | `name` | `identifier.name` | `name` field removed from public API | | ||
|
|
||
| ### 3.2 Signal updates | ||
|
|
||
| **Removed:** `updateValue` / `setValue` public API. | ||
|
|
||
| Use `.value` assignment instead. | ||
|
|
||
| ```dart | ||
| // v2 | ||
| counter.updateValue((v) => v + 1); | ||
|
|
||
| // v3 | ||
| counter.value += 1; | ||
| ``` | ||
|
|
||
| **Comparator change:** | ||
|
|
||
| - v2 had `equals` (bool) + `comparator` | ||
| - v3 keeps only a comparator: | ||
|
|
||
| ```dart | ||
| final s = Signal(0, equals: (a, b) => a == b); | ||
| ``` | ||
|
|
||
| ### 3.3 Effect | ||
|
|
||
| **v2:** `Effect(callback, delay:, onError:, autorun:)` and `effect()` to dispose. | ||
| **v3:** `delay`, `onError`, `autorun` removed. Dispose via `effect.dispose()`. | ||
|
|
||
| ```dart | ||
| // v2 | ||
| final dispose = Effect(() { ... }, delay: ..., onError: ...); | ||
| dispose(); | ||
|
|
||
| // v3 | ||
| final effect = Effect(() { ... }); | ||
| effect.dispose(); | ||
| ``` | ||
|
|
||
| If you need delayed/debounced effects, use `Timer`/debounce in user code. | ||
|
|
||
| ### 3.4 Resource | ||
|
|
||
| - `source` now accepts `ReadonlySignal` instead of `SignalBase`. | ||
| - `update` / `updateValue` removed → set `state` directly. | ||
| - `ResourceExtensions` replaced by `ResourceStateExtensions`. | ||
| - `on()` is removed (was deprecated in v2). | ||
| - `resolve()` is now public (v2 had private `_resolve()`). | ||
|
|
||
| ```dart | ||
| // v2 | ||
| resource.update((state) => state); | ||
|
|
||
| // v3 | ||
| resource.state = ResourceState.ready(value); | ||
| ``` | ||
|
|
||
| ### 3.5 Utils removal | ||
|
|
||
| `solidart.dart` no longer exports: | ||
|
|
||
| - `Debouncer` / `DebounceOperation` | ||
| - `SolidartException`, `SolidartReactionException`, `SolidartCaughtException` | ||
| - `createDelayedScheduler` | ||
|
|
||
| If you relied on them, reimplement in your app or wrap them in a utility layer. | ||
|
|
||
| ## 4) Flutter integration (flutter_solidart) | ||
|
|
||
| - `ReadableSignal` removed; use `ReadonlySignal`. | ||
| - `ValueNotifierSignalMixin` is no longer exported. | ||
|
|
||
| Extensions changed: | ||
|
|
||
| - v2: `SignalBase.toValueNotifier()` and `ValueNotifier.toSignal()` | ||
| - v3: `ReadonlySignal.toValueNotifier()` and `ValueListenable.toSignal()` | ||
|
|
||
| ## 5) Hooks (solidart_hooks) | ||
|
|
||
| - `ReadSignal` → `ReadonlySignal` | ||
| - `equals/comparator` replaced by `equals: ValueComparator<T>` | ||
|
|
||
| Lifecycle change: | ||
|
|
||
| - v2: dispose on unmount only if `autoDispose` was true | ||
| - v3: hook-created signals are **always** disposed on unmount | ||
|
|
||
| Use `useExistingSignal(...)` to bind external signals without disposing them. | ||
|
|
||
| ## 6) Behavioral differences | ||
|
|
||
| - `SolidartConfig.autoDispose` default changed **true → false** | ||
| - `SolidartConfig.equals` removed | ||
| - `previousValue` updates only after a tracked read | ||
| - `LazySignal` throws if read before first assignment (check `isInitialized`) | ||
|
|
||
| ## 7) Quick migration checklist | ||
|
|
||
| - [ ] Upgrade versions in all solidart ecosystem packages | ||
| - [ ] Replace `ReadSignal`/`SignalBase` with `ReadonlySignal` | ||
| - [ ] Replace `toReadSignal()` with `toReadonly()` | ||
| - [ ] Remove `updateValue` usages (use `.value = ...`) | ||
| - [ ] Update Effect usage (no `delay/onError`, dispose via `.dispose()`) | ||
| - [ ] Update Resource state handling (`state =`, `when/maybeWhen`) | ||
| - [ ] Update Flutter extensions (`toValueNotifier`/`toSignal`) | ||
| - [ ] Adjust hooks disposal expectations | ||
|
medz marked this conversation as resolved.
|
||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.