Repository navigation
v0.5.0 - Advanced Features
We are excited to announce the release of Valar v0.5.0. This is a significant update that introduces powerful new capabilities for modern, real-world validation scenarios, along with major performance and extensibility improvements.
New Features in this Release:
- Async Validation Support: The
AsyncValidatortypeclass has been introduced to support validators that return aFuture, allowing for non-blocking, I/O-bound validations. - Internationalization (i18n): A new
valar-translatormodule provides a mechanism for translatingValidationErrormessages into different languages. - Core Extensibility with
ValidationObserver: A foundational, zero-overhead pattern has been added for integrating cross-cutting concerns like logging and metrics via theValidationObservertypeclass. - JVM Performance & Benchmarking Suite: A JMH benchmark suite has been created to measure and guard against performance regressions on the JVM. This suite will be expanded to include Scala Native in a future release.
- Cross-Platform Support (JVM + Native): The initial work to build and deploy validations consistently across both JVM and Scala Native platforms has been completed.
- Unified Testing with
valar-munit: The newvalar-munitextension provides a premier, assertion-driven testing experience.
Major Enhancements:
- Improved Macro-Derivation Engine: The existing macro for deriving validators has been completely rewritten for significantly improved performance and faster compilation times. This new engine (
Validator.deriveandAsyncValidator.derive) automatically populates errors with rich contextual details like field paths and types. - Expanded Type Support: Native validation for complex data structures like
union typeshas been added. - Public
ErrorAccumulatorAPI: The powerfulErrorAccumulatortypeclass is now a public, core feature, allowing developers to implement custom error-handling strategies.