Registry / web-framework / coffee-react

coffee-react

JSON →
library5.0.1jsnpmunverified

Deprecated tool that provided JSX-like syntax for building React components with CoffeeScript, using the CJSX format. The 5.0.1 stable release is the last; the project has been abandoned. It wraps coffee-react-transform and coffee-script to compile CJSX to JavaScript, and includes a cjsx executable that functions as a coffee replacement. Key differentiator: allowed React JSX syntax within CoffeeScript files. Now superseded by cjsx-codemod for migration. No longer maintained or recommended for new projects.

npm install coffee-react
INSTALL
IMPORT
SIG · COFFEE-REACT
C
coffee-react
web-frameworkjavascriptv5.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs coffee-react globally, compiles a CJSX file to JavaScript using the cjsx command, then outputs the resulting JS.

npm install -g coffee-react@5.0.1 cat <<EOF > component.cjsx MyComponent = React.createClass render: -> <div className="greeting"> Hello, {if @props.name? then @props.name else 'World'}! </div> EOF cjsx -c component.cjsx cat component.js
cjsx --version
Debug
Known issues
deprecatedThis package is no longer maintained and marked as deprecated. Use cjsx-codemod to transition away.
fix
Migrate codebase using cjsx-codemod (https://github.com/jsdf/cjsx-codemod) and consider moving to modern alternatives like Babel with JSX.
affects: >=0.0.0
gotchaInsurmountable limitations exist in the parser; complex CJSX syntax may produce bugs.
fix
Avoid writing new CJSX code; use standard JSX with JavaScript or TypeScript instead.
affects: >=0.0.0
breakingVersion 5.x only supports React 0.13.x - 0.15.x. Using with newer React versions will cause issues.
fix
Pin React to 0.13.x - 0.15.x, or move away from coffee-react.
affects: 5.0.0 - 5.0.1
Errors
Common errors & fixes
Error: Cannot find module 'coffee-react-transform'
Missing required dependency when using coffee-react directly via require().
fix
Ensure both coffee-react and coffee-react-transform are installed: npm install coffee-react coffee-react-transform
cjsx: command not found
Package not installed globally or not in PATH.
fix
Install globally: npm install -g coffee-react@5.0.1, or use npx coffee-react
Parse error on line ... Unexpected token '<'
CJSX syntax not correctly formatted or using incompatible JSX-like syntax.
fix
Review CJSX syntax rules; ensure elements are properly closed and attributes use CoffeeScript expressions.
Upgrade
Version history
5.0.1latest on npm
Audit
Dependencies
coffee-scriptrequiredRequired to compile CoffeeScript code.
coffee-react-transformrequiredTransforms CJSX syntax to JavaScript.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
coffee-react — npm install coffee-react · libregistry