juice_forms 0.3.0
juice_forms: ^0.3.0 copied to clipboard
Form state — fields, sync/async validation, and per-field selective rebuilds — as a Juice bloc.
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.3.0 - 2026-08-12 #
Changed #
- Requires
juice ^1.6.0. - Declared concurrency for every event. Field/structure mutations and
whole-form validate/submit/reset passes are
sequential; initialization isdroppable; token-guarded per-field async validation remains intentionallyconcurrent. - Whole-form submissions no longer overlap.
SubmitFormEventis sequential rather than droppable so everysubmitNow()caller is guaranteed to resolve.
0.2.0 - 2026-06-10 #
From dogfooding (Glean DOGFOOD.md F3).
Added #
- Awaitable validation/submit —
Future<bool> validateNow()andFuture<bool> submitNow(): the use case completes the future with the outcome (isValid/ handler-succeeded), so "validate, then save" flows no longer need a settle-delay after the fire-and-forgetvalidate().ValidateFormEvent/SubmitFormEventgain an optionalcompletionCompleter. Additive and backward-compatible.
0.1.0 - 2026-05-28 #
Added #
- Initial release.
FormsBloc— form state for a set of fields, with per-field selective rebuilds: a widget bound toFormsGroups.field('email')rebuilds only when that field changes.- Dynamic fields — register/unregister fields at runtime.
- Sync + async validation —
ValidatorandAsyncValidator; async runs after sync passes, debounced, with stale results dropped (latest change wins). Validators—required,minLength,maxLength,email,matches(cross-field),all.- Submit lifecycle —
submit()does its own awaited validation pass, then runs the injectedSubmitHandler; surfacessubmitError, markssubmitted. A submit with no handler fails loudly. - State — data-only
FormsState/FieldState(value/error/touched/ validating/enabled) with derivedisValid/isDirty/values. Validators live on the bloc config, never in state. - Rebuild groups —
form:field:<name>,form:any,form:valid,form:status,form:fields.