Put all of serde behind feature flag#360
Conversation
chinedufn
left a comment
There was a problem hiding this comment.
Happy to make any changes that you want to see to get this merged.
Thank you!
8a33964 to
be5af30
Compare
Cargo.toml
Outdated
| cli = ["clap", "serde_json", "browserslist", "jemallocator"] | ||
| grid = [] | ||
| serde = ["smallvec/serde", "cssparser/serde"] | ||
| with-serde = ["serde", "smallvec/serde", "cssparser/serde"] |
There was a problem hiding this comment.
This is a breaking change.
We could make it non-breaking by enabling the with-serde feature by default and having a serde = [] feature, but that would enable small-vec/serde and cssparser/serde, which are not currently enabled by default.
Not sure whether or not that is an issue.
It looks like lightningcss is on an alpha train.
Is a small breaking change here acceptable?
Unless serde is commonly used by lightningcss' users, I think it makes sense to have it be disabled by default.
(Using the feature flag name "serde" as serde = ["serde", "smallvec/serde", "cssparser/serde"] wasn't possible since you can't define a feature flag with the same name as a dep.)
There was a problem hiding this comment.
I was able to rename it back to serde by doing this:
serde = ["dep:serde", "smallvec/serde", "cssparser/serde"]
|
We might need to split this into two features. At the moment, this will break the Node bindings which depend on the currently not feature flagged serde derived traits. The currently flagged ones are for additional serialization support, e.g. if you wanted to serialize the whole AST. If you run |
be5af30 to
6e83bfa
Compare
|
Got it thanks for explaining. I timed builds with and without all of the derives enabled and enabling them all added quite a bit to build time (15+ seconds for me). So, makes sense. I've added a
All other serde derives are only enabled when the The |
|
Anything I can do to help this land so that it doesn't collect merge conflicts? |
This commit makes the "serde" dependency completely optional. Related: parcel-bundler#357
ccb31b6 to
48ee25f
Compare
0cca6a0 to
fc2d411
Compare
This commit makes the "serde" dependency completely optional.
Related: #357