File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 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
188188# These are the defaults if you dont specify any yourself
189189MyApp ::Application .configure do
190190 # 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
192192 config.react.server_renderer_timeout ||= 20 # seconds
193193 config.react.server_renderer = React ::ServerRendering ::SprocketsRenderer
194194 config.react.server_renderer_options = {
@@ -198,6 +198,10 @@ MyApp::Application.configure do
198198end
199199```
200200
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+
201205### Component generator
202206
203207` 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
1111 config . react . jsx_transform_options = { }
1212 config . react . jsx_transformer_class = nil # defaults to BabelTransformer
1313 # 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
1616 config . react . server_renderer = nil # defaults to SprocketsRenderer
1717 config . react . server_renderer_options = { } # SprocketsRenderer provides defaults
1818
You can’t perform that action at this time.
0 commit comments