cjsxify

Browserify transform for CJSX (CoffeeScript equivalent of JSX used in React library by Facebook)

MIT 9 个版本
安装
npm install cjsxify
yarn add cjsxify
pnpm add cjsxify
bun add cjsxify
README

cjsxify

Browserify transform for CJSX (CoffeeScript equivalent of JSX used in React library by Facebook).

Usage

# @cjsx React.DOM

React = require('react')

Hello = React.createClass
  render: ->
    <div>Hello, {@props.name}!</div>

React.renderComponent(<Hello name='World' />, document.getElementById('hello'))

Save the snippet above as main.coffee and then produce a bundle with the following command:

% browserify -t cjsxify main.coffee -o bundle.js

cjsxify is activated for files with either .cjsx extension or # @cjsx React.DOM pragma as a first line for any .coffee file.

Installation

npm install cjsxify

Thanks

This package is inspired by coffeeify/reactify and use coffee-react-transform to handle cjsx transformation to CoffeeScript. Thanks to the authors for their great work.

版本列表
0.3.0 2015-04-20
0.2.6 2015-02-05
0.2.5 2014-05-23
0.2.4 2014-05-15
0.2.3 2014-05-14
0.2.2 2014-05-14
0.2.1 2014-05-14
0.2.0 2014-05-14
0.1.0 2014-05-14