@@ -327,20 +327,22 @@ Server renderers are stored in a pool and reused between requests. Threaded Rubi
327327These are the default configurations:
328328
329329``` ruby
330- # config/environments/ application.rb
330+ # config/application.rb
331331# These are the defaults if you don't specify any yourself
332- MyApp ::Application .configure do
333- # Settings for the pool of renderers:
334- config.react.server_renderer_pool_size ||= 1 # ExecJS doesn't allow more than one on MRI
335- config.react.server_renderer_timeout ||= 20 # seconds
336- config.react.server_renderer = React ::ServerRendering ::BundleRenderer
337- config.react.server_renderer_options = {
338- files: [" server_rendering.js" ], # files to load for prerendering
339- replay_console: true , # if true, console.* will be replayed client-side
340- }
341- # Changing files matching these dirs/exts will cause the server renderer to reload:
342- config.react.server_renderer_extensions = [" jsx" , " js" ]
343- config.react.server_renderer_directories = [" /app/assets/javascripts" , " /app/javascript/" ]
332+ module MyApp
333+ class Application < Rails ::Application
334+ # Settings for the pool of renderers:
335+ config.react.server_renderer_pool_size ||= 1 # ExecJS doesn't allow more than one on MRI
336+ config.react.server_renderer_timeout ||= 20 # seconds
337+ config.react.server_renderer = React ::ServerRendering ::BundleRenderer
338+ config.react.server_renderer_options = {
339+ files: [" server_rendering.js" ], # files to load for prerendering
340+ replay_console: true , # if true, console.* will be replayed client-side
341+ }
342+ # Changing files matching these dirs/exts will cause the server renderer to reload:
343+ config.react.server_renderer_extensions = [" jsx" , " js" ]
344+ config.react.server_renderer_directories = [" /app/assets/javascripts" , " /app/javascript/" ]
345+ end
344346end
345347```
346348
0 commit comments