You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# server-side console.log, console.warn, and console.error messages will be replayed on the client
176
+
# (you can set this to `true` in config/enviroments/development.rb to replay in development only)
177
+
config.react.replay_console =false
175
178
end
176
179
```
177
180
@@ -248,27 +251,6 @@ json.messages(@messages) do |message|
248
251
end
249
252
```
250
253
251
-
### Server Rendering
252
-
253
-
For performance and thread-safety reasons, a pool of JS VMs are spun up on application start, and the size of the pool and the timeout on requesting a VM from the pool are configurable.
254
-
255
-
```ruby
256
-
# config/environments/application.rb
257
-
# These are the defaults if you dont specify any yourself
*`react_js`: where you want to grab the javascript library from
269
-
*`component_filenames`: an array of filenames that will be requested from the asset pipeline and concatenated together
270
-
*`replay_console`: additional debugging by replaying any captured console messages from server-rendering back on the client (note: they will lose their call stack, but it can help point you in right direction)
271
-
272
254
## CoffeeScript
273
255
274
256
It is possible to use JSX with CoffeeScript. The caveat is that you will still need to include the docblock. Since CoffeeScript doesn't allow `/* */` style comments, we need to do something a little different. We also need to embed JSX inside backticks so CoffeeScript ignores the syntax it doesn't understand. Here's an example:
### Changing react.js and JSXTransformer.js versions
283
-
284
-
In some cases you may want to have your `react.js` and `JSXTransformer.js` files come from a different release than the one, that is specified in the `react-rails.gemspec`. To achieve that, you have to manually replace them in your app.
285
-
286
-
#### Instructions
287
-
288
-
Just put another version of `react.js` or `JSXTransformer.js` under `/vendor/assets/react` directory.
289
-
If you need different versions of `react.js` for production and development, then use a subdirectory named
290
-
after `config.react.variant`, e.g. you set `config.react.variant = :development` so for this environment
291
-
`react.js` is expected to be in `/vendor/assets/react/development`
292
-
293
-
#### Things to remember
294
-
295
-
If you replace `JSXTransformer.js` in production environment, you have to restart your rails instance,
296
-
because the jsx compiler context is cached.
297
-
298
-
Name of the `JSXTransformer.js` file *is case-sensitive*.
0 commit comments