Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

Shift -> Babel AST#545

Open
gabejohnson wants to merge 2 commits into
sweet-js:masterfrom
gabejohnson:ast-to-babel
Open

Shift -> Babel AST#545
gabejohnson wants to merge 2 commits into
sweet-js:masterfrom
gabejohnson:ast-to-babel

Conversation

@gabejohnson

@gabejohnson gabejohnson commented May 14, 2016

Copy link
Copy Markdown
Member

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.

@gabejohnson

Copy link
Copy Markdown
Member Author

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.

Comment thread src/load-syntax.js Outdated
// let result = babel.transform(wrapForCompiletime(estree, sandboxKeys));
let gen = codegen(parsed, new FormattedCodeGen);
let result = context.transform(gen, {
// let gen = codegen(parsed, new FormattedCodeGen);

Copy link
Copy Markdown
Member

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

@disnet

disnet commented Jun 1, 2016

Copy link
Copy Markdown
Member

What's the current status on the npm package?

@gabejohnson

gabejohnson commented Jun 1, 2016

Copy link
Copy Markdown
Member Author

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?).

@gabejohnson

Copy link
Copy Markdown
Member Author

@bakkot said he'd take a look at it next week.

@gabejohnson

Copy link
Copy Markdown
Member Author

I pinged @bakkot a couple of weeks ago, but still haven't heard back.

@michaelficarra

Copy link
Copy Markdown

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.

@gabejohnson

Copy link
Copy Markdown
Member Author

No worries @michaelficarra. Understood. Thanks for the update 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants