Skip to content

v0.16.3

Compare
Choose a tag to compare
@jprochazk jprochazk released this 26 Nov 15:55
· 94 commits to main since this release

Smaller Wasm bundles via js-sys

If the js-sys feature is enabled, #[garde(pattern)] will now use js_sys::RegExp instead of regex::Regex on the wasm32-unknown-unknown target. This usually means massive bundle size savings depending on which features you need. The two regex implementations aren't fully compatible, which is why it is opt-in via a feature.

Contributed by @aumetra in #77

Support for newtypes

#[derive(garde::Validate)]
#[garde(transparent)]
struct Username(#[garde(length(min = 3, max = 20))] String);

#[derive(garde::Validate)]
struct User {
    // later used with `dive`:
    #[garde(dive)]
    username: Username,
}

See README.md for more information.

Breaking changes

There were no breaking changes in this release.

Full Changelog: v0.16.2...v0.16.3