Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a70280d
use RSC payload to SSR server components
AbanoubGhadban Apr 10, 2025
1354b68
refactoring
AbanoubGhadban Apr 11, 2025
37d6f72
linting
AbanoubGhadban Apr 11, 2025
32b3f6c
simplify SimpleComponent.jsx
AbanoubGhadban Apr 17, 2025
dd0db5b
Update react_on_rails dependency to revision 029c273 in Gemfile.lock …
AbanoubGhadban Apr 26, 2025
ddf2d38
Update import statement for ReactOnRails in vm.ts
AbanoubGhadban Apr 28, 2025
3535f1e
Add ability to render server components inside client components (add…
AbanoubGhadban Jun 7, 2025
7d2e6eb
fix eslint errors
AbanoubGhadban Jun 8, 2025
22c8547
Update react_on_rails dependency to use RSC payload for server compon…
AbanoubGhadban Jun 8, 2025
b825345
add example of refetching and retrying to render server components
AbanoubGhadban Jun 9, 2025
1fcf102
Update react_on_rails dependency to revision 7b2e1f10 for improved se…
AbanoubGhadban Jun 9, 2025
74911f5
Update react_on_rails dependency to revision b9954a25
AbanoubGhadban Jun 9, 2025
2621472
Update react_on_rails dependency to revision 9cd81f9 for improved ser…
AbanoubGhadban Jun 11, 2025
76506de
update to react@19.1.0
AbanoubGhadban Jun 16, 2025
257caf4
Revert "update to react@19.1.0"
AbanoubGhadban Jun 16, 2025
ac02d36
Update react_on_rails dependency to revision c9c59f81 for improved se…
AbanoubGhadban Jun 16, 2025
b491e8d
Update integration tests to use URL-encoded props for server componen…
AbanoubGhadban Jun 16, 2025
873dd0f
Update react_on_rails dependency to version 15.0.0.rc.0 in Gemfile an…
AbanoubGhadban Jun 17, 2025
0ad03ff
fix jest tests
AbanoubGhadban Jun 17, 2025
1a732df
Revert "fix jest tests"
AbanoubGhadban Jun 17, 2025
4ba3c64
Update react_on_rails dependency to use GitHub repository and branch
AbanoubGhadban Jun 18, 2025
db7915d
Update react_on_rails dependency to use the master branch in Gemfile,…
AbanoubGhadban Jun 18, 2025
9e349a0
Update react_on_rails dependency to version 15.0.0.rc.1 in Gemfile, p…
AbanoubGhadban Jun 19, 2025
17bd974
Update react_on_rails dependency to version 15.0.0.rc.1 in Gemfile.lo…
AbanoubGhadban Jun 19, 2025
be31cfe
fix race condition while moving assets when multiple bundles provided
AbanoubGhadban Jun 21, 2025
63f87a2
Update JavaScript renderer configuration documentation, remove unused…
AbanoubGhadban Jun 21, 2025
3366c78
Revert "fix race condition while moving assets when multiple bundles …
AbanoubGhadban Jun 21, 2025
b188830
Reapply "fix race condition while moving assets
AbanoubGhadban Jun 21, 2025
d047edd
Enhance server rendering tests by adding RSC support configuration ma…
AbanoubGhadban Jun 22, 2025
f19f88c
Revert "Enhance server rendering tests by adding RSC support configur…
AbanoubGhadban Jun 22, 2025
e37ef48
Duplicate assets_to_copy array to prevent unintended modifications to…
AbanoubGhadban Jun 22, 2025
7b00cc7
Update CHANGELOG.md
AbanoubGhadban Jun 22, 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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ You can find the **package** version numbers from this repo's tags and below in
## [Unreleased]
*Add changes in master not yet tagged.*

## [4.0.0-rc.14] - 2025-06-22

### Improved
- Improved RSC rendering flow by eliminating double rendering of server components and reducing the number of HTTP requests.
- Updated communication protocol between Node Renderer and Rails to version 2.0.0 which supports the ability to upload multiple bundles at once.
- Added the ability to communicate between different bundles on the renderer by using the `runOnOtherBundle` function which is globally available for the rendering request.

[PR 515](https://github.com/shakacode/react_on_rails_pro/pull/515) by [AbanoubGhadban](https://github.com/AbanoubGhadban).


## [4.0.0-rc.13] - 2025-03-07

### Added
- 🚀 **Introducing React Server Components Support!** 🎉
- Experience the future of React with full RSC integration
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.development_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.3.7'

gem "react_on_rails", "15.0.0.alpha.2" # keep in sync with package.json files
gem "react_on_rails", "15.0.0.rc.1" # keep in sync with package.json files

# For local development
# Add the following line to the Gemfile.local file
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ GEM
ffi (~> 1.0)
rdoc (6.12.0)
psych (>= 4.0.0)
react_on_rails (15.0.0.alpha.2)
react_on_rails (15.0.0.rc.1)
addressable
connection_pool
execjs (~> 2.5)
Expand Down Expand Up @@ -462,7 +462,7 @@ DEPENDENCIES
pry-theme
puma (~> 6)
rails (~> 7.1)
react_on_rails (= 15.0.0.alpha.2)
react_on_rails (= 15.0.0.rc.1)
react_on_rails_pro!
rspec-rails
rspec-retry
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
plugins: ['@babel/plugin-syntax-import-attributes'],
};
8 changes: 6 additions & 2 deletions docs/node-renderer/js-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Here are the options available for the JavaScript renderer configuration object,
1. **logHttpLevel** (default: `process.env.RENDERER_LOG_HTTP_LEVEL || 'error'`) - The HTTP server log level (same allowed values as `logLevel`).
1. **fastifyServerOptions** (default: `{}`) - Additional options to pass to the Fastify server factory. See [Fastify documentation](https://fastify.dev/docs/latest/Reference/Server/#factory).
1. **bundlePath** (default: `process.env.RENDERER_BUNDLE_PATH || '/tmp/react-on-rails-pro-node-renderer-bundles'` ) - path to a temp directory where uploaded bundle files will be stored. For example you can set it to `path.resolve(__dirname, './.node-renderer-bundles')` if you configured renderer from the `/` directory of your app.
1. **workersCount** (default: `env.RENDERER_WORKERS_COUNT || defaultWorkersCount()` where default is your CPUs count - 1) - Number of workers that will be forked to serve rendering requests. If you set this manually make sure that value is a **Number** and is `>= 1`.
1. **workersCount** (default: `process.env.RENDERER_WORKERS_COUNT || defaultWorkersCount()` where default is your CPUs count - 1) - Number of workers that will be forked to serve rendering requests. If you set this manually make sure that value is a **Number** and is `>= 0`. Setting this to `0` will run the renderer in a single process mode without forking any workers, which is useful for debugging purposes. For production use, the value should be `>= 1`.
1. **password** (default: `env.RENDERER_PASSWORD`) - The password expected to receive from the **Rails client** to authenticate rendering requests.
If no password is set, no authentication will be required.
1. **allWorkersRestartInterval** (default: `env.RENDERER_ALL_WORKERS_RESTART_INTERVAL`) - Interval in minutes between scheduled restarts of all workers. By default restarts are not enabled. If restarts are enabled, `delayBetweenIndividualWorkerRestarts` should also be set.
Expand Down Expand Up @@ -63,10 +63,14 @@ const config = {
// All other values are the defaults, as described above
};

// For debugging, run in single process mode
if (process.env.NODE_ENV === 'development') {
config.workersCount = 0;
}
// Renderer detects a total number of CPUs on virtual hostings like Heroku or CircleCI instead
// of CPUs number allocated for current container. This results in spawning many workers while
// only 1-2 of them really needed.
if (process.env.CI) {
else if (process.env.CI) {
config.workersCount = 2;
}

Expand Down
Loading