Replies: 2 comments
-
Hey @skeggse! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
Beta Was this translation helpful? Give feedback.
-
Yes, this is definitely out-of-scope. However, if you want to fork export function myPlugin() {
return {
parserOverride(code, opts) {
return parseWithCustomFork(code, opts);
},
};
} You can see how |
Beta Was this translation helpful? Give feedback.
-
Feature Request
Describe the solution you'd like
I'd like to add support for a
defer
keyword to the babel parser, default disabled. This is well outside the scope of any standards proposals, so I'm not sure what the policy is concerning such features in the babel parser. I'd love to be able to write a babel plugin to implement golang-styledefer
functionality in babel, and it'd be neat to be able to use an actualdefer
statement. It should be a pretty small lift, considering it'd only be valid at the start of a Statement, and wouldn't require the addition of a new reserved keyword (similar toasync
).Describe alternatives you've considered.
It's entirely possible to simply implement this without the keyword. Making
defer <id>
a valid statement is just style points. Prior art. Happy to accept this is "out of scope" for babel's parser.Documentation, Adoption, Migration Strategy
If you can, explain how users will be able to use this and how it might be documented. Maybe a mock-up?
@babel/plugin-syntax-defer
, or something similar.Beta Was this translation helpful? Give feedback.
All reactions