@@ -20,6 +20,8 @@ As with all gem dependencies, we strongly recommend adding `react-rails` to your
20
20
gem ' react-rails' , ' ~> 0.8.0.0'
21
21
```
22
22
23
+ Starting with ` 0.4.1 ` there is a fix, which alows execjs to transforms jsx files, so if you need a version lower than
24
+ ` 0.4.1 ` you will have to replace JSXTransformer.js, see below on how to do it.
23
25
24
26
## Usage
25
27
@@ -131,23 +133,20 @@ Component = React.createClass
131
133
132
134
### Changing react.js and JSXTransformer.js versions
133
135
134
- Major, minor, and patch versions of this gem are based on react's version, e.g.
135
- ` 0.4.1.1 ` means that react has version ` 0.4.1 ` . There may be fixes or improvements
136
- introduced in say ` 0.5.0.0 ` , but you will still need react in version ` 0.4.1 ` .
137
- If you needed to change JSXTransformer version it's possible too.
136
+ This gem's version is independent from actual react's version, that's why you need declarations for both ` react-rails `
137
+ and ` react-source ` in your ` Gemfile ` . However, in some cases you may want to have your ` react.js ` and ` JSXTransformer.js `
138
+ files come from different releases. To achieve that, you have to manually replace either of them in your app.
138
139
139
- #### How to
140
+ #### Instructions
140
141
141
- Just put another version of react or JSXTransformer in your assets. Any place
142
- you would put a javascript file will be fine, probably
143
- ` /vendor/javascripts/ react.js ` and ` /vendor/javascripts/JSXTransformer.js `
144
- would be best. (You don't have to replace both)
142
+ Just put another version of ` react.js ` or ` JSXTransformer.js ` under ` /vendor/ assets/react ` directory.
143
+ If you need different versions of ` react.js ` for production and development, then use a subdirectory named
144
+ after ` config. react.variant ` , e.g. you set ` config.react.variant = :development ` so for this environment
145
+ ` react.js ` is expected to be in ` /vendor/assets/react/development `
145
146
146
147
#### Things to remember
147
148
148
149
If you replace ` JSXTransformer.js ` , you have to restart your rails instance,
149
- because the jsx compiler context is cached, name of the file is case-sensitive .
150
+ because the jsx compiler context is cached.
150
151
151
- We provide different variants of ` react.js ` based on environment, but you will
152
- need to provide the same file called ` react.js ` which will be used for both
153
- production and development.
152
+ Name of the ` JSXTransformer.js ` file * is case-sensitive* .
0 commit comments