DEV Community

Discussion on: React development setup with just a single file!

Collapse
 
conradsollitt profile image
Conrad Sollitt

It's a single 1547 line JavaScript file (source link below) that is a small hand-written compiler for JSX only. It doesn't understand JavaScript at all and only knows how to convert JSX to JS for modern browsers only. For unsupported Browsers (mainly IE 11 and Old Safari/iOS as of 2020) the script then downloads the full 1.5 MB Babel Standalone and uses that instead.

The full file source is actually about 77 kb however when using the *.min.js file and gzipped it's down to about 5.7 kb.

I’ve been planning on sharing it on dev.to but haven’t been able to make the time for it yet. Hopefully soon or perhaps if other people see this they might want to try it out and write about it.

Source Code
github.com/dataformsjs/dataformsjs...