3 ms·
Show HN: JSX in Browser with Sucrase
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.
- peey 3y agoThis 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?
- altbdoor 3y agoThanks. As for the code compilation, that can be tested and seen in https://sucrase.io/ https://sucrase.io/ The demo page is only to show how we can transpile JSX in browsers.