Sha256: 62a82ec6aa8d7d921ba35f5e3c5e4e417a3f9c018776d8717513920ff11270a3
Contents?: true
Size: 1.81 KB
Versions: 4
Compression:
Stored size: 1.81 KB
Contents
module ReactOnRails def self.configure yield(configuration) end def self.configuration @configuration ||= Configuration.new( server_bundle_js_file: "app/assets/javascripts/generated/server.js", prerender: false, replay_console: true, logging_on_server: true, raise_on_prerender_error: false, trace: Rails.env.development?, development_mode: Rails.env.development?, server_renderer_pool_size: 1, server_renderer_timeout: 20) end class Configuration attr_accessor :server_bundle_js_file, :prerender, :replay_console, :trace, :development_mode, :logging_on_server, :server_renderer_pool_size, :server_renderer_timeout, :raise_on_prerender_error def initialize(server_bundle_js_file: nil, prerender: nil, replay_console: nil, trace: nil, development_mode: nil, logging_on_server: nil, server_renderer_pool_size: nil, server_renderer_timeout: nil, raise_on_prerender_error: nil) if File.exist?(server_bundle_js_file) self.server_bundle_js_file = server_bundle_js_file else self.server_bundle_js_file = nil end self.prerender = prerender self.replay_console = replay_console self.logging_on_server = logging_on_server if development_mode.nil? self.development_mode = Rails.env.development? else self.development_mode = development_mode end self.trace = trace.nil? ? Rails.env.development? : trace self.raise_on_prerender_error = raise_on_prerender_error # Server rendering: self.server_renderer_pool_size = self.development_mode ? 1 : server_renderer_pool_size self.server_renderer_timeout = server_renderer_timeout # seconds end end end
Version data entries
4 entries across 4 versions & 1 rubygems