-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(codegen): remove non_exhaustive on Config #8113
Conversation
@kwonoj Any thoughts about this? It was a noticable maintenance burden |
@@ -5,7 +5,6 @@ use swc_ecma_ast::EsVersion; | |||
#[derive(Debug, Clone, Copy)] | |||
#[cfg_attr(feature = "serde-impl", derive(Serialize, Deserialize))] | |||
#[cfg_attr(feature = "serde-impl", serde(rename_all = "camelCase"))] | |||
#[non_exhaustive] |
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.
@kdy1 I'm a little confused about the maintenance burden of not having this. It seems like this struct rarely ever changes?
Of those, it seems like it's changed one time per year, so it just requires a minor version bump on update, especially if all downstream swc crates do not use the struct expression.
Overall, it's not a big deal to have this, I just personally think it's a much better API for consumers to use the struct expression, which is why I opened this PR.
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 made fewer changes to avoid breaking changes.
pub fn preamble(&mut self, s: &str) -> Result { |
I think this should go into the Config
struct, but I didn't want a breaking change.
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.
There were many similar situations IIRC
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.
Ok, I thought there's a script in swc that automatically updates all the versions on a breaking change. I'll close this PR.
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.
Versions in Cargo.toml
are automatic, but actually the problem is that I don't have control over mdxjs-rs
and I have to wait for a long time.
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.
Oh, yeah I just re-read your other comment.
It is incredibly useful to create
Config
using a struct expression in order to be notified about any config changes and to set the config exactly how the consumer would like.