Skip to content

feat(versions) add VERSIONS.md for gem/React versions #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ end

After restarting your Rails server, `//= require react` will provide the build of React.js which was specified by the configurations.

In a pinch, you can also provide your own copies of React.js and JSXTransformer. Just add `react.js` or `JSXTransformer.js` (case-sensitive) files to `app/vendor/assets/javascripts/react/` and restart your development server. If you need different versions of React in different environments, put them in directories that match `config.react.variant`. For example, if you set `config.react.variant = :development`, you could put a copy of `react.js` in `/vendor/assets/react/development/`.
`react-rails` offers a few other options for versions & builds of React.js. See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md) for more info about using the `react-source` gem or dropping in your own copies of React.js.

### JSX

Expand Down
43 changes: 43 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Versions

There are three ways to control what version of React.js (and JSXTransformer) is used by `react-rails`:

- Use the [bundled version](#bundled-versions) that comes with the gem
- Specify a [react-source verison](#react-source-version)
- [Drop in a copy](#drop-in-version) of React.js

## Bundled Versions

| Gem | React.js |
|----------|----------|
| master | ~> 0.13 |
| 0.13.0.0 | 0.13.0 |
| 0.12.2.0 | 0.12.2 |
| 0.12.1.0 | 0.12.1 |
| 0.12.0.0 | 0.12.0 |


## React-Source Version

The [`react-source` gem](https://rubygems.org/gems/react-source) provides JS files to `react-rails`.

You can specify a React.js version by locking to a specific `react-source` in your Gemfile. For example:

```ruby
gem 'react-rails'
# always use React version 0.13.1:
gem 'react-source', '0.13.1'
```

## Drop-in Version

You can also provide your own copies of React.js and JSXTransformer. Just add `react.js` or `JSXTransformer.js` (case-sensitive) files in directories where `react-rails` expects to find them.

To use the _same version in all environments_, put files in `app/vendor/assets/react/`.

If you need _different versions in different environments_, put them in directories that match `config.react.variant`. For example, if you set `config.react.variant = :development`, you could put a copy of `react.js` in `app/vendor/assets/react/development/`.





1 change: 1 addition & 0 deletions lib/react/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module React
module Rails
# If you change this, make sure to update VERSIONS.md
VERSION = '1.0.0.pre'
end
end
1 change: 1 addition & 0 deletions react-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Gem::Specification.new do |s|
s.add_dependency 'execjs'
s.add_dependency 'coffee-script-source', '~>1.8'
s.add_dependency 'rails', '>= 3.1'
# If you change this, make sure to update VERSIONS.md:
s.add_dependency 'react-source', '~> 0.13'
s.add_dependency 'connection_pool'

Expand Down