Skip to content

Commit f6b0f5d

Browse files
committed
Add immediate_hydration configuration to ReactOnRailsPro
Move immediate_hydration from ReactOnRails to ReactOnRailsPro configuration since it's a Pro-only feature. Changes: - Add DEFAULT_IMMEDIATE_HYDRATION constant (default: false) - Add immediate_hydration to attr_accessor list - Add immediate_hydration parameter to initialize method - Add immediate_hydration assignment in initialize - Add immediate_hydration to configuration instantiation This prepares for removing immediate_hydration from the core ReactOnRails configuration in the next commit.
1 parent 9789390 commit f6b0f5d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

react_on_rails_pro/lib/react_on_rails_pro/configuration.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def self.configuration
3232
rsc_payload_generation_url_path: Configuration::DEFAULT_RSC_PAYLOAD_GENERATION_URL_PATH,
3333
rsc_bundle_js_file: Configuration::DEFAULT_RSC_BUNDLE_JS_FILE,
3434
react_client_manifest_file: Configuration::DEFAULT_REACT_CLIENT_MANIFEST_FILE,
35-
react_server_client_manifest_file: Configuration::DEFAULT_REACT_SERVER_CLIENT_MANIFEST_FILE
35+
react_server_client_manifest_file: Configuration::DEFAULT_REACT_SERVER_CLIENT_MANIFEST_FILE,
36+
immediate_hydration: Configuration::DEFAULT_IMMEDIATE_HYDRATION
3637
)
3738
end
3839

@@ -59,6 +60,7 @@ class Configuration # rubocop:disable Metrics/ClassLength
5960
DEFAULT_RSC_BUNDLE_JS_FILE = "rsc-bundle.js"
6061
DEFAULT_REACT_CLIENT_MANIFEST_FILE = "react-client-manifest.json"
6162
DEFAULT_REACT_SERVER_CLIENT_MANIFEST_FILE = "react-server-client-manifest.json"
63+
DEFAULT_IMMEDIATE_HYDRATION = false
6264

6365
attr_accessor :renderer_url, :renderer_password, :tracing,
6466
:server_renderer, :renderer_use_fallback_exec_js, :prerender_caching,
@@ -68,7 +70,7 @@ class Configuration # rubocop:disable Metrics/ClassLength
6870
:renderer_request_retry_limit, :throw_js_errors, :ssr_timeout,
6971
:profile_server_rendering_js_code, :raise_non_shell_server_rendering_errors, :enable_rsc_support,
7072
:rsc_payload_generation_url_path, :rsc_bundle_js_file, :react_client_manifest_file,
71-
:react_server_client_manifest_file
73+
:react_server_client_manifest_file, :immediate_hydration
7274

7375
def initialize(renderer_url: nil, renderer_password: nil, server_renderer: nil, # rubocop:disable Metrics/AbcSize
7476
renderer_use_fallback_exec_js: nil, prerender_caching: nil,
@@ -79,7 +81,8 @@ def initialize(renderer_url: nil, renderer_password: nil, server_renderer: nil,
7981
renderer_request_retry_limit: nil, throw_js_errors: nil, ssr_timeout: nil,
8082
profile_server_rendering_js_code: nil, raise_non_shell_server_rendering_errors: nil,
8183
enable_rsc_support: nil, rsc_payload_generation_url_path: nil,
82-
rsc_bundle_js_file: nil, react_client_manifest_file: nil, react_server_client_manifest_file: nil)
84+
rsc_bundle_js_file: nil, react_client_manifest_file: nil, react_server_client_manifest_file: nil,
85+
immediate_hydration: nil)
8386
self.renderer_url = renderer_url
8487
self.renderer_password = renderer_password
8588
self.server_renderer = server_renderer
@@ -105,6 +108,7 @@ def initialize(renderer_url: nil, renderer_password: nil, server_renderer: nil,
105108
self.rsc_bundle_js_file = rsc_bundle_js_file
106109
self.react_client_manifest_file = react_client_manifest_file
107110
self.react_server_client_manifest_file = react_server_client_manifest_file
111+
self.immediate_hydration = immediate_hydration
108112
end
109113

110114
def setup_config_values

0 commit comments

Comments
 (0)