Skip to content
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

react-runner-with-swc (Need to create a new branch) #166

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Mrxyy
Copy link

@Mrxyy Mrxyy commented Jul 6, 2023

  • You can compile the code to ES5

@vercel
Copy link

vercel bot commented Jul 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
playground ❌ Failed (Inspect) Jan 5, 2024 4:46pm
react-runner ❌ Failed (Inspect) Jan 5, 2024 4:46pm
react-runner-codemirror ❌ Failed (Inspect) Jan 5, 2024 4:46pm

@nihgwu
Copy link
Owner

nihgwu commented Jul 6, 2023

what's the motivation?

@Mrxyy
Copy link
Author

Mrxyy commented Jul 7, 2023

SWC can compile lower-level code to support more browsers.

@nihgwu
Copy link
Owner

nihgwu commented Jul 7, 2023

This package supports modern browsers(ES6), don't think WASM has broader support, and we use sucrase instead of Babel for smaller bundle size, I believe SWC will bloat it a lot(although it's loaded separately), and sucrase is already fast enough and maybe faster than swc in this case because of runtime of WASM

@Mrxyy
Copy link
Author

Mrxyy commented Jul 7, 2023

This package supports modern browsers(ES6), don't think WASM has broader support, and we use sucrase instead of Babel for smaller bundle size, I believe SWC will bloat it a lot(although it's loaded separately), and sucrase is already fast enough and maybe faster than swc in this case because of runtime of WASM

My use case is as follows: I created a custom component on our low-code platform in the modern browser environment of the canvas editing mode. However, when the application is actually deployed, there is no code compilation process and instead it uses the previously compiled results.

@Mrxyy
Copy link
Author

Mrxyy commented Jul 7, 2023

This package supports modern browsers(ES6), don't think WASM has broader support, and we use sucrase instead of Babel for smaller bundle size, I believe SWC will bloat it a lot(although it's loaded separately), and sucrase is already fast enough and maybe faster than swc in this case because of runtime of WASM

My use case is as follows: I created a custom component on our low-code platform in the modern browser environment of the canvas editing mode. However, when the application is actually deployed, there is no code compilation process and instead it uses the previously compiled results.

It is indeed inappropriate to do so when running in a browser.
Some popular grammar can be supported in SWC. .e.g:
https://github.com/alangpierce/sucrase#unsupported-syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants