Closed weiznich closed 1 year ago
Minimizing deps would be great!
A few things I think could be interesting to consider:
@kturney I filled #30 with the necessary changes.
I am supportive of splitting the library and the binary as well as feature-gating test-util
.
What is the rational for creating a crate for each language though? As far as cargo
is concerned, each of them is a single source file (with no language-specific dependency crate, most likely). Is it about the size of the library due to included data blobs? Or is it just for versioning purposes?
@kturney @weiznich
Pros:
Cons:
Maybe just splitting the library and binary would get us 80% of the benefits? It just sounds conceptually nice to me for each language and runtime to be given its own package.
What is the rational for creating a crate for each language though?
I just more or less blindly implemented the proposal from @kturney. There is no special reasoning from my side here.
In the short term, I would prefer to only split the library and the binary to minimize the disruption for other users. I'm also ok to introduce feature flags for each language (defaulting to all of them).
@ma2bd I've updated the PR to follow your suggestions.
🚀 Feature Request
Motivation
cargo tree
currently reports the following dependencies forserde-generate
:Ideally
serde-generate
would provide an API that put dependencies behind different feature flags, so that not everything is required if only a small part of the crate is used.Especially that includes the following dependencies:
structopt
as that's not needed ifserde-generate
is used as dependencybcs
andbincode
as sometimes you want to use one or the otherserde_yaml
as it's not always required to build ayaml
representation of the corresponding typesI'm not sure about other dependencies like
textwrap
,heck
,serde_bytes
,include_dir
,maplit
andphf
.Pitch
Describe the solution you'd like Put parts of the API behind feature flags, so that users can choose what to use + what gate corresponding dependencies on these flags.
Describe alternatives you've considered
Do not change anything and pull in potentially unneeded dependencies.
Are you willing to open a pull request? (See CONTRIBUTING)
I would be willing to contribute a PR for that
Additional context