fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.05k stars 711 forks source link

⚛️ Add DataFormsJS JSX Loader #631

Open ConradSollitt opened 2 years ago

ConradSollitt commented 2 years ago

This pull request is for a JSX Compiler.

It's in a separate category from JavaScript because this compiler only handles JSX rather than running as a full JS compiler. The compiler understands some JS syntax (enough to handle JSX), however JS code ends up in separate "js" nodes in the AST.

The reason it exists is because it allows for compiling/transpiling of JSX to JS in a web browser at run-time without a build process and at less than 7 kB the compiler is very small and fast.

Documentation https://github.com/dataformsjs/dataformsjs/blob/master/docs/jsx-loader.md

Main Site with Examples This main site includes additional components and non-React code so I link to the main JSX Loader Doc on this Pull Request. https://dataformsjs.com/en/

Additional Site with more Examples https://awesome-web-react.js.org/

Code Sample The code sample I used is from the homepage of the main React Site. The only change I made was to change TODO text to To Do List so that the file does not show up if searching for TODO comments in this project. https://reactjs.org/

Screenshot

AST Explorer with DataFormsJS JSX Loader