Skip to content

Releases: hakimjonas/valar

v0.6.0

22 Nov 11:17
v0.6.0

Choose a tag to compare

Version 0.6.0 Release notes

Breaking Changes

  • Pass-through validators: Built-in validators for Int, String, Float, Double now accept all values
  • Constraints are opt-in via ValidationHelpers: nonNegativeInt, nonEmpty, finiteFloat, finiteDouble
  • See MIGRATION.md for upgrade instructions

Internal Improvements

  • Eliminated Validator/AsyncValidator code duplication with internal F[_] abstraction
  • Upgraded to Scala 3.7.4 with modern inline metaprogramming
  • Added ValidationConfig for collection size limits (DoS protection)

Documentation

  • Added migration guide for v0.5.0 → v0.6.0
  • Added design.md and
    examples.md
  • Updated README with pass-through validator documentation

Installation

libraryDependencies += "net.ghoula" %%% "valar-core" % "0.6.0"

v0.5.0 - Advanced Features

11 Jul 18:15
v0.5.0
da2f39c

Choose a tag to compare

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 AsyncValidator typeclass has been introduced to support validators that return a Future, allowing for non-blocking, I/O-bound validations.
  • Internationalization (i18n): A new valar-translator module provides a mechanism for translating ValidationError messages 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 the ValidationObserver typeclass.
  • 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 new valar-munit extension 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.derive and AsyncValidator.derive) automatically populates errors with rich contextual details like field paths and types.
  • Expanded Type Support: Native validation for complex data structures like union types has been added.
  • Public ErrorAccumulator API: The powerful ErrorAccumulator typeclass is now a public, core feature, allowing developers to implement custom error-handling strategies.

v0.3.0 - Scala 3.7 Support

09 Jun 13:44
v0.3.0
070d7a7

Choose a tag to compare

Valar 0.3.0 - Scala 3.7 Support

This release adds full support for Scala 3.7, focusing on two key enhancements:

Named Tuples Support

Valar now supports Scala 3.7's named tuples, providing field-aware error messages that significantly improve debugging:

  • Error messages include actual field names instead of generic positional indices
  • Zero runtime overhead with compile-time field name extraction
  • Complete backward compatibility with regular tuples

Example:

// Define a named tuple type with meaningful field names
type PersonTuple = (name: String, age: Int, email: String)

// Validation works with improved error messages
val invalidPerson: PersonTuple = (name = "", age = -10, email = "bad-email")
val result = summon[Validator[PersonTuple]].validate(invalidPerson)

// Error messages now include actual field names:
// Field: name
// Error: Invalid field: name, field type: String: Name must not be empty
// Field: age
// Error: Invalid field: age, field type: Int: Age must be non-negative, got -10

## Givens Prioritization Handling

This release addresses breaking changes in Scala 3.7's givens prioritization algorithm:
Added safeguards to ensure consistent validator resolution
Updated documentation with guidance on handling potential conflicts
Maintains backward compatibility with existing code
Compatibility
Requires Scala 3.7+
Zero external dependencies


## Installation

```scala
libraryDependencies += "net.ghoula" %% "valar" % "0.3.0"

v.0.2.6

23 Apr 09:55
v0.2.6
1b9a0ee

Choose a tag to compare

We start at 0.2.6 because I still have lots to learn about CI and publishing. But the library is I believe ready for field testing.

A change log does not make much sense at this point. So take this as a first release.