coffee-react-transform icon indicating copy to clipboard operation
coffee-react-transform copied to clipboard

CJSX -> JSX

Open chrisvfritz opened this issue 10 years ago • 2 comments

Is it possible to compile CJSX to JSX? The reason is when I'm showing React to non-CoffeeScripters, I'd like to make it easier see for them to see which weird code is CS and which weird code is JSX. :smiley:

chrisvfritz avatar Apr 30 '15 23:04 chrisvfritz

I'm really in favour of this idea, although only for the purpose of documentation generation. All the tools that generate documentation for React components only expect JSX files, but this tool outputs only JS files. Now using JsDoc or something like that is possible, but then you lose the ability to generate documentation from the code as well, not only the comments

abejfehr avatar Feb 21 '16 09:02 abejfehr

You could try applying the React.createElement->JSX codemod to the compiled output. See here: https://github.com/reactjs/react-codemod/

On Sun, 21 Feb 2016 at 8:11 PM, Abe Fehr [email protected] wrote:

I'm really in favour of this idea, although only for the purpose of documentation generation. All the tools that generate documentation for React components only expect JSX files, but this tool outputs only JS files. Now using JsDoc or something like that is possible, but then you lose the ability to generate documentation from the code as well, not only the comments

— Reply to this email directly or view it on GitHub https://github.com/jsdf/coffee-react-transform/issues/51#issuecomment-186778515 .

jsdf avatar Feb 21 '16 20:02 jsdf