This tool is no longer maintained. If you need to transition your codebase from it, a codemod is available to do so: cjsx-codemod
This project started as a way for me to explore how JSX could fit into Coffeescript syntax, as a quickly hacked together prototype. While I never really promoted it, it quickly took on a life of its own, and before long people were asking for it to support all kinds of different use cases. On top of that I had no experience writing parsers, so the result is something with insurmountable limitations.
As I eventually stopped using Coffeescript I ended up neglecting this project, but as people were using it I didn't want to kill it. I really should have, however, because it meant that people were using a crappy, ill-conceived, unmaintained tool. Now, long overdue, I'm putting it out to pasture.
Original readme follows:
sprockets-coffee-react 2.x is compatible with react ^0.12.0
sprockets-coffee-react 0.x is compatible with react <=0.11.0
How to use
Add this to your Gemfile:
Eg. if you have a file called my-component.js.coffee which contains some CJSX code, require it from application.js or somewhere else:
//= require my-component
How to use with a Rack application
If you're not using rails, you'll need to register the Sprockets preprocessor manually. Here is an adapted version of the Rack example provided by Sprockets, which additionally requires and registers the sprockets-coffee-react engine:
Released under the MIT License. See the LICENSE file for further details.
How to use with Middleman
Add the following to your config.rb file: