Skip to content

Conversation

@bendavis78
Copy link

When building a WASM module that uses zxcvbn-rs, I found I was able to reduce the build size by roughly 25% by setting the regex and fancy-regex package features to use only standard library support, and avoid using unicode character classes such as \s.

This PR replaces \s with \t\r\n in MAYBE_DATE_WITH_SEPARATOR_REGEX, and sets features = ["std"] on the regex and fancy-regex dependencies.

See here for more info on this optimization for the regex dependency: https://github.com/rust-lang/regex?tab=readme-ov-file#crate-features.

@shssoichiro
Copy link
Owner

Looks like there's a feature missing on one of the dependencies, that's conditionally required for wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants