musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Add support for compiling files containing JSX #45

Open jmarr opened 9 years ago

jmarr commented 9 years ago

My app is using oj for model and controller code and React for rendering the UI. React supports JSX, so most of our UI components are JSX files.

Right now, we can't use oj objects in our jsx files because the oj complier doesn't understand jsx and the jsx compiler doesn't understand oj.

If the oj compiler could handle jsx files, then we could use oj objects in our jsx files.

iccir commented 9 years ago

This would involve 4 steps: 1) Integrate the JSX tokenizer from esprima-fb or espree. 2) Integrate the JSX parser from esprima-fb or espree. 3) Finish #44 and allow JSX AST nodes to pass through 4) Find a code generator that supports JSX (escodegen doesn't appear to have any forks with jsx support)

iccir commented 5 years ago

Esprima 3.0 included JSX support. Since #44 is unlikely to happen, this is theoretically doable today.