File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ You can configure your pool of JS virtual machines and specify where it should l
188
188
# These are the defaults if you dont specify any yourself
189
189
MyApp ::Application .configure do
190
190
# Settings for the pool of renderers:
191
- config.react.server_renderer_pool_size ||= 10
191
+ config.react.server_renderer_pool_size ||= 1 # ExecJS doesn't allow more than one on MRI
192
192
config.react.server_renderer_timeout ||= 20 # seconds
193
193
config.react.server_renderer = React ::ServerRendering ::SprocketsRenderer
194
194
config.react.server_renderer_options = {
@@ -198,6 +198,10 @@ MyApp::Application.configure do
198
198
end
199
199
```
200
200
201
+ - On MRI, use ` therubyracer ` for the best performance (see [ discussion] ( https://github.com/reactjs/react-rails/pull/290 ) )
202
+ - On MRI, you'll get a deadlock with ` pool_size ` > 1
203
+ - If you're using JRuby, you can increase ` pool_size ` to have real multi-threaded rendering.
204
+
201
205
### Component generator
202
206
203
207
` react-rails ` ships with a Rails generator to help you get started with a simple component scaffold.
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ class Railtie < ::Rails::Railtie
11
11
config . react . jsx_transform_options = { }
12
12
config . react . jsx_transformer_class = nil # defaults to BabelTransformer
13
13
# Server rendering:
14
- config . react . server_renderer_pool_size = 10
15
- config . react . server_renderer_timeout = 20 # seconds
14
+ config . react . server_renderer_pool_size = 1 # increase if you're on JRuby
15
+ config . react . server_renderer_timeout = 20 # seconds
16
16
config . react . server_renderer = nil # defaults to SprocketsRenderer
17
17
config . react . server_renderer_options = { } # SprocketsRenderer provides defaults
18
18
You can’t perform that action at this time.
0 commit comments