redus 0.4.4
redus: ^0.4.4 copied to clipboard
A Vue-like fine-grained reactivity system for Dart with dependency injection. Developer utilities for convenience and performance.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.4.4 - 2025-12-23 #
Fixed #
- Effects not stopped when scope stops -
watchEffectandwatchnow properly register their effects with the current effect scope viaregisterWithScope(). Effects are now correctly stopped when their owning scope is stopped, preventing resource leaks and duplicate timers in Flutter apps.
0.4.1 - 2025-12-19 #
Fixed #
- Updated README to reflect redus as dev utility package (not just reactivity)
- Added complete DI module documentation to CHANGELOG and README
0.4.0 - 2025-12-19 #
Added #
-
Dependency Injection Module (
package:redus/di.dart)register<T>(instance, {key})- Register singleton with optional keyregisterFactory<T>(factory, {key})- Register factory with optional keyget<T>({key})- Get registered instance by type and optional keyisRegistered<T>({key})- Check if type/key is registeredunregister<T>({key})- Remove registrationresetLocator()- Clear all registrations
-
Key-based Lookup - Register multiple instances of same type with different keys
register<Logger>(ConsoleLogger(), key: #console); register<Logger>(FileLogger(), key: #file); final log = get<Logger>(key: #console);
Changed #
- Package Scope Expanded - Redus is now a dev utility package with multiple modules:
package:redus/reactivity.dart- Fine-grained reactivity systempackage:redus/di.dart- Dependency injectionpackage:redus/redus.dart- All modules combined
0.3.0 - 2025-12-19 #
Added #
- Callable Ref and Computed - Both
Ref<T>andComputed<T>now have acall()methodcount()is equivalent tocount.value- Allows
Ref<T>andComputed<T>to be used asT Function() - Enables perfect type inference in
watch()and other APIs
Changed #
-
Strongly typed
watch()API - Source is nowT Function()instead ofObject- Type inference works automatically:
watch(count, (val, old, _) => ...)infersTasint - No more need for explicit
watch<int>(...)calls - Both
RefandComputedwork directly as sources (since they're callable) - Getter functions
() => x.valuealso work with full inference
- Type inference works automatically:
-
Strongly typed
watchMultiple()API - Sources are nowList<T Function()>
0.2.0 - 2025-12-19 #
Added #
- Flutter Integration Support
- Exported
ReactiveEffectclass for custom effect creation - Exported
activeEffectandeffectStackfor render tracking - Enables automatic UI reactivity in redus_flutter without manual watchEffect
- Exported
Changed #
- Removed
@internalannotations fromactiveEffectandeffectStack
0.1.0 - 2025-12-18 #
Added #
-
Core Reactivity (
src/reactivity/core/)ref<T>()- Mutable reactive reference with.valueaccessorcomputed<T>()- Lazily evaluated, cached computed valueswritableComputed<T>()- Computed values with custom settersreadonly<T>()- Read-only wrapper preserving reactivitywatchEffect()- Immediate effect with dependency trackingwatchPostEffect()/watchSyncEffect()- Flush timing variantswatch()/watchMultiple()- Explicit source watchingonWatcherCleanup()- Register cleanup in effectsWatchHandlewithstop(),pause(),resume()Schedulerfor batching with pre/post/sync flush modes
-
Utilities (
src/reactivity/utilities/)isRef()- Check if value is Refunref<T>()- Unwrap ref or return valuetoRef<T>()- Normalize value/getter to reftoValue<T>()- Normalize ref/getter to valuetoRefs<T>()- Convert map to refsisProxy()/isReactive()/isReadonly()- Type checking
-
Advanced (
src/reactivity/advanced/)shallowRef<T>()- Shallow reactive ref (no deep tracking)triggerRef()- Force trigger shallow refshallowReadonly<T>()- Shallow readonly wrappercustomRef<T>()- Custom ref with track/trigger controltoRaw<T>()- Get underlying value from reactivemarkRaw<T>()/isMarkedRaw()- Prevent reactivityeffectScope()- Group effects for disposalgetCurrentScope()- Get active effect scopeonScopeDispose()- Register scope cleanup
Package Structure #
Reorganized into three modules:
core/- Core reactive primitives and effectsutilities/- Helper functionsadvanced/- Advanced features