-
Notifications
You must be signed in to change notification settings - Fork 736
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
feature request: support swc #555
Comments
It seems to have it right in the tree you provided: https://github.com/swc-project/swc/tree/master/wasm. If you can find or publish an npm package for bindings (see my https://github.com/RReverser/astexplorer-syn for an example), it should be fairly straightforward to integrate into ASTExplorer. |
Indeed, |
…orted > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
…orted > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
> swc is a super-fast compiler written in rust; producing widely-supported > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
I've pushed a WIP pr #556 that has the following known issues:
Thinking it could be WebAssembly shenanigans, I've tried wrapping the Aside from that, it was really easy to integrate in AST Explorer, ✨ magic ✨ ! |
Glad you liked it :) I've set it up a long time ago, and sometimes felt bad about all the Webpack magic it's doing, but it does seem to make contributions easier. |
> swc is a super-fast compiler written in rust; producing widely-supported > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Add a swc transformer, accepting a config object (see https://swc.rs/docs/configuring-swc). Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
> swc is a super-fast compiler written in rust; producing widely-supported > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Add a swc transformer, accepting a config object (see https://swc.rs/docs/configuring-swc). Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
A first version of I've started working on a swc transformer, and it was just as easy as adding a parser to AST Explorer (yay!). :) I'll update the PR to include this transformer, and I've prepared another PR (#557) to replace For now, the transformer accepts a JSON object. I think swc-project/swc#1275 is needed before full-fledged plugins can be written, as they'd rely on cc @9oelM |
@punkeel hi! It seems that swc does not run something like a nightly build, which is the reason I had to build web wasm of swc myself and manually include it in 9oelm.github.io/swc-wasm-demo. It'd be great if swc would support nightly build (I'm open to helping if possible, too), although I'm not sure if this is the proper repo to talk about this 😅 Also i find that we got a lot to work on the wasm side of swc like what you said |
> swc is a super-fast compiler written in rust; producing widely-supported > javascript from modern standards and typescript. Expose the swc parser in AST Explorer. This parser is built using Rust, and the client side version relies on WebAssembly. Add a swc transformer, accepting a config object (see https://swc.rs/docs/configuring-swc). Known bug: any action (editing the code or changing a setting) breaks the Autofocus feature, and requires a page reload. Closes fkling#555.
@9oelM TLDR - Is the swc type for ASTExplorer is fully working? And if so, how do I get an access to it? Any PR open or something? |
Given that the following PR has been merged and |
Currently "Autofocus" does not work when |
swc is a serious project with 10k stars on GitHub. It is used in Deno to transpile TypeScript code into JS. I'm not 100% sure, but there may be a WebAssembly version exposing parse / codegen functions.
It would be great to add support for swc in astexplorer.
cc @kdy1
The text was updated successfully, but these errors were encountered: