Class: ReactOnRails::Configuration
- Inherits:
-
Object
- Object
- ReactOnRails::Configuration
- Defined in:
- lib/react_on_rails/configuration.rb
Instance Attribute Summary collapse
-
#auto_load_bundle ⇒ Object
Returns the value of attribute auto_load_bundle.
-
#build_production_command ⇒ Object
Returns the value of attribute build_production_command.
-
#build_test_command ⇒ Object
Returns the value of attribute build_test_command.
-
#components_subdirectory ⇒ Object
Returns the value of attribute components_subdirectory.
-
#defer_generated_component_packs ⇒ Object
Returns the value of attribute defer_generated_component_packs.
-
#development_mode ⇒ Object
Returns the value of attribute development_mode.
-
#generated_assets_dir ⇒ Object
Returns the value of attribute generated_assets_dir.
-
#generated_assets_dirs ⇒ Object
Returns the value of attribute generated_assets_dirs.
-
#i18n_dir ⇒ Object
Returns the value of attribute i18n_dir.
-
#i18n_output_format ⇒ Object
Returns the value of attribute i18n_output_format.
-
#i18n_yml_dir ⇒ Object
Returns the value of attribute i18n_yml_dir.
-
#logging_on_server ⇒ Object
Returns the value of attribute logging_on_server.
-
#make_generated_server_bundle_the_entrypoint ⇒ Object
Returns the value of attribute make_generated_server_bundle_the_entrypoint.
-
#node_modules_location ⇒ Object
Returns the value of attribute node_modules_location.
-
#prerender ⇒ Object
Returns the value of attribute prerender.
-
#raise_on_prerender_error ⇒ Object
Returns the value of attribute raise_on_prerender_error.
-
#random_dom_id ⇒ Object
Returns the value of attribute random_dom_id.
-
#rendering_extension ⇒ Object
Returns the value of attribute rendering_extension.
-
#rendering_props_extension ⇒ Object
Returns the value of attribute rendering_props_extension.
-
#replay_console ⇒ Object
Returns the value of attribute replay_console.
-
#same_bundle_for_client_and_server ⇒ Object
Returns the value of attribute same_bundle_for_client_and_server.
-
#server_bundle_js_file ⇒ Object
Returns the value of attribute server_bundle_js_file.
-
#server_render_method ⇒ Object
Returns the value of attribute server_render_method.
-
#server_renderer_pool_size ⇒ Object
Returns the value of attribute server_renderer_pool_size.
-
#server_renderer_timeout ⇒ Object
Returns the value of attribute server_renderer_timeout.
-
#skip_display_none ⇒ Object
Returns the value of attribute skip_display_none.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#webpack_generated_files ⇒ Object
Returns the value of attribute webpack_generated_files.
Instance Method Summary collapse
-
#initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender: nil, replay_console: nil, make_generated_server_bundle_the_entrypoint: nil, trace: nil, development_mode: nil, logging_on_server: nil, server_renderer_pool_size: nil, server_renderer_timeout: nil, raise_on_prerender_error: true, skip_display_none: nil, generated_assets_dirs: nil, generated_assets_dir: nil, webpack_generated_files: nil, rendering_extension: nil, build_test_command: nil, build_production_command: nil, defer_generated_component_packs: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil) ⇒ Configuration
constructor
rubocop:disable Metrics/AbcSize.
-
#setup_config_values ⇒ Object
on ReactOnRails.
Constructor Details
#initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender: nil, replay_console: nil, make_generated_server_bundle_the_entrypoint: nil, trace: nil, development_mode: nil, logging_on_server: nil, server_renderer_pool_size: nil, server_renderer_timeout: nil, raise_on_prerender_error: true, skip_display_none: nil, generated_assets_dirs: nil, generated_assets_dir: nil, webpack_generated_files: nil, rendering_extension: nil, build_test_command: nil, build_production_command: nil, defer_generated_component_packs: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil) ⇒ Configuration
rubocop:disable Metrics/AbcSize
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/react_on_rails/configuration.rb', line 59 def initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender: nil, replay_console: nil, make_generated_server_bundle_the_entrypoint: nil, trace: nil, development_mode: nil, logging_on_server: nil, server_renderer_pool_size: nil, server_renderer_timeout: nil, raise_on_prerender_error: true, skip_display_none: nil, generated_assets_dirs: nil, generated_assets_dir: nil, webpack_generated_files: nil, rendering_extension: nil, build_test_command: nil, build_production_command: nil, defer_generated_component_packs: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil) self.node_modules_location = node_modules_location.present? ? node_modules_location : Rails.root self.generated_assets_dirs = generated_assets_dirs self.generated_assets_dir = generated_assets_dir self.build_test_command = build_test_command self.build_production_command = build_production_command self.i18n_dir = i18n_dir self.i18n_yml_dir = i18n_yml_dir self.i18n_output_format = i18n_output_format self.random_dom_id = random_dom_id self.prerender = prerender self.replay_console = replay_console self.logging_on_server = logging_on_server self.development_mode = if development_mode.nil? Rails.env.development? else development_mode end self.trace = trace.nil? ? Rails.env.development? : trace self.raise_on_prerender_error = raise_on_prerender_error self.skip_display_none = skip_display_none self.rendering_props_extension = rendering_props_extension # Server rendering: self.server_bundle_js_file = server_bundle_js_file self.same_bundle_for_client_and_server = same_bundle_for_client_and_server self.server_renderer_pool_size = self.development_mode ? 1 : server_renderer_pool_size self.server_renderer_timeout = server_renderer_timeout # seconds self.webpack_generated_files = webpack_generated_files self.rendering_extension = rendering_extension self.server_render_method = server_render_method self.components_subdirectory = components_subdirectory self.auto_load_bundle = auto_load_bundle self.make_generated_server_bundle_the_entrypoint = make_generated_server_bundle_the_entrypoint self.defer_generated_component_packs = defer_generated_component_packs end |
Instance Attribute Details
#auto_load_bundle ⇒ Object
Returns the value of attribute auto_load_bundle.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def auto_load_bundle @auto_load_bundle end |
#build_production_command ⇒ Object
Returns the value of attribute build_production_command.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def build_production_command @build_production_command end |
#build_test_command ⇒ Object
Returns the value of attribute build_test_command.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def build_test_command @build_test_command end |
#components_subdirectory ⇒ Object
Returns the value of attribute components_subdirectory.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def components_subdirectory @components_subdirectory end |
#defer_generated_component_packs ⇒ Object
Returns the value of attribute defer_generated_component_packs.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def defer_generated_component_packs @defer_generated_component_packs end |
#development_mode ⇒ Object
Returns the value of attribute development_mode.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def development_mode @development_mode end |
#generated_assets_dir ⇒ Object
Returns the value of attribute generated_assets_dir.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def generated_assets_dir @generated_assets_dir end |
#generated_assets_dirs ⇒ Object
Returns the value of attribute generated_assets_dirs.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def generated_assets_dirs @generated_assets_dirs end |
#i18n_dir ⇒ Object
Returns the value of attribute i18n_dir.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def i18n_dir @i18n_dir end |
#i18n_output_format ⇒ Object
Returns the value of attribute i18n_output_format.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def i18n_output_format @i18n_output_format end |
#i18n_yml_dir ⇒ Object
Returns the value of attribute i18n_yml_dir.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def i18n_yml_dir @i18n_yml_dir end |
#logging_on_server ⇒ Object
Returns the value of attribute logging_on_server.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def logging_on_server @logging_on_server end |
#make_generated_server_bundle_the_entrypoint ⇒ Object
Returns the value of attribute make_generated_server_bundle_the_entrypoint.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def make_generated_server_bundle_the_entrypoint @make_generated_server_bundle_the_entrypoint end |
#node_modules_location ⇒ Object
Returns the value of attribute node_modules_location.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def node_modules_location @node_modules_location end |
#prerender ⇒ Object
Returns the value of attribute prerender.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def prerender @prerender end |
#raise_on_prerender_error ⇒ Object
Returns the value of attribute raise_on_prerender_error.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def raise_on_prerender_error @raise_on_prerender_error end |
#random_dom_id ⇒ Object
Returns the value of attribute random_dom_id.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def random_dom_id @random_dom_id end |
#rendering_extension ⇒ Object
Returns the value of attribute rendering_extension.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def rendering_extension @rendering_extension end |
#rendering_props_extension ⇒ Object
Returns the value of attribute rendering_props_extension.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def rendering_props_extension @rendering_props_extension end |
#replay_console ⇒ Object
Returns the value of attribute replay_console.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def replay_console @replay_console end |
#same_bundle_for_client_and_server ⇒ Object
Returns the value of attribute same_bundle_for_client_and_server.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def same_bundle_for_client_and_server @same_bundle_for_client_and_server end |
#server_bundle_js_file ⇒ Object
Returns the value of attribute server_bundle_js_file.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def server_bundle_js_file @server_bundle_js_file end |
#server_render_method ⇒ Object
Returns the value of attribute server_render_method.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def server_render_method @server_render_method end |
#server_renderer_pool_size ⇒ Object
Returns the value of attribute server_renderer_pool_size.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def server_renderer_pool_size @server_renderer_pool_size end |
#server_renderer_timeout ⇒ Object
Returns the value of attribute server_renderer_timeout.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def server_renderer_timeout @server_renderer_timeout end |
#skip_display_none ⇒ Object
Returns the value of attribute skip_display_none.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def skip_display_none @skip_display_none end |
#trace ⇒ Object
Returns the value of attribute trace.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def trace @trace end |
#webpack_generated_files ⇒ Object
Returns the value of attribute webpack_generated_files.
47 48 49 |
# File 'lib/react_on_rails/configuration.rb', line 47 def webpack_generated_files @webpack_generated_files end |
Instance Method Details
#setup_config_values ⇒ Object
on ReactOnRails
113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/react_on_rails/configuration.rb', line 113 def setup_config_values check_autobundling_requirements_if_configured ensure_webpack_generated_files_exists configure_generated_assets_dirs_deprecation configure_skip_display_none_deprecation ensure_generated_assets_dir_present check_server_render_method_is_only_execjs error_if_using_webpacker_and_generated_assets_dir_not_match_public_output_path # check_deprecated_settings adjust_precompile_task end |