Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regex-automata dependency #3

Closed
link2xt opened this issue Jul 19, 2023 · 6 comments · Fixed by #5
Closed

Update regex-automata dependency #3

link2xt opened this issue Jul 19, 2023 · 6 comments · Fixed by #5

Comments

@link2xt
Copy link

link2xt commented Jul 19, 2023

This crate still dependends on regex-automata 0.1, but the latest version of regex-automata is 0.3.3.

@matthiasbeyer
Copy link

Bumping this. I just found this by analyzing a project with cargo-bloat and the regex crates make up a large portion, especially regex-automata (which is included twice because this crate still depends on the old version).

@smalis-msft
Copy link

Just hit this too. Also noticed the last commit here was 2 years ago, is this crate still maintained?

@link2xt
Copy link
Author

link2xt commented Aug 9, 2023

cc @hawkw

@hawkw
Copy link
Owner

hawkw commented Aug 9, 2023

This crate did not update to regex-automata v0.2 because that release's documentation stated that it was not suitable for use in most cases and existing dependencies should remain on v0.1.

I'll investigate updating to v0.4.

@smalis-msft
Copy link

smalis-msft commented Aug 22, 2023

Do you mean v0.3? v0.4 isn't out yet. Or do you mean you're not planning to update until a future v0.4 is released? v0.3 doesn't contain the warning documentation that v0.2 did.

@hawkw
Copy link
Owner

hawkw commented Aug 22, 2023

Do you mean v0.3? v0.4 isn't out yet. Or do you mean you're not planning to update until a future v0.4 is released? v0.3 doesn't contain the warning documentation that v0.2 did.

My bad, that was a typo.

@hawkw hawkw closed this as completed in #5 Jul 1, 2024
hawkw pushed a commit that referenced this issue Jul 1, 2024
This updates to use regex-automata v0.4, bumping the crate to 0.2 since
regex-automata is a public dependency of the crate. All tests in this
crate continue to pass.

This removes the `ToMatcher` trait in favor of directly using the
upstream Automaton trait, it didn't seem like that trait was really
being used. As of the current PR, there's no way to construct Patterns
with the sparse DFA (this seems to have been true of the prior version
of the crate too), but all the functionality is generic over
[regex_automata::Automaton](https://docs.rs/regex-automata/latest/regex_automata/dfa/trait.Automaton.html),
so just adding constructs for the lazy DFA would be enough to make it
possible to use.

This also reduces the enabled features on regex-automata to not include
unicode features. It's not obvious that downstream crates (in particular
tracing-subscriber) want to pay the binary size cost for having those
enabled in env-filter regexes, and this leaves the choice up to them.

Closes #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants