-
Notifications
You must be signed in to change notification settings - Fork 192
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
Put all of serde behind feature flag #360
Put all of serde behind feature flag #360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to make any changes that you want to see to get this merged.
Thank you!
8a33964
to
be5af30
Compare
Cargo.toml
Outdated
@@ -61,7 +61,7 @@ default = ["grid"] | |||
browserslist = ["browserslist-rs"] | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This commit makes the "serde" dependency completely optional.
Related: #357