-
Notifications
You must be signed in to change notification settings - Fork 748
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
[WIP] Add swc JavaScript parser #556
Conversation
bd4fcf6
to
a07820a
Compare
Looks like npm moudle missing files. ERROR in ./node_modules/@swc/wasm-web/wasm.js
Module not found: Error: Can't resolve './wasm_bg.js' in '/workspace/astexplorer/website/node_modules/@swc/wasm-web'
@ ./node_modules/@swc/wasm-web/wasm.js 2:0-29 2:0-29
@ ./src/parsers/js/transformers/swc/index.js
@ ./src/parsers sync ^\.\/(?!utils|transpilers)[^/]+\/(transformers\/([^/]+)\/)?(codeExample\.txt|[^/]+?\.js)$
@ ./src/parsers/index.js
@ ./src/storage/gist.js
@ ./src/app.js |
Yup, a new |
> 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.
a07820a
to
86b48eb
Compare
Still not ok ;( |
The publish npm is still broken, you can delete |
What's the current state of this? Can I do anything to help? Or do you just want me to take a look at the parser wrapper? |
I think next release will swc will fix the build issue since the fix pr merged. Not sure the focus issue still exists ? @punkeel |
Hey there, This PR is still blocked by The focus issue still exists, the bug is reproducible across reloads/builds, just introduce Syntax Errors in the snippet, and the focus stops working until the page is reloaded. I haven't been able to pinpoint a reason for it. |
@punkeel hey, curious if I can dig in more and google for workarounds but wondering if you were still interested in getting this merged - I think it'd be really useful as I and likely many others are starting to explore
|
Merged as part of f6a399b |
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 #555.