https://github.com/mfellner/sprockets-react
React/JSX extension for the Sprockets asset pipeline.
https://github.com/mfellner/sprockets-react
Last synced: 2 months ago
JSON representation
React/JSX extension for the Sprockets asset pipeline.
- Host: GitHub
- URL: https://github.com/mfellner/sprockets-react
- Owner: mfellner
- License: other
- Created: 2015-01-25T21:11:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-25T21:43:09.000Z (over 10 years ago)
- Last Synced: 2024-10-12T00:22:06.554Z (8 months ago)
- Language: Ruby
- Size: 133 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sprockets-React
## Description
Adds React/JSX support to Sprockets 2.x using the official [React source](https://rubygems.org/gems/react-source).
Based on and inspired by:
* [reactjs/react-rails](https://github.com/reactjs/react-rails)
* [ademin/react-jsx](https://github.com/ademin/react-jsx)
* [jvatic/react-jsx-sprockets](https://github.com/jvatic/react-jsx-sprockets)## Installation
Add the following line to your Gemfile:
```ruby
gem 'sprockets-react', '~> 0.0.1', github: 'mfellner/sprockets-react'
```Then install your gems with Bundler:
```ruby
bundle install
```## Usage
In your application, require *sprockets* and *sprockets-react*:
```ruby
require 'sprockets'
require 'sprockets-react'
```You can configure custom filename extensions:
```ruby
Sprockets::React.configure do |conf|
conf.extensions = %w( jsx jsx.js js.jsx )
end
```Sprockets-react uses [ExecJS](https://github.com/sstephenson/execjs) to run React.
You need to have a compatible JavaScript runtime installed.## Development
Run tests with RSpec:
```ruby
rspec
```