-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Consider making more dependencies opt-in #58
Comments
These are the stats by dependency:
It looks like the big difference would be Redactions might be easier to make optional, but it doesn't look like it would have a large impact. Any of the others look like there's potential @matklad ? |
Hm, If I sum the three
It is used by |
Right right, I agree that's something!
Ah interesting. Do you know whether there's a way of measuring the |
from |
Thanks. Is there a way of confirming whether that's the only case? (Or can you at least estimate that?). I could do a PR to change |
More than happy to drop failure. |
So getting rid of |
Agree that getting rid of serde it's not very important, that's why I didn't list it as a suspicious dependency. I am more concerned about
|
So I made RON optional now which was easy. Originally yaml was not used for the on disk serialization but that made it really hard to consume the snapshots from other tools and yaml is too hard to implement yourself. Not sure what a good way here is. |
Yeah, interop with other tools is a good reason for yaml, haven't realized that that's important. The subset of yaml insta actually uses still looks relatively simple and hand-rollable, but not trivially hand-rollable:
|
FWIW |
I stand corrected, thanks! According to tokei and quick look with a naked eye, |
This is what it looks like now. I don't think it can be cut down further without removing chrono which is tricky:
|
Nice, thanks! Note that I've already send a PR to uuid to bump rand to 0.7, which should further reduce deps and remove duplication with other modern rand users. The PR was merged, but I don't know when the next release of uuid is scheduled. |
I am trying to find time to release |
At the moment, insta library pulls quite a few deps. Specifically, in my Cargo.lock I see
insta is
dev-dependency
, so those transtive deps don't leak into the final executable, but they still affect compile time and the size of the./target
dir, making overall CI time larger.I think I understand why each of those dependencies is there, but, at the same time, some of them look like that could have been avoided or made optional.
Specifically:
json
,yaml
andron
are kind of the same thing, perhaps serialziation formats can be opt-in?pest
is used for redactions, but it's a heavy dependency, could redactions be made a feature?failure
slightly out of place in the library, perhaps sticking with std::error will work?ci_info
looks pretty entreprisy, Cargo just checks two env vars: https://github.com/rust-lang/cargo/blob/1dd02155c988707b3e12606f52b29a90c76520dd/src/cargo/util/mod.rs#L86-L89chrono
is also heavy, and, I think, it is only used to format time in snap files. In this case, I don't know how to improve this, except for removing the time field altogether.The text was updated successfully, but these errors were encountered: