daxle 5.1.0
daxle: ^5.1.0 copied to clipboard
High-performance data modeling, zero-cost map querying, concurrency control, and stream transformations for Dart.
5.1.0 #
-
BREAKING CHANGES:
- Completely removed functional types:
Option,Either,Task,TaskEither, andUnit. - Daxle now strictly focuses on zero-cost nested map queries (
QueryMap), flexible sliding-window concurrency (Concurrency), collection equality, reactive stream transformation utilities (stream_transform), and declarative code generation annotations.
- Completely removed functional types:
-
NEW FEATURES:
- Re-exported complete reactive stream operators from
package:stream_transform(debounce,throttle,audit,buffer,combineLatest,merge,switchMap,scan,tap,whereType). - Added dependency on
package:pooland re-exportedPoolandPoolResource. - Added
Concurrency.createPool()method to construct aPoolcorresponding to the concurrency strategy. - State Machine & Workflows (Preview & Experimental):
- Added
@StateMachine([Flow(...)])declarative annotation marking classes for compile-time validated state machine synthesis. - Added
Flow(from: ..., to: ..., using: ...)to model directed state transitions and external event triggers. - Added
TransitionScope<TState>passed to async flow handlers providing active state inspection (getActiveState), flow liveness detection (isCurrent), and safe transition emission (transit(nextState)). - Added
InvalidFlowExceptionfor illegal transition attempts or unauthorized event dispatches. - Note:
StateMachineand related workflow primitives are designated as preview and experimental; public APIs and generated mixin contracts are subject to iteration.
- Added
- Sensitive Field Redaction (
@redact/Redact):- Added
@redactandRedact(mask: '...', preserveLength: bool)annotations to sanitize sensitive data (API keys, secrets, PII) in string representations (toString()) and debug maps (toDebugMap()) without altering wire-format serialization (toMap()).
- Added
- Structured Library Architecture:
package:daxle/daxle.dart: Focused entrypoint for core annotations, data classes, zero-cost data access (QueryMap), and preview state machine primitives. Keeps IDE auto-complete clean.package:daxle/async.dart: Curated asynchronous & reactive toolkit (Concurrency,Pool,stream_transform,FutureGroup,AsyncCache,StreamQueue, etc.).
- Re-exported complete reactive stream operators from
-
INTERNAL IMPROVEMENTS:
- Rewrote
Concurrencyinternal worker scheduling to usepackage:poolfor battle-tested resource pooling, while keeping the public API, determinism, andshouldStopearly termination guarantees intact.
- Rewrote
4.0.0 - 2026-08-13 #
-
BREAKING CHANGES:
Option<T extends Object>now strictly enforces non-nullable type parameterT extends Object. StoringnullinsideSomeis prohibited.- Removed
Option.fromNullable(T? value). Use the smart factory constructorOption(T? value)instead, which automatically mapsnulltoNone()and non-null values toSome(value). - Changed
Either.condsignature from(bool condition, R right, L left)to lazy callbacks(bool condition, R Function() right, L Function() left)to fix eager early-evaluation bugs and guarantee that unchosen branches (e.g., throwing expressions likea ~/ b) are never executed.
-
NEW FEATURES:
- Introduced
QueryMapzero-cost extension type (extension type const QueryMap(Map<Object?, Object?> map)) for type-safe nested map and array querying:- Dot notation for nested maps (
query.get<String>('services.server.host')). - Bracket notation for single and multi-dimensional lists (
query.get<String>('users[0].name'),query.get<int>('matrix[0][2]')). - Key lists / Iterable paths for non-string keys (
query.get<String>(['cluster', 101, 'status'])). - Type-safe retrieval via
query.get<T>(path)returningnullon type mismatch without throwingTypeError. - Key presence checking via
query.has(path)(differentiating explicitnullfrom missing keys).
- Dot notation for nested maps (
- Introduced
Concurrencyextension type (extension type const Concurrency._(int limit)) to manage worker pool concurrency:Concurrency.sequential(.sequential, limit 1): Executes tasks 1 by 1 sequentially.Concurrency.unbounded(.unbounded, limit 0): Runs all tasks simultaneously in parallel.Concurrency.bounded(int limit)(.bounded(limit)): Processes tasks in parallel worker chunks of sizelimit.- Added
Concurrency.dispatch(items, worker)for cleanly executing collections of raw async operations without double-closure boilerplate. - Added
Concurrency.process(thunks)for executing zero-argument task functions directly with early-stop (shouldStop) capability.
- Added optional
{Concurrency mode = const .bounded(3)}parameter toTask.sequence,Task.traverse,TaskEither.sequence, andTaskEither.traverse. - Full support for Dart dot-shorthand syntax (
mode: .sequential,mode: .unbounded,mode: .bounded(5)). - Added
flatMapFuturetoTaskEitherandTaskfor seamlessly chaining raw asynchronousFuturecomputations (and function tear-offs) without nested constructor boilerplate.
- Introduced
-
PERFORMANCE & REFACTORING:
- Defensive snapshotting (
items.toList()) inConcurrency.processpreventsConcurrentModificationErrorwhen iterables are mutated across asynchronous boundaries. - Eager failure short-circuiting (
eagerError: true) stops processing immediately when an operation fails.
- Defensive snapshotting (
3.1.1 - 2026-07-20 #
- BUG FIXES:
- Prevented
nullvalues insideSomeinstances by throwing anArgumentErrorifSomeis initialized withnull. - Fixed
Option.mapto acceptB? Function(T)and convertnullreturn values intoNone()(Option.fromNullable(f(value))), preventingSome(null)values.
- Prevented
3.1.0 - 2026-07-17 #
- PERFORMANCE & REFACTORING:
- Improved
TaskEitherandTaskperformance by migrating toFuture.thento avoid async/await overhead. - Optimized memory allocations and performance in AOT for
EitherandOptionby using pragma annotations and direct constructor instantiation. - Refactored
EitherandOptionto delegate combinators directly to their respective subclasses. - Inlined async transformation helpers in
TaskEitherto further reduce runtime overhead.
- Improved
- TESTS:
- Added regression tests for
TaskandTaskEitherexception handling.
- Added regression tests for
3.0.0 - 2026-07-14 #
-
BREAKING CHANGES / ARCHITECTURE REDESIGN:
- Removed
Result<T, E>entirely. UseEither<L, R>as the single abstraction for explicit success/failure. - Removed
Pipeline<T>andAsyncPipeline<T>. Most useful functionality is now handled byTaskEither<L, R>with explicit control flow. - Core primitives are now strictly single-responsibility:
Option<T>,Either<L, R>,Task<T>,TaskEither<L, R>, andUnit.
- Removed
-
NEW FEATURES:
- Added
Task<T>primitive for lazy asynchronous computations that do not model explicit failures. - Enhanced
TaskEither<L, R>with comprehensive combinators:- Added
mapLeft,bimap,tap,tapLeft,ensure,sequence, andtraverse. - Added support for exception catching in
flatMap.
- Added
- Standardized
sequenceandtraverseas static methods acrossEither,Task, andTaskEitherfor consistency and easier discovery.
- Added
-
DOCUMENTATION & REFACTORING:
- Re-architected implementation of
TaskEitherandEitherto strictly usefoldfor value transformations and exhaustiveswitchfor control flow branching, reducing code duplication. - Improved
_transformWithErrorHandlingdocstrings and formatting. - Instantiations of
Option.none()now use theconstconstructor for improved performance.
- Re-architected implementation of
2.2.0 - 2026-07-11 #
-
NEW FEATURES:
- Re-exported key utilities from
package:asyncto simplify asynchronous control flow and stream manipulation. These include:FutureGroup,AsyncCache, andAsyncMemoizerfor advanced future handling.StreamZip,StreamQueue,StreamGroup, andStreamSplitterfor streamlined stream consumption and combination.
- Re-exported key utilities from
-
DOCUMENTATION & REFACTORING:
- Updated library documentation in
lib/daxle.dartandREADME.mdto document the newasyncutilities. - Completed the incomplete documentation example for
Unitinsidelib/daxle.dart. - Removed outdated record extensions references from
lib/daxle.dartandREADME.md.
- Updated library documentation in
2.1.0 - 2026-07-01 #
-
NEW FEATURES:
- Re-introduced
Result<T, E>withOkandErrvariants for representing operations that can succeed or fail.
- Re-introduced
-
BREAKING CHANGES:
- Removed all record extensions (
zipped(),map(),flatMap(), andfilter()on Dart tuples/records) to keep the library lean and focus on a single explicit way of doing things. - Removed all function extension methods (
.result(),.either(), and.option()).
- Removed all record extensions (
-
DOCUMENTATION & REFACTORING:
- Reorganized internal folder structure inside
lib/src/into logical subfolders (types/). - Added comprehensive
{@template}and{@macro}documentation to all core data types and classes to maximize readability and reduce doc comments redundancy. - Added
example/example.mdto showcase the primary library features on pub.dev. - Formatted the codebase to ensure a 160/160 pub points quality score.
- Reorganized internal folder structure inside
2.0.0 - 2026-06-27 #
-
BREAKING CHANGES / API REWRITE:
- Removed
Lazy<T>type. Use deferred pipelines or standard closures. - Redesigned
Option<T>andEither<L, R>as sealed classes with direct subclasses (Some/None,Left/Right) for full compile-time exhaustive pattern matching. - Changed
Option.getOrElseto take an eager default valueTinstead of a resolver callback. - Changed
Either.getOrElseto take a resolver callbackR Function(L left)instead of an eager default value.
- Removed
-
NEW FEATURES:
- Added
TaskEither<L, R>type to represent lazy, asynchronous computations that can fail (Future<Either<L, R>>), supporting monadic chaining (map,flatMap,orElse,fold). - Added
Pipeline<T>andAsyncPipeline<T>classes to build deferred, type-safe operation chains.- Supports observational side-effects (
tap). - Supports recovery from errors (
recoverandrecoverWith). - Supports error mapping (
mapError). - Supports cleanup logic (
finalize/finallyequivalent). - Supports folding success and failure states.
- Supports concurrent combination of asynchronous pipelines (
zip).
- Supports observational side-effects (
- Added
Unittype andunitconstant to represent the absence of a meaningful value. - Added
zipped(),map(),flatMap(), andfilter()extension methods on Dart 3Recordtuples of size 2, 3, 4, and 5 containingOption,Either, orTaskEithervalues (runsTaskEithertasks concurrently). - Added
Option.fromPredicateandEither.condfactory constructors, andOption.filtermethod for clean, explicit conditional evaluation.
- Added
1.1.0 #
- Introduced
Lazytype for lazy evaluation and memoization of values. - Supported transforming
LazytoResult,Option, andEither.
1.0.0 #
- Initial version. (2026-01-10)
- Implemented
Eithertype for representing success or failure. - Implemented
Optiontype for representing the presence or absence of a value. - Implemented
Resulttype for representing a result of an operation that can either succeed or fail.
- Implemented