Skip to content

Add support for RSC #1644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 105 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ced9044
tmp
AbanoubGhadban Jul 22, 2024
7710b68
tmp
AbanoubGhadban Jul 29, 2024
6748c59
make rsc get the right rsc bundle path
AbanoubGhadban Jul 30, 2024
a5b936f
fix ts error after rebasing
AbanoubGhadban Nov 4, 2024
0e69200
tmp
AbanoubGhadban Nov 5, 2024
f8a2cb9
DRY helper functions
AbanoubGhadban Dec 5, 2024
97247d1
remove duplicate function
AbanoubGhadban Dec 6, 2024
cd96732
revert commiting some lines
AbanoubGhadban Dec 6, 2024
c0e5a55
refactor and add more tests for utils.rb
AbanoubGhadban Dec 18, 2024
8f14356
add rsc_bundle_js_file config and update utils spec
AbanoubGhadban Dec 18, 2024
86d0582
linting
AbanoubGhadban Dec 18, 2024
4706e16
linting
AbanoubGhadban Dec 18, 2024
a70de09
don't set AsyncLocalStorage in global scope
AbanoubGhadban Dec 18, 2024
14c6519
fix mock in webpack assets status checker test
AbanoubGhadban Dec 18, 2024
263750f
mock that webpacker gem is not installed
AbanoubGhadban Dec 18, 2024
a667724
mock availablity of webpacker and shakapacker gems
AbanoubGhadban Dec 18, 2024
32736d0
ensure that webpacker is not used when shakapacker in use in tests
AbanoubGhadban Dec 18, 2024
5e01c8b
remove instance variables of PackerUtils on utils tests
AbanoubGhadban Dec 18, 2024
3d2a73e
make utils rspec test run using the packer installed on CI
AbanoubGhadban Dec 19, 2024
5987cb0
test bundle_js_file_path with webpacker and shakapacker
AbanoubGhadban Dec 19, 2024
75421d6
linting
AbanoubGhadban Dec 19, 2024
fb60b55
remove webpacker test dependency
AbanoubGhadban Dec 19, 2024
42b263e
don't mock gem availablity function
AbanoubGhadban Dec 19, 2024
b24ee8a
add rsc webpack loader
AbanoubGhadban Jan 16, 2025
f6df501
ignore whitespace when comparing scripts
Judahmeek Jan 17, 2025
c03589a
linting
AbanoubGhadban Jan 25, 2025
025d3ca
Update knip config to add rsc entry points
AbanoubGhadban Jan 25, 2025
5840117
Update knip config to use .js extension for RSCWebpackLoader
AbanoubGhadban Jan 25, 2025
5bf7a87
linting
AbanoubGhadban Jan 25, 2025
36e539f
[WIP] Hydrate components immediately after downloading chunks (#1656)
AbanoubGhadban Jan 31, 2025
ea42e81
Fix client startup rendering when the script runs after the page loaded
AbanoubGhadban Feb 1, 2025
fe2da15
Refactor client-side rendering and page lifecycle management
AbanoubGhadban Feb 1, 2025
72978a2
Add component registry timeout configuration
AbanoubGhadban Feb 3, 2025
3af4387
Refactor CallbackRegistry and clientStartup initialization
AbanoubGhadban Feb 3, 2025
e83901b
Update StoreRegistry error messages for clarity
AbanoubGhadban Feb 3, 2025
7655f43
Fix RSC stream parsing to handle incomplete chunks
AbanoubGhadban Feb 6, 2025
4308e4e
Refactor CallbackRegistry to improve item tracking and usage
AbanoubGhadban Feb 6, 2025
38eafd2
Refactor CallbackRegistry and ComponentRegistry to simplify item trac…
AbanoubGhadban Feb 7, 2025
f9333ef
Update StoreRegistry test to use clearHydratedStores method
AbanoubGhadban Feb 7, 2025
c4f087b
Update RSC test to append newline to stream chunks
AbanoubGhadban Feb 7, 2025
c230617
don't strip the html chunk
AbanoubGhadban Feb 9, 2025
a018826
Add "use client" directive to RSCClientRoot
AbanoubGhadban Feb 9, 2025
b98b8a0
Convert RSCWebpackLoader to TypeScript
alexeyr Feb 10, 2025
e1cfc09
Comment on the need for workaround
alexeyr Feb 10, 2025
baa3a6a
Fix Knip
alexeyr Feb 10, 2025
637c665
Simplify RSCWebpackLoader
alexeyr Feb 10, 2025
c1c9e78
remove rsc? and stream? render options and add render_mode option
AbanoubGhadban Feb 13, 2025
8350954
Rename flight_payload_streaming to rsc_payload_streaming
AbanoubGhadban Feb 13, 2025
9cc79eb
refactoring
AbanoubGhadban Feb 13, 2025
907f190
Add async component retrieval and timeout handling to ComponentRegistry
AbanoubGhadban Feb 13, 2025
bc39925
add specs for packs generator
AbanoubGhadban Feb 14, 2025
fb66838
Update react_on_rails_helper_spec with new props added to component d…
AbanoubGhadban Feb 14, 2025
0ce9498
Remove webpacker dependency from Gemfile.lock
AbanoubGhadban Feb 14, 2025
9640fe8
Remove unnecessary webpacker mocking in configuration spec
AbanoubGhadban Feb 14, 2025
ea89406
Update package.json exports for React Server Components
AbanoubGhadban Feb 16, 2025
d56de7a
fix: don't trim html content on server
AbanoubGhadban Feb 16, 2025
85467e3
Enable prerendering by default for React Server Components
AbanoubGhadban Feb 16, 2025
f5f145b
Rename RSC rendering methods and configuration to payload generation
AbanoubGhadban Feb 17, 2025
fb48ae6
add more comments for new components
AbanoubGhadban Feb 17, 2025
2f5de75
linting
AbanoubGhadban Feb 17, 2025
dc905b2
Update package.json exports order for React Server Components
AbanoubGhadban Feb 18, 2025
d124fd8
remove prerender option for stream_react_component
AbanoubGhadban Feb 18, 2025
3446864
small linting changes
AbanoubGhadban Feb 18, 2025
1a19ddb
Use node 16 to run oldes tests
AbanoubGhadban Feb 18, 2025
d0c054c
Remove unnecessary data-store-dependencies attribute from test scripts
AbanoubGhadban Feb 18, 2025
1d42a0f
linting
AbanoubGhadban Feb 18, 2025
2215ed5
Convert loadReactClientManifest to async and update RSC rendering
AbanoubGhadban Feb 18, 2025
e162f8e
make RSCClientRoot tests compatible with React 19
AbanoubGhadban Feb 20, 2025
f80c948
Test fetch function only with node version 18+
AbanoubGhadban Feb 20, 2025
ad63a6f
pass props to RSC generator and avoid state reset on hydration
AbanoubGhadban Feb 20, 2025
04d7309
Add ignore configuration for Knip static analysis
AbanoubGhadban Feb 20, 2025
e52613c
small changes
AbanoubGhadban Feb 20, 2025
a54b4cc
Implement stream buffering to safely handle stream events and errors
AbanoubGhadban Feb 21, 2025
e38f557
Fix stream error emission in buffered stream
AbanoubGhadban Feb 21, 2025
afdfeb5
Simplify streaming result parsing logic in server rendering
AbanoubGhadban Feb 21, 2025
a86dd9b
remove mentions to experiment react 18 and use only react 19
AbanoubGhadban Feb 21, 2025
069a0e1
Refactor registerServerComponent into client and server modules
AbanoubGhadban Feb 22, 2025
85f1974
Add RSCWebpackPlugin for React Server Components
AbanoubGhadban Feb 22, 2025
ebdc9c3
Replace react-server-dom-webpack with @shakacode-tools/react-on-rails…
AbanoubGhadban Feb 24, 2025
1d590cd
Update TypeScript configuration and package dependencies for React Se…
AbanoubGhadban Feb 26, 2025
453df4f
Remove webpack dependency from package configuration
AbanoubGhadban Feb 26, 2025
c525dac
Update @shakacode-tools/react-on-rails-rsc dependency to latest commit
AbanoubGhadban Feb 26, 2025
005c29a
Make reactOnRailsPageLoaded async
AbanoubGhadban Feb 26, 2025
280ba06
Update configuration to enable force_load by default and modify redux…
AbanoubGhadban Feb 26, 2025
5eacb93
Bump version to 15.0.0-alpha.2 and update CHANGELOG
AbanoubGhadban Feb 26, 2025
d8460c4
revert this: Update package to use @abanoubghadban/react-on-rails-rsc
AbanoubGhadban Mar 3, 2025
b0173f1
Configure .npmrc for private GitHub package registry
AbanoubGhadban Mar 3, 2025
4de5e78
Update import statements for path and fs modules in test file
AbanoubGhadban Mar 4, 2025
aec0357
Update test specs to add data-force-load attribute by default
AbanoubGhadban Mar 4, 2025
6fd73e7
Add null check for ReactOnRails global object in component and store …
AbanoubGhadban Mar 4, 2025
f1d0964
Bump version to 15.0.0.alpha.2
AbanoubGhadban Mar 4, 2025
b1a3bbf
Update GitHub Actions workflows to use Shakacode Tools Packages Token
AbanoubGhadban Mar 4, 2025
109293f
Update package to use @shakacode-tools/react-on-rails-rsc
AbanoubGhadban Mar 5, 2025
233aefe
Revert version to 14.2.0 and update CHANGELOG
AbanoubGhadban Mar 5, 2025
3b137fa
Enhance server-side rendering error logging and debugging
AbanoubGhadban Mar 6, 2025
59359ae
Remove temporary debugging breakpoint in server rendering
AbanoubGhadban Mar 6, 2025
61a0b6c
Revert gem version to 14.2.0 in Gemfile.lock
AbanoubGhadban Mar 6, 2025
fb69bf7
Remove backtrace from server rendering error logging
AbanoubGhadban Mar 6, 2025
4eb472d
Update package to use react-on-rails-rsc package instead of the old p…
AbanoubGhadban Mar 7, 2025
eb1daef
Update CHANGELOG and knip configuration
AbanoubGhadban Mar 7, 2025
da1fa52
Change default defer behavior for generated component packs
AbanoubGhadban Mar 7, 2025
6339773
Update test to reflect new default defer behavior for generated compo…
AbanoubGhadban Mar 7, 2025
51e1341
Update CHANGELOG and release notes for React on Rails 15.0.0
AbanoubGhadban Mar 7, 2025
4c5a0f2
Add domNodeId support for server-side rendering identifier prefix to …
AbanoubGhadban Mar 7, 2025
018f404
Remove PR references from 15.0.0 release notes
AbanoubGhadban Mar 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/rspec-package-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
git config user.email "[email protected]"
git config user.name "Your Name"
git commit -am "stop generators from complaining about uncommitted code"
- name: Set packer version environment variable
run: |
echo "CI_PACKER_VERSION=${{ matrix.versions == 'oldest' && 'old' || 'new' }}" >> $GITHUB_ENV
- name: Run rspec tests
run: bundle exec rspec spec/react_on_rails
- name: Store test results
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
### [Unreleased]
Changes since the last non-beta release.

See [Release Notes](docs/release-notes/15.0.0.md) for full details.

#### Added
- React Server Components Support (Pro Feature) [PR 1644](https://github.com/shakacode/react_on_rails/pull/1644) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
- Improved component and store hydration performance [PR 1656](https://github.com/shakacode/react_on_rails/pull/1656) by [AbanoubGhadban](https://github.com/AbanoubGhadban).

#### Breaking Changes
- `ReactOnRails.reactOnRailsPageLoaded` is now an async function
- `force_load` configuration now defaults to `true`
- `defer_generated_component_packs` configuration now defaults to `false`

### [14.2.0] - 2025-03-03

#### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
react_on_rails (14.1.1)
react_on_rails (14.2.0)
addressable
connection_pool
execjs (~> 2.5)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/javascript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The best source of docs is the main [ReactOnRails.ts](https://github.com/shakaco
getStore(name, throwIfMissing = true )

/**
* Renders or hydrates the react element passed. In case react version is >=18 will use the new api.
* Renders or hydrates the React element passed. In case React version is >=18 will use the root API.
* @param domNode
* @param reactElement
* @param hydrate if true will perform hydration, if false will render
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ ReactOnRails.configure do |config|
# config.server_bundle_js_file for the filename.
config.make_generated_server_bundle_the_entrypoint = false

# Default is true, which matches Webpacker/Shakapacker's defer default for `append_javascript_pack`
# Set this to false to have `defer: false` added to your `append_javascript_pack` calls for generated entrypoints.
config.defer_generated_component_packs = true
# Default is false
# Set this to true to have `defer: true` added to your `append_javascript_pack` calls for generated entrypoints.
config.defer_generated_component_packs = false

################################################################################
# I18N OPTIONS
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/streaming-server-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ React on Rails Pro supports streaming server rendering using React 18's latest A
## Prerequisites

- React on Rails Pro subscription
- React 18 or higher (experimental version)
- React 19
- React on Rails v15.0.0-alpha.0 or higher
- React on Rails Pro v4.0.0.rc.5 or higher

Expand All @@ -19,14 +19,14 @@ React on Rails Pro supports streaming server rendering using React 18's latest A

## Implementation Steps

1. **Use Experimental React 18 Version**
1. **Use React 19 Version**

First, ensure you're using React 18's experimental version in your package.json:
First, ensure you're using React 19 in your package.json:

```json
"dependencies": {
"react": "18.3.0-canary-670811593-20240322",
"react-dom": "18.3.0-canary-670811593-20240322"
"react": "19.0.0",
"react-dom": "19.0.0"
}
```

Expand Down
78 changes: 78 additions & 0 deletions docs/release-notes/15.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# React on Rails 15.0.0 Release Notes

## Major Features

### 🚀 React Server Components Support
Experience the future of React with full RSC integration in your Rails apps:
- Seamlessly use React Server Components
- Reduce client bundle sizes
- Enable powerful new patterns for data fetching
- ⚡️ Requires React on Rails Pro - [See the full tutorial](https://www.shakacode.com/react-on-rails-pro/docs/react-server-components-tutorial)

### Improved Component Hydration
Major improvements to component and store hydration:
- Components and stores now hydrate immediately rather than waiting for page load
- Enables faster hydration, especially beneficial for streamed pages
- Components can hydrate before the page is fully streamed
- Can use `async` scripts in the page with no fear of race condition
- No need to use `defer` anymore

## Breaking Changes

### Component Hydration Changes
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.

- `ReactOnRails.reactOnRailsPageLoaded()` is now an async function:
- If you are manually calling this function to ensure components are hydrated (e.g. with async script loading), you must now await the promise it returns:
```js
// Before
ReactOnRails.reactOnRailsPageLoaded();
// Code expecting all components to be hydrated

// After
await ReactOnRails.reactOnRailsPageLoaded();
// Code expecting all components to be hydrated
```

## Store Dependencies for Components

When using Redux stores with multiple components, you need to explicitly declare store dependencies to optimize hydration. Here's how:

### The Problem

If you have deferred Redux stores and components like this:

```erb
<% redux_store("SimpleStore", props: @app_props_server_render, defer: true) %>
<%= react_component('ReduxApp', {}, {prerender: true}) %>
<%= react_component('ComponentWithNoStore', {}, {prerender: true}) %>
<%= redux_store_hydration_data %>
```

By default, React on Rails assumes components depend on all previously created stores. This means:
- Neither `ReduxApp` nor `ComponentWithNoStore` will hydrate until `SimpleStore` is hydrated
- Since the store is deferred to the end of the page, both components are forced to wait unnecessarily

### The Solution

Explicitly declare store dependencies for each component:

```erb
<% redux_store("SimpleStore", props: @app_props_server_render, defer: true) %>
<%= react_component('ReduxApp', {}, {
prerender: true
<!-- No need to specify store_dependencies - it automatically depends on SimpleStore -->
}) %>
<%= react_component('ComponentWithNoStore', {}, {
prerender: true,
store_dependencies: [] <!-- Explicitly declare no store dependencies -->
}) %>
<%= redux_store_hydration_data %>
```

This allows `ComponentWithNoStore` to hydrate immediately without waiting for `SimpleStore`, improving page performance.
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
const nodeVersion = parseInt(process.version.slice(1), 10);

module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/node_package/tests/jest.setup.js'],
// React Server Components tests are compatible with React 19
// That only run with node version 18 and above
moduleNameMapper:
nodeVersion < 18
? {
'react-on-rails-rsc/client': '<rootDir>/node_package/tests/emptyForTesting.js',
'^@testing-library/dom$': '<rootDir>/node_package/tests/emptyForTesting.js',
'^@testing-library/react$': '<rootDir>/node_package/tests/emptyForTesting.js',
}
: {},
};
15 changes: 13 additions & 2 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ const config: KnipConfig = {
// ! at the end means files are used in production
workspaces: {
'.': {
entry: ['node_package/src/ReactOnRails.ts!', 'node_package/src/ReactOnRails.node.ts!'],
project: ['node_package/src/**/*.[jt]s!', 'node_package/tests/**/*.[jt]s'],
entry: [
'node_package/src/ReactOnRails.node.ts!',
'node_package/src/ReactOnRailsRSC.ts!',
'node_package/src/registerServerComponent/client.ts!',
'node_package/src/registerServerComponent/server.ts!',
'node_package/src/RSCClientRoot.ts!',
],
project: ['node_package/src/**/*.[jt]s{x,}!', 'node_package/tests/**/*.[jt]s{x,}'],
babel: {
config: ['node_package/babel.config.js'],
},
ignore: [
'node_package/tests/emptyForTesting.js',
],
ignoreBinaries: [
// Knip fails to detect it's declared in devDependencies
'nps',
Expand All @@ -26,6 +35,8 @@ const config: KnipConfig = {
'eslint-plugin-react',
// Used in CI
'@arethetypeswrong/cli',
// used by Jest
'jsdom',
],
},
'spec/dummy': {
Expand Down
41 changes: 32 additions & 9 deletions lib/react_on_rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def self.configure
end

DEFAULT_GENERATED_ASSETS_DIR = File.join(%w[public webpack], Rails.env).freeze
DEFAULT_REACT_CLIENT_MANIFEST_FILE = "react-client-manifest.json"
DEFAULT_COMPONENT_REGISTRY_TIMEOUT = 5000

def self.configuration
@configuration ||= Configuration.new(
Expand All @@ -17,6 +19,8 @@ def self.configuration
# generated_assets_dirs is deprecated
generated_assets_dir: "",
server_bundle_js_file: "",
rsc_bundle_js_file: "",
react_client_manifest_file: DEFAULT_REACT_CLIENT_MANIFEST_FILE,
prerender: false,
auto_load_bundle: false,
replay_console: true,
Expand All @@ -39,9 +43,13 @@ def self.configuration
i18n_output_format: nil,
components_subdirectory: nil,
make_generated_server_bundle_the_entrypoint: false,
defer_generated_component_packs: true,
defer_generated_component_packs: false,
# forces the loading of React components
force_load: false
force_load: true,
# Maximum time in milliseconds to wait for client-side component registration after page load.
# If exceeded, an error will be thrown for server-side rendered components not registered on the client.
# Set to 0 to disable the timeout and wait indefinitely for component registration.
component_registry_timeout: DEFAULT_COMPONENT_REGISTRY_TIMEOUT
)
end

Expand All @@ -56,8 +64,8 @@ class Configuration
:server_render_method, :random_dom_id, :auto_load_bundle,
:same_bundle_for_client_and_server, :rendering_props_extension,
:make_generated_server_bundle_the_entrypoint,
:defer_generated_component_packs,
:force_load
:defer_generated_component_packs, :force_load, :rsc_bundle_js_file,
:react_client_manifest_file, :component_registry_timeout

# rubocop:disable Metrics/AbcSize
def initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender: nil,
Expand All @@ -72,7 +80,8 @@ def initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender
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)
components_subdirectory: nil, auto_load_bundle: nil, force_load: nil,
rsc_bundle_js_file: nil, react_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
Expand All @@ -96,9 +105,12 @@ def initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender
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.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
Expand Down Expand Up @@ -126,10 +138,19 @@ def setup_config_values
error_if_using_packer_and_generated_assets_dir_not_match_public_output_path
# check_deprecated_settings
adjust_precompile_task
check_component_registry_timeout
end

private

def check_component_registry_timeout
self.component_registry_timeout = DEFAULT_COMPONENT_REGISTRY_TIMEOUT if component_registry_timeout.nil?

return if component_registry_timeout.is_a?(Integer) && component_registry_timeout >= 0

raise ReactOnRails::Error, "component_registry_timeout must be a positive integer"
end

def check_autobundling_requirements
raise_missing_components_subdirectory if auto_load_bundle && !components_subdirectory.present?
return unless components_subdirectory.present?
Expand Down Expand Up @@ -241,10 +262,12 @@ def configure_generated_assets_dirs_deprecation
def ensure_webpack_generated_files_exists
return unless webpack_generated_files.empty?

files = ["manifest.json"]
files << server_bundle_js_file if server_bundle_js_file.present?

self.webpack_generated_files = files
self.webpack_generated_files = [
"manifest.json",
server_bundle_js_file,
rsc_bundle_js_file,
react_client_manifest_file
].compact_blank
end

def configure_skip_display_none_deprecation
Expand Down
Loading
Loading