CoffeeTags
CoffeeTags copied to clipboard
Add support for ReactJS for classes
Hi,
first of all... this plugin is great !!! So bravo !!!
I'm using CoffeeScript with ReactJS.
Is it possible to add the following templates as a "class" ?
module.exports = Edit = React.createClass
But most of the time I'm using this little trick
module.exports = exp = {} [...] exp.Edit = Edit = React.createClass
Or can I had it myself somewhere ? Sorry I never used Rails :(
Best regards
Hi! Thanks for the kind words!
Looks like this issue is related to https://github.com/lukaszkorecki/CoffeeTags/issues/29
Once I get some spare time I will look into this.
As for contributing - please have a go, I will help you out as much as I can if you prepare a pull request. Ruby is not that hard to learn, although I have to admit that CoffeeTags' code is messy in couple of places.
By chance are you using coffee-react for the JSX transpilation or are you using the escape it with backticks approach? Or are you just not using the JSX support?
I'd like to extend this issue to include files ending in *.cjsx to the parsed files.
Ok, my initial stab at cjsx support is rather rudamentary in that it only includes cjsx files to the default files found with the recursive flag. Here is some example output so far:
The only thing it has picked up and should not have was the className
attribute on the cjsx div
element. This is something I can live with for now, but we would need to add something to exclude those cjsx portions of the code from the parser. It may make more sense to build out some plug for this as opposed to mucking up the existing parser geared exclusively for vanilla CoffeeScript. I have pushed up the code on the react branch on this repo. Thoughts?
Hi, no I'm notre using Jsx :( but I think that your stab should work for simple coffeescript and react ?
Best regards