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.
-
#component_registry_timeout ⇒ Object
Returns the value of attribute component_registry_timeout.
-
#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.
-
#force_load ⇒ Object
Returns the value of attribute force_load.
-
#generated_assets_dir ⇒ Object
Returns the value of attribute generated_assets_dir.
-
#generated_assets_dirs ⇒ Object
Returns the value of attribute generated_assets_dirs.
-
#generated_component_packs_loading_strategy ⇒ Object
Returns the value of attribute generated_component_packs_loading_strategy.
-
#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.
-
#i18n_yml_safe_load_options ⇒ Object
Returns the value of attribute i18n_yml_safe_load_options.
-
#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.
-
#react_client_manifest_file ⇒ Object
Returns the value of attribute react_client_manifest_file.
-
#react_server_client_manifest_file ⇒ Object
Returns the value of attribute react_server_client_manifest_file.
-
#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.
-
#rsc_bundle_js_file ⇒ Object
Returns the value of attribute rsc_bundle_js_file.
-
#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, defer_generated_component_packs: 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, generated_component_packs_loading_strategy: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, i18n_yml_safe_load_options: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil, force_load: nil, rsc_bundle_js_file: nil, react_client_manifest_file: nil, react_server_client_manifest_file: nil, component_registry_timeout: 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, defer_generated_component_packs: 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, generated_component_packs_loading_strategy: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, i18n_yml_safe_load_options: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil, force_load: nil, rsc_bundle_js_file: nil, react_client_manifest_file: nil, react_server_client_manifest_file: nil, component_registry_timeout: nil) ⇒ Configuration
rubocop:disable Metrics/AbcSize
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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/react_on_rails/configuration.rb', line 74 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, defer_generated_component_packs: 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, generated_component_packs_loading_strategy: nil, same_bundle_for_client_and_server: nil, i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil, i18n_yml_safe_load_options: nil, random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil, components_subdirectory: nil, auto_load_bundle: nil, force_load: nil, rsc_bundle_js_file: nil, react_client_manifest_file: nil, react_server_client_manifest_file: nil, component_registry_timeout: 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. = 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 self.component_registry_timeout = component_registry_timeout # Server rendering: self.server_bundle_js_file = server_bundle_js_file self.rsc_bundle_js_file = rsc_bundle_js_file self.react_client_manifest_file = react_client_manifest_file self.react_server_client_manifest_file = react_server_client_manifest_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 self.force_load = force_load self.generated_component_packs_loading_strategy = generated_component_packs_loading_strategy end |
Instance Attribute Details
#auto_load_bundle ⇒ Object
Returns the value of attribute auto_load_bundle.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def auto_load_bundle @auto_load_bundle end |
#build_production_command ⇒ Object
Returns the value of attribute build_production_command.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def build_production_command @build_production_command end |
#build_test_command ⇒ Object
Returns the value of attribute build_test_command.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def build_test_command @build_test_command end |
#component_registry_timeout ⇒ Object
Returns the value of attribute component_registry_timeout.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def component_registry_timeout @component_registry_timeout end |
#components_subdirectory ⇒ Object
Returns the value of attribute components_subdirectory.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def components_subdirectory @components_subdirectory end |
#defer_generated_component_packs ⇒ Object
Returns the value of attribute defer_generated_component_packs.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def defer_generated_component_packs @defer_generated_component_packs end |
#development_mode ⇒ Object
Returns the value of attribute development_mode.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def development_mode @development_mode end |
#force_load ⇒ Object
Returns the value of attribute force_load.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def force_load @force_load end |
#generated_assets_dir ⇒ Object
Returns the value of attribute generated_assets_dir.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def generated_assets_dir @generated_assets_dir end |
#generated_assets_dirs ⇒ Object
Returns the value of attribute generated_assets_dirs.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def generated_assets_dirs @generated_assets_dirs end |
#generated_component_packs_loading_strategy ⇒ Object
Returns the value of attribute generated_component_packs_loading_strategy.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def generated_component_packs_loading_strategy @generated_component_packs_loading_strategy end |
#i18n_dir ⇒ Object
Returns the value of attribute i18n_dir.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def i18n_dir @i18n_dir end |
#i18n_output_format ⇒ Object
Returns the value of attribute i18n_output_format.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def i18n_output_format @i18n_output_format end |
#i18n_yml_dir ⇒ Object
Returns the value of attribute i18n_yml_dir.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def i18n_yml_dir @i18n_yml_dir end |
#i18n_yml_safe_load_options ⇒ Object
Returns the value of attribute i18n_yml_safe_load_options.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def @i18n_yml_safe_load_options end |
#logging_on_server ⇒ Object
Returns the value of attribute logging_on_server.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 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.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 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.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def node_modules_location @node_modules_location end |
#prerender ⇒ Object
Returns the value of attribute prerender.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def prerender @prerender end |
#raise_on_prerender_error ⇒ Object
Returns the value of attribute raise_on_prerender_error.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def raise_on_prerender_error @raise_on_prerender_error end |
#random_dom_id ⇒ Object
Returns the value of attribute random_dom_id.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def random_dom_id @random_dom_id end |
#react_client_manifest_file ⇒ Object
Returns the value of attribute react_client_manifest_file.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def react_client_manifest_file @react_client_manifest_file end |
#react_server_client_manifest_file ⇒ Object
Returns the value of attribute react_server_client_manifest_file.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def react_server_client_manifest_file @react_server_client_manifest_file end |
#rendering_extension ⇒ Object
Returns the value of attribute rendering_extension.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def rendering_extension @rendering_extension end |
#rendering_props_extension ⇒ Object
Returns the value of attribute rendering_props_extension.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def rendering_props_extension @rendering_props_extension end |
#replay_console ⇒ Object
Returns the value of attribute replay_console.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def replay_console @replay_console end |
#rsc_bundle_js_file ⇒ Object
Returns the value of attribute rsc_bundle_js_file.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def rsc_bundle_js_file @rsc_bundle_js_file end |
#same_bundle_for_client_and_server ⇒ Object
Returns the value of attribute same_bundle_for_client_and_server.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 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.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def server_bundle_js_file @server_bundle_js_file end |
#server_render_method ⇒ Object
Returns the value of attribute server_render_method.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def server_render_method @server_render_method end |
#server_renderer_pool_size ⇒ Object
Returns the value of attribute server_renderer_pool_size.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def server_renderer_pool_size @server_renderer_pool_size end |
#server_renderer_timeout ⇒ Object
Returns the value of attribute server_renderer_timeout.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def server_renderer_timeout @server_renderer_timeout end |
#skip_display_none ⇒ Object
Returns the value of attribute skip_display_none.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def skip_display_none @skip_display_none end |
#trace ⇒ Object
Returns the value of attribute trace.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def trace @trace end |
#webpack_generated_files ⇒ Object
Returns the value of attribute webpack_generated_files.
60 61 62 |
# File 'lib/react_on_rails/configuration.rb', line 60 def webpack_generated_files @webpack_generated_files end |
Instance Method Details
#setup_config_values ⇒ Object
on ReactOnRails
137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/react_on_rails/configuration.rb', line 137 def setup_config_values check_autobundling_requirements if auto_load_bundle 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_packer_and_generated_assets_dir_not_match_public_output_path # check_deprecated_settings adjust_precompile_task check_component_registry_timeout validate_generated_component_packs_loading_strategy end |