predicates-rs icon indicating copy to clipboard operation
predicates-rs copied to clipboard

Disable default regex features

Open jirutka opened this issue 2 years ago • 2 comments

To avoid infecting the dependency graph with potentially unwanted regex features. If the user wants extra regex features, they should enable them in their project (e.g. just add a dependency on "regex" with default features enabled).

PR #143

jirutka avatar May 09 '23 12:05 jirutka

This would be a welcome change, as regex features are a nice low-hanging fruit when reducing bloat.

I wonder about perf-* features vs unicode-* features though: while a missing unicode feature will probably show up during testing and the devs will realize that they need to opt in, a missing perf feature might just silently make the binary or the unittests slower. Since they don't cause as much binary bloat (just longer compile times), maybe it makes sense to leave those in for predicate-rs.

vincentdephily avatar May 11 '23 11:05 vincentdephily

This is a tough one because

  • This is a subtle breaking change (runtime behavior, rather than APIs)
  • I'd rather not people have to depend on regex to get the features they want but I also don't want to re-exporting
  • In a lot of cases, I can see someone wanting things to "just work" and adding extra hoops could be frustrating.

I think I'd be more inclined to make the regex feature off by default instead. That could also possibly be done in mockall, I'm not aware of its design to say whether it needs it or not (which is how starship is pulling in predicates, I presume)

epage avatar May 18 '23 19:05 epage