You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,11 @@ After a release, please make sure to run `bundle exec rake update_changelog`. Th
24
24
Changes since the last non-beta release.
25
25
26
26
#### Added
27
+
27
28
- Configuration option `generated_component_packs_loading_strategy` to control how generated component packs are loaded. It supports `sync`, `async`, and `defer` strategies. [PR 1712](https://github.com/shakacode/react_on_rails/pull/1712) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
28
29
29
30
### Removed (Breaking Changes)
31
+
30
32
- Removed `defer_generated_component_packs` configuration option. You can use `generated_component_packs_loading_strategy` instead. [PR 1712](https://github.com/shakacode/react_on_rails/pull/1712) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
Copy file name to clipboardExpand all lines: docs/release-notes/15.0.0.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ Major improvements to component and store hydration:
22
22
- No need to use `defer` anymore
23
23
24
24
### Enhanced Script Loading Strategies
25
+
25
26
- New configuration option `generated_component_packs_loading_strategy` replaces `defer_generated_component_packs`
26
27
- Supports three loading strategies:
27
28
-`:async` - Loads scripts asynchronously (default for Shakapacker ≥ 8.2.0)
@@ -37,6 +38,7 @@ Major improvements to component and store hydration:
37
38
- The `generated_component_packs_loading_strategy` defaults to `:async` for Shakapacker ≥ 8.2.0 and `:sync` for Shakapacker < 8.2.0.
38
39
- The `force_load` configuration now defaults to `true`.
39
40
- The new default values of `generated_component_packs_loading_strategy: :async` and `force_load: true` work together to optimize component hydration. Components now hydrate as soon as their code and server-rendered HTML are available, without waiting for the full page to load. This parallel processing significantly improves time-to-interactive by eliminating the traditional waterfall of waiting for page load before beginning hydration (It's critical for streamed HTML).
41
+
40
42
- The previous need for deferring scripts to prevent race conditions has been eliminated due to improved hydration handling. Making scripts not defer is critical to execute the hydration scripts early before the page is fully loaded.
41
43
- The `force_load` configuration makes `react-on-rails` hydrate components immediately as soon as their server-rendered HTML reaches the client, without waiting for the full page load.
42
44
- If you want to keep the previous behavior, you can set `generated_component_packs_loading_strategy: :defer` or `force_load: false` in your `config/initializers/react_on_rails.rb` file.
@@ -61,6 +63,7 @@ Major improvements to component and store hydration:
61
63
- If you call it in a `turbolinks:load` listener to work around the issue documented in [Turbolinks](https://www.shakacode.com/react-on-rails/docs/rails/turbolinks/#async-script-loading), the listener can be safely removed.
62
64
63
65
### Script Loading Strategy Migration
66
+
64
67
- If you were previously using `defer_generated_component_packs: true`, use `generated_component_packs_loading_strategy: :defer` instead
65
68
- If you were previously using `defer_generated_component_packs: false`, use `generated_component_packs_loading_strategy: :sync` instead
66
69
- For optimal performancewith Shakapacker ≥ 8.2.0, consider using `generated_component_packs_loading_strategy: :async`
0 commit comments