-
Notifications
You must be signed in to change notification settings - Fork 211
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
Shift -> Babel AST #545
base: master
Are you sure you want to change the base?
Shift -> Babel AST #545
Conversation
It the PR is accepted, I'll have to talk to the people at Shape Security about what to do with my fork of their lib. |
@@ -83,8 +85,8 @@ function loadForCompiletime(expr, context) { | |||
// let result = transform.fromAst(wrapForCompiletime(estree, sandboxKeys)); | |||
|
|||
// let result = babel.transform(wrapForCompiletime(estree, sandboxKeys)); | |||
let gen = codegen(parsed, new FormattedCodeGen); | |||
let result = context.transform(gen, { | |||
// let gen = codegen(parsed, new FormattedCodeGen); |
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.
You can kill this comment
What's the current status on the npm package? |
I submitted shapesecurity/shift-spidermonkey-converter-js#17 last week. It would allow Shape Security to host the base converter and then I could host an extension targeting Babel. I'm waiting to hear back from @michaelficarra. I have the Babel extension written and will publish it pending the PR's acceptance and a new published version of shift-spidermonkey-converter (shift-estree-converter?). |
@bakkot said he'd take a look at it next week. |
I pinged @bakkot a couple of weeks ago, but still haven't heard back. |
Sorry about that @gabejohnson. Our current work has taken our focus off the Shift tooling for the time being, and @bakkot will be on hiatus for the next few months, but I promise you we'll get to your PR as soon as we can focus on the Shift tooling again. The ESTree converter is lower on our priority list since it's the only Shift tool we don't actually use in-house at @shapesecurity. But we really appreciate your contributions. |
No worries @michaelficarra. Understood. Thanks for the update 🙏 |
This pull request addresses #515. It enables conversion from the Shift AST format used in sweet.js to the Babel format using a fork of shift-spidermonkey-converter: https://github.com/gabejohnson/shift-spidermonkey-converter-js/tree/babel.
The conversion allows Sweet to avoid generating code and passing that code to Babel to be re-parsed.