-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
feat(transformer): add transform-typescript
boilerplate
#2866
feat(transformer): add transform-typescript
boilerplate
#2866
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4edbbfe
to
fb1f63b
Compare
CodSpeed Performance ReportMerging #2866 will not alter performanceComparing Summary
|
A plugin can be turned off, we haven't decided which one is better: pub struct Transformer<'a> {
typescript: Option<TypeScript>,
} or #[derive(Debug, Default, Clone)]
pub struct TransformOptions {
pub typescript: Option<TypeScriptOptions>,
} A |
Aren't they both needed? A |
True. I was thinking about eliminating I'll do some follow up PRs. |
Well, I guess we can have the plugin options set to default when it's disabled but It means that we need to have some other way to configure our list of plugins. What is your alternative for it? When fetching the options to initialize the transformer we need to return None anyway in order to notify the Transformer to not create this plugin. |
You mean when calling the transform methods inside our main Transformer? |
The previous version had something like this all over the place self.es2021_logical_assignment_operators.as_mut().map(|t| t.add_vars_to_statements(stmts));
self.es2020_nullish_coalescing_operators.as_mut().map(|t| t.add_vars_to_statements(stmts));
self.es2016_exponentiation_operator.as_mut().map(|t| t.add_vars_to_statements(stmts));
self.es2015_arrow_functions.as_mut().map(|t| t.transform_statements(stmts)); I was thinking about changing it to self.es2021_logical_assignment_operators.add_vars_to_statements(stmts); And hide the This seems like a burden to plugin authors, not a really good idea. I'll bike-shed this a bit later. |
Yes, we have to wait to make the call on this one until the mutability is figured out, Since as we discussed in here we might need a macro for applying the transformation which can also be used to hide these checks. |
No description provided.