Show HN: JSX in Browser with Sucrase (altbdoor.github.io)

2 points by altbdoor ↗ HN
Been working on a number of React projects, and was intrigued a little by JSX. I wanted to make running JSX in browser easier, so I tried my hand at using a service worker, to transpile JSX on the fly.

I started with @babel/standalone, but the library was heavy enough to notice a delay on the browser. I found out about sucrase a little later, and tried building it for the browser, and voila!

Didn't really thoroughly test if everything JSX is supported, but it seems fine for small learning or prototyping.

2 comments

[ 1554 ms ] story [ 902 ms ] thread
This is really cool. Do you also plan to show the code before compilation / allow it to be edited and be compiled on your demo page?
Thanks. As for the code compilation, that can be tested and seen in https://sucrase.io/

The demo page is only to show how we can transpile JSX in browsers.