Skip to content

Commit a91a9cf

Browse files
Update CHANGELOG and release notes of v15.0.0
1 parent da255c5 commit a91a9cf

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ If you think ShakaCode can help your project, [click here](https://meetings.hubs
1515
Please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
1616

1717
## Versions
18+
### [Unreleased]
19+
#### Added
20+
- Configuration option `generated_component_packs_loading_strategy` to control how generated component packs are loaded. It supports `sync`, `async`, and `defer` strategies. [PR 1707](https://github.com/shakacode/react_on_rails/pull/1707) by [judahmeek](https://github.com/judahmeek).
21+
22+
### Removed (Breaking Changes)
23+
- Removed `defer_generated_component_packs` configuration option. You can use `generated_component_packs_loading_strategy` instead. [PR 1707](https://github.com/shakacode/react_on_rails/pull/1707) by [judahmeek](https://github.com/judahmeek).
24+
1825
### [15.0.0-alpha.2] - 2025-03-07
1926
Changes since the last non-beta release.
2027

docs/release-notes/15.0.0.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,24 @@ Major improvements to component and store hydration:
1717
- Can use `async` scripts in the page with no fear of race condition
1818
- No need to use `defer` anymore
1919

20+
### Enhanced Script Loading Strategies
21+
- New configuration option `generated_component_packs_loading_strategy` replaces `defer_generated_component_packs`
22+
- Supports three loading strategies:
23+
- `:async` - Loads scripts asynchronously (default for Shakapacker ≥ 8.2.0)
24+
- `:defer` - Defers script execution until after page load (Doesn't work good with Streamed HTML as it will wait for the full page load before hydrating the components)
25+
- `:sync` - Loads scripts synchronously (default for Shakapacker < 8.2.0) (Better to upgrade to Shakapacker 8.2.0 and use `:async` strategy)
26+
- Improves page performance by optimizing how component packs are loaded
27+
2028
## Breaking Changes
2129

2230
### Component Hydration Changes
23-
- The `defer_generated_component_packs` and `force_load` configurations now default to `false` and `true` respectively. This means components will hydrate early without waiting for the full page load. This improves performance by eliminating unnecessary delays in hydration.
31+
- The `defer_generated_component_packs` configuration has been removed. Use `generated_component_packs_loading_strategy` instead.
32+
- The `generated_component_packs_loading_strategy` defaults to `:async` for Shakapacker ≥ 8.2.0 and `:sync` for Shakapacker < 8.2.0.
33+
- The `force_load` configuration now defaults to `true`.
34+
- 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).
2435
- 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.
2536
- The `force_load` configuration make `react-on-rails` hydrate components immediately as soon as their server-rendered HTML reaches the client, without waiting for the full page load.
26-
- If you want to keep the previous behavior, you can set `defer_generated_component_packs: true` or `force_load: false` in your `config/initializers/react_on_rails.rb` file.
37+
- 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.
2738
- If we want to keep the original behavior of `force_load` for only one or more components, you can set `force_load: false` in the `react_component` helper or `force_load` configuration.
2839
- Redux store support `force_load` option now and it uses `config.force_load` value as the default value. Which means that the redux store will hydrate immediately as soon as its server-side data reaches the client. You can override this behavior for individual redux stores by setting `force_load: false` in the `redux_store` helper.
2940

@@ -39,6 +50,11 @@ Major improvements to component and store hydration:
3950
// Code expecting all components to be hydrated
4051
```
4152

53+
### Script Loading Strategy Migration
54+
- If you were previously using `defer_generated_component_packs: true`, use `generated_component_packs_loading_strategy: :defer` instead
55+
- If you were previously using `defer_generated_component_packs: false`, use `generated_component_packs_loading_strategy: :sync` instead
56+
- For optimal performance with Shakapacker ≥ 8.2.0, consider using `generated_component_packs_loading_strategy: :async`
57+
4258
## Store Dependencies for Components
4359

4460
When using Redux stores with multiple components, you need to explicitly declare store dependencies to optimize hydration. Here's how:
@@ -65,12 +81,12 @@ Explicitly declare store dependencies for each component:
6581
```erb
6682
<% redux_store("SimpleStore", props: @app_props_server_render, defer: true) %>
6783
<%= react_component('ReduxApp', {}, {
68-
prerender: true
69-
<!-- No need to specify store_dependencies - it automatically depends on SimpleStore -->
84+
prerender: true
85+
<!-- No need to specify store_dependencies - it automatically depends on SimpleStore -->
7086
}) %>
7187
<%= react_component('ComponentWithNoStore', {}, {
72-
prerender: true,
73-
store_dependencies: [] <!-- Explicitly declare no store dependencies -->
88+
prerender: true,
89+
store_dependencies: [] <!-- Explicitly declare no store dependencies -->
7490
}) %>
7591
<%= redux_store_hydration_data %>
7692
```

0 commit comments

Comments
 (0)