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

feat: Add regex feature flag #93

Merged
merged 2 commits into from
Aug 3, 2024
Merged

Conversation

LucasPickering
Copy link
Contributor

First off, love this library, thanks for it. For my use case I don't really need the regex functions, and it's a really large dependency to pull in (adds ~8s to my build process).

This change hides the regex functions (match and search) behind a feature flag regex, which is enabled by default. This allows consumers to completely eliminate regex as a dependency if they choose. Also added some docs on feature flags.

I wasn't sure if I should update the changelog since it looks like it might be auto-generated from git cliff, let me know what you'd like.

Copy link
Owner

@hiltontj hiltontj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LucasPickering - thanks for the PR, this is a great idea! I am on vacation this week so when I am back next week I will take a closer look and can cut this into a release.

I think this might need to be a 0.7.0 release, since anyone using default-features = false to disable the "functions" feature would potentially break things.

As for the changelog, I have been updating that manually. You are welcome to update it on this PR if you want or I can do it in a follow-on PR.

@LucasPickering
Copy link
Contributor Author

@hiltontj I agree about the breaking change, it would be an easy upgrade but still deserves 0.7. I'll add to the changelog. Incidentally I realized I no longer need this flag because I ended up pulling regex into my project as part of an unrelated dependency, but this might still be helpful for others 😛

This hides the regex functions (`match` and `search`) behind a feature flag `regex`, which is enabled by default. This allows consumers to completely eliminate regex as a dependency if they choose.

Also added some docs on feature flags.
Copy link
Owner

@hiltontj hiltontj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thank you for updating the changelog as well!

@hiltontj
Copy link
Owner

hiltontj commented Aug 3, 2024

Oh shoot, the docs link to tracing in the feature flags section is broken -perhaps because tracing is behind a non-default feature flag? Either way, you could probably just link to the latest tracing docs directly: https://docs.rs/tracing/latest/tracing/

serde_json_path/src/lib.rs Outdated Show resolved Hide resolved
@hiltontj hiltontj merged commit 80cb632 into hiltontj:main Aug 3, 2024
5 checks passed
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