Skip to content

Commit 446c6ac

Browse files
committed
Document immediate_hydration as Pro-only in react_on_rails_pro.rb
Per code review feedback, immediate_hydration should be configured in the Pro initializer, not the base initializer: 1. Updated base initializer template to include Pro features section - Documents that immediate_hydration requires Pro - Directs users to configure in react_on_rails_pro.rb - Provides link to Pro information 2. Updated docs/api-reference/configuration.md - Removed immediate_hydration from base config example - Added Pro features section with clear example - Shows proper usage in ReactOnRailsPro.configure block This ensures users understand immediate_hydration is Pro-only and know where to configure it properly.
1 parent 2aa269a commit 446c6ac

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

docs/api-reference/configuration.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,22 @@ ReactOnRails.configure do |config|
279279
# See [16.0.0 Release Notes](docs/release-notes/16.0.0.md) for more details.
280280
# config.defer_generated_component_packs = false
281281

282-
# Default is false
283-
# React on Rails Pro (licensed) feature: When true, components hydrate immediately as soon as
284-
# their server-rendered HTML reaches the client, without waiting for the full page load.
285-
# This improves time-to-interactive performance.
286-
config.immediate_hydration = false
282+
################################################################################
283+
# REACT ON RAILS PRO FEATURES
284+
################################################################################
285+
# The following features require React on Rails Pro and should be configured
286+
# in config/initializers/react_on_rails_pro.rb using ReactOnRailsPro.configure:
287+
#
288+
# - immediate_hydration: When true, components hydrate immediately as soon as
289+
# their server-rendered HTML reaches the client, without waiting for the full page load.
290+
# This improves time-to-interactive performance.
291+
#
292+
# Example (in config/initializers/react_on_rails_pro.rb):
293+
# ReactOnRailsPro.configure do |config|
294+
# config.immediate_hydration = true
295+
# end
296+
#
297+
# For more information, visit: https://www.shakacode.com/react-on-rails-pro
287298

288299
################################################################################
289300
# I18N OPTIONS

lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,17 @@ ReactOnRails.configure do |config|
7878
# Default is :defer which provides good performance and prevents component registration race conditions.
7979
# For React on Rails Pro users, :async can provide better performance by loading scripts asynchronously.
8080
config.generated_component_packs_loading_strategy = :defer
81+
82+
################################################################################
83+
# REACT ON RAILS PRO FEATURES
84+
################################################################################
85+
# The following features require React on Rails Pro and should be configured
86+
# in config/initializers/react_on_rails_pro.rb:
87+
#
88+
# - immediate_hydration: Enables components to hydrate immediately as their
89+
# server-rendered HTML reaches the client, improving time-to-interactive.
90+
# Configure in ReactOnRailsPro.configure block.
91+
#
92+
# For more information on React on Rails Pro features, visit:
93+
# https://www.shakacode.com/react-on-rails-pro
8194
end

0 commit comments

Comments
 (0)