From 62dcc7264eb83b5b703b3ed0de1f11799f278877 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 12 Nov 2025 16:02:56 -1000 Subject: [PATCH 1/4] Rename bundlePath to serverBundleCachePath in node renderer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change renames the `bundlePath` configuration option to `serverBundleCachePath` to better describe its purpose and avoid confusion with Shakapacker's public bundle path. Key changes: - Add `serverBundleCachePath` to Config interface - Deprecate `bundlePath` with warning messages - Support both env vars: RENDERER_SERVER_BUNDLE_CACHE_PATH (new) and RENDERER_BUNDLE_PATH (deprecated) - Update all internal code to use new name - Update documentation and examples - Update test files and helper functions The old `bundlePath` option continues to work with a deprecation warning to maintain backwards compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- react_on_rails_pro/docs/installation.md | 59 ++++++++++++------- .../docs/node-renderer/basics.md | 45 ++++++++------ .../docs/node-renderer/js-configuration.md | 45 +++++++------- .../node-renderer/src/shared/configBuilder.ts | 39 ++++++++++-- .../node-renderer/src/shared/utils.ts | 4 +- .../packages/node-renderer/tests/helper.ts | 16 ++--- .../tests/testingNodeRendererConfigs.js | 2 +- .../node-renderer/tests/worker.test.ts | 38 ++++++------ .../spec/dummy/client/node-renderer.js | 2 +- 9 files changed, 151 insertions(+), 99 deletions(-) diff --git a/react_on_rails_pro/docs/installation.md b/react_on_rails_pro/docs/installation.md index 76b2846d1c..62d46f0ef5 100644 --- a/react_on_rails_pro/docs/installation.md +++ b/react_on_rails_pro/docs/installation.md @@ -1,4 +1,5 @@ # Installation + Since the repository is private, you will get a **GitHub Personal Access Token** and an account that can access the packages. Substitute that value in the commands below. If you dont' have this, ask [justin@shakacode.com](mailto:justin@shakacode.com) to give you one. Check the [CHANGELOG](https://github.com/shakacode/react_on_rails_pro/blob/master/CHANGELOG.md) to see what version you want. @@ -8,13 +9,16 @@ Check the [CHANGELOG](https://github.com/shakacode/react_on_rails_pro/blob/maste For the below docs, find the desired `` in the CHANGELOG. Note, for pre-release versions, gems have all periods, and node packages uses a dash, like gem `3.0.0.rc.0` and node package `3.0.0-rc.0`. # Ruby + ## Gem Installation + 1. Ensure your **Rails** app is using the **react_on_rails** gem, version greater than 11.0.7. -1. Add the `react_on_rails_pro` gem to your **Gemfile**. Substitute the appropriate version number. - +1. Add the `react_on_rails_pro` gem to your **Gemfile**. Substitute the appropriate version number. + ## Gemfile Change Replace the following in the snippet for the Gemfile + 1. `` for the api key 2. `` 3. `` desired @@ -33,6 +37,7 @@ source "https://rubygems.pkg.github.com/shakacode-tools" do gem "react_on_rails_pro", "" end ``` + Or use the `gem install` command: ```bash @@ -46,23 +51,27 @@ bundle config set rubygems.pkg.github.com : ``` ## Using a branch in your Gemfile + Note, you should probably use an ENV value for the token so that you don't check this into your source code. - ```ruby - gem "react_on_rails_pro", version: "", git: "https://[your-github-token]:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git", tag: "" - ``` + +```ruby +gem "react_on_rails_pro", version: "", git: "https://[your-github-token]:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git", tag: "" +``` ## Rails Configuration -You don't need to create an initializer if you are satisfied with the default as described in + +You don't need to create an initializer if you are satisfied with the default as described in [Configuration](./configuration.md) # Node Package + Note, you only need to install the Node Package if you are using the standalone node renderer, `NodeRenderer`. ## Installation 1. Create a subdirectory of your rails project for the Node renderer. Let's use `react-on-rails-pro`. - 2. Create a file `react-on-rails-pro/.npmrc` with the following + ``` always-auth=true //npm.pkg.github.com/:_authToken= @@ -70,6 +79,7 @@ always-auth=true ``` 3. Create a `react-on-rails-pro/package.json` + ```json { "private": true, @@ -86,20 +96,18 @@ always-auth=true If you really want to use yarn, see [Yarn can't find private Github npm registry](https://stackoverflow.com/questions/58316109/yarn-cant-find-private-github-npm-registry) -5. You can start the renderer with either the executable `node-renderer` or, preferably, with +5. You can start the renderer with either the executable `node-renderer` or, preferably, with a startup JS file, say called `react-on-rails-pro/react-on-rails-pro-node-renderer.js` with - these contents. _Note the use of the namespaced **`@shakacode-tools/react-on-rails-pro-node-renderer`** for the package. + these contents. \_Note the use of the namespaced **`@shakacode-tools/react-on-rails-pro-node-renderer`** for the package. ```js -const path = require('path') -const { - reactOnRailsProNodeRenderer, -} = require('@shakacode-tools/react-on-rails-pro-node-renderer') +const path = require('path'); +const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); -const env = process.env +const env = process.env; const config = { - bundlePath: path.resolve(__dirname, '../.node-renderer-bundles'), + serverBundleCachePath: path.resolve(__dirname, '../.node-renderer-bundles'), // Listen at RENDERER_PORT env value or default port 3800 logLevel: env.RENDERER_LOG_LEVEL || 'debug', // show all logs @@ -132,21 +140,22 @@ const config = { // Also, you can set he parameter gracefulWorkerRestartTimeout to force the worker to restart // If it's the time for the worker to restart, the worker waits until it serves all active requests before restarting // If a worker stuck because of a memory leakage or an infinite loop, you can set a timeout that master waits for it before killing the worker -} +}; // 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 (env.CI) { - config.workersCount = 2 + config.workersCount = 2; } -reactOnRailsProNodeRenderer(config) +reactOnRailsProNodeRenderer(config); ``` ## Instructions for using a branch Install the node-renderer executable, possibly globally. Substitute the branch name or tag for `master` + ``` yarn global add https://:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git\#master ``` @@ -159,28 +168,34 @@ Login into npm ```bash npm install @shakacode-tools/react-on-rails-pro-node-renderer@ -``` +``` or edit package.json directly + ```json "@shakacode-tools/react-on-rails-pro-node-renderer": "" -``` +``` ### Configuration + See [NodeRenderer JavaScript Configuration](./node-renderer/js-configuration.md). #### Webpack Configuration + Set your server bundle webpack configuration to use a target of `node` per the [Webpack docs](https://webpack.js.org/concepts/targets/#usage). ## Authentication when using Github packages + [Auth for the npm package](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages) Create a new ~/.npmrc file if one doesn't exist. + ``` //npm.pkg.github.com/:_authToken=TOKEN -``` +``` To configure bundler if you don't want the token in your Gemfile: + ``` bundle config https://rubygems.pkg.github.com/OWNER USERNAME:TOKEN -``` +``` diff --git a/react_on_rails_pro/docs/node-renderer/basics.md b/react_on_rails_pro/docs/node-renderer/basics.md index 352e109d63..1ad35caa73 100644 --- a/react_on_rails_pro/docs/node-renderer/basics.md +++ b/react_on_rails_pro/docs/node-renderer/basics.md @@ -1,23 +1,26 @@ # Requirements -* You must use React on Rails v11.0.7 or higher. + +- You must use React on Rails v11.0.7 or higher. # Install the Gem and the Node Module + See [Installation](../installation.md). # Setup Node Renderer Server + **node-renderer** is a standalone Node application to serve React SSR requests from a **Rails** client. You don't need any **Ruby** code to setup and launch it. You can configure with the command line or with a launch file. ## Simple Command Line for node-renderer 1. ENV values for the default config are (See [JS Configuration](./js-configuration.md) for more details): - * `RENDERER_PORT` - * `RENDERER_LOG_LEVEL` - * `RENDERER_BUNDLE_PATH` - * `RENDERER_WORKERS_COUNT` - * `RENDERER_PASSWORD` - * `RENDERER_ALL_WORKERS_RESTART_INTERVAL` - * `RENDERER_DELAY_BETWEEN_INDIVIDUAL_WORKER_RESTARTS` - * `RENDERER_SUPPORT_MODULES` + - `RENDERER_PORT` + - `RENDERER_LOG_LEVEL` + - `RENDERER_BUNDLE_PATH` + - `RENDERER_WORKERS_COUNT` + - `RENDERER_PASSWORD` + - `RENDERER_ALL_WORKERS_RESTART_INTERVAL` + - `RENDERER_DELAY_BETWEEN_INDIVIDUAL_WORKER_RESTARTS` + - `RENDERER_SUPPORT_MODULES` 2. Configure ENV values and run the command. Note, you can set port with args `-p `. For example, assuming node-renderer is in your path: ``` RENDERER_BUNDLE_PATH=/app/.node-renderer-bundles node-renderer @@ -25,6 +28,7 @@ See [Installation](../installation.md). 3. You can use a command line argument of `-p SOME_PORT` to override any ENV value for the PORT. ## JavaScript Configuration File + For the most control over the setup, create a JavaScript file to start the NodeRenderer. 1. Create some project directory, let's say `renderer-app`: @@ -38,22 +42,24 @@ For the most control over the setup, create a JavaScript file to start the NodeR yarn init yarn add https://[your-github-token]:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git\#master ``` -4. Configure a JavaScript file that will launch the rendering server per the docs in [Node Renderer JavaScript Configuration](./js-configuration.md). For example, create a file `node-renderer.js`. Here is a simple example that uses all the defaults except for bundlePath: +4. Configure a JavaScript file that will launch the rendering server per the docs in [Node Renderer JavaScript Configuration](./js-configuration.md). For example, create a file `node-renderer.js`. Here is a simple example that uses all the defaults except for serverBundleCachePath: ```javascript import path from 'path'; import reactOnRailsProNodeRenderer from '@shakacode-tools/react-on-rails-pro-node-renderer'; const config = { - bundlePath: path.resolve(__dirname, '../.node-renderer-bundles'), + serverBundleCachePath: path.resolve(__dirname, '../.node-renderer-bundles'), }; reactOnRailsProNodeRenderer(config); ``` + 5. Now you can launch your renderer server with `node node-renderer.js`. You will probably add a script to your `package.json`. 6. You can use a command line argument of `-p SOME_PORT` to override any configured or ENV value for the port. # Setup Rails Application + Create `config/initializers/react_on_rails_pro.rb` and configure the **renderer server**. See configuration values in [Configuration](../configuration.md). Pay attention to: 1. Set `config.server_renderer = "NodeRenderer"` @@ -61,25 +67,26 @@ Create `config/initializers/react_on_rails_pro.rb` and configure the **renderer 3. Configure values beginning with `renderer_` 4. Use ENV values for values like `renderer_url` so that your deployed server is properly configured. If the ENV value is unset, the default for the renderer_url is `localhost:3800`. 5. Here's a tiny example using mostly defaults: + ```ruby ReactOnRailsPro.configure do |config| config.server_renderer = "NodeRenderer" - - # when this ENV value is not defined, the local server at localhost:3800 is used - config.renderer_url = ENV["REACT_RENDERER_URL"] + + # when this ENV value is not defined, the local server at localhost:3800 is used + config.renderer_url = ENV["REACT_RENDERER_URL"] end ``` ## Troublshooting -* See [JS Memory Leaks](../js-memory-leaks.md). - +- See [JS Memory Leaks](../js-memory-leaks.md). + ## Upgrading The NodeRenderer has a protocol version on both the Rails and Node sides. If the Rails server sends a protocol version that does not match the Node side, an error is returned. Ideally, you want to keep both the Rails and Node sides at the same version. ## References -* [Installation](../installation.md). -* [Rails Options for node-renderer](../configuration.md) -* [JS Options for node-renderer](./js-configuration.md) +- [Installation](../installation.md). +- [Rails Options for node-renderer](../configuration.md) +- [JS Options for node-renderer](./js-configuration.md) diff --git a/react_on_rails_pro/docs/node-renderer/js-configuration.md b/react_on_rails_pro/docs/node-renderer/js-configuration.md index 23c95ef52a..f90a24a934 100644 --- a/react_on_rails_pro/docs/node-renderer/js-configuration.md +++ b/react_on_rails_pro/docs/node-renderer/js-configuration.md @@ -8,40 +8,41 @@ The values in this file must be kept in sync with with the `config/initializers/ Here are the options available for the JavaScript renderer configuration object, as well as the available default ENV values if using the command line program node-renderer. -[//]: # (If you change text here, you may want to update comments in packages/node-renderer/src/shared/configBuilder.ts as well.) +[//]: # 'If you change text here, you may want to update comments in packages/node-renderer/src/shared/configBuilder.ts as well.' 1. **port** (default: `process.env.RENDERER_PORT || 3800`) - The port the renderer should listen to. -[On Heroku](https://devcenter.heroku.com/articles/dyno-startup-behavior#port-binding-of-web-dynos) or [ControlPlane](https://docs.controlplane.com/reference/workload/containers#port-variable) you may want to use `process.env.PORT`. + [On Heroku](https://devcenter.heroku.com/articles/dyno-startup-behavior#port-binding-of-web-dynos) or [ControlPlane](https://docs.controlplane.com/reference/workload/containers#port-variable) you may want to use `process.env.PORT`. 1. **logLevel** (default: `process.env.RENDERER_LOG_LEVEL || 'info'`) - The renderer log level. Set it to `silent` to turn logging off. -[Available levels](https://getpino.io/#/docs/api?id=levels): `{ fatal: 60, error: 50, warn: 40, info: 30, debug: 20, trace: 10 }`. `silent` can be used as well. + [Available levels](https://getpino.io/#/docs/api?id=levels): `{ fatal: 60, error: 50, warn: 40, info: 30, debug: 20, trace: 10 }`. `silent` can be used as well. 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. **serverBundleCachePath** (default: `process.env.RENDERER_SERVER_BUNDLE_CACHE_PATH || process.env.RENDERER_BUNDLE_PATH || '/tmp/react-on-rails-pro-node-renderer-bundles'` ) - Path to a cache directory where uploaded server bundle files will be stored. This is distinct from Shakapacker's public asset directory. 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: `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. + 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. 1. **delayBetweenIndividualWorkerRestarts** (default: `env.RENDERER_DELAY_BETWEEN_INDIVIDUAL_WORKER_RESTARTS`) - Interval in minutes between individual worker restarts (when cluster restart is triggered). By default restarts are not enabled. If restarts are enabled, `allWorkersRestartInterval` should also be set. 1. **gracefulWorkerRestartTimeout**: (default: `env.GRACEFUL_WORKER_RESTART_TIMEOUT`) - Time in seconds that the master waits for a worker to gracefully restart (after serving all active requests) before killing it. Use this when you want to avoid situations where a worker gets stuck in an infinite loop and never restarts. This config is only usable if worker restart is enabled. The timeout starts when the worker should restart; if it elapses without a restart, the worker is killed. 1. **maxDebugSnippetLength** (default: 1000) - If the rendering request is longer than this, it will be truncated in exception and logging messages. -1. **supportModules** - (default: `env.RENDERER_SUPPORT_MODULES || null`) - If set to true, `supportModules` enables the server-bundle code to call a default set of NodeJS global objects and functions that get added to the VM context: -`{ Buffer, TextDecoder, TextEncoder, URLSearchParams, ReadableStream, process, setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, queueMicrotask }`. -This option is required to equal `true` if you want to use loadable components. -Setting this value to false causes the NodeRenderer to behave like ExecJS. -See also `stubTimers`. -1. **additionalContext** - (default: `null`) - additionalContext enables you to specify additional NodeJS objects (usually from https://nodejs.org/api/globals.html) to add to the VM context in addition to our `supportModules` defaults. -Object shorthand notation may be used, but is not required. -Example: `{ URL, Crypto }` -1. **stubTimers** - (default: `env.RENDERER_STUB_TIMERS` if that environment variable is set, `true` otherwise) - With this option set, use of functions `setTimeout`, `setInterval`, `setImmediate`, `clearTimeout`, `clearInterval`, `clearImmediate`, and `queueMicrotask` will do nothing during server-rendering. -This is useful when using dependencies like [react-virtuoso](https://github.com/petyosi/react-virtuoso) that use these functions during hydration. -In RORP, hydration typically is synchronous and single-task (unless you use streaming) and thus callbacks passed to task-scheduling functions should never run during server-side rendering. -Because these functions are valid client-side, they are ignored on server-side rendering without errors or warnings. -See also `supportModules`. +1. **supportModules** - (default: `env.RENDERER_SUPPORT_MODULES || null`) - If set to true, `supportModules` enables the server-bundle code to call a default set of NodeJS global objects and functions that get added to the VM context: + `{ Buffer, TextDecoder, TextEncoder, URLSearchParams, ReadableStream, process, setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, queueMicrotask }`. + This option is required to equal `true` if you want to use loadable components. + Setting this value to false causes the NodeRenderer to behave like ExecJS. + See also `stubTimers`. +1. **additionalContext** - (default: `null`) - additionalContext enables you to specify additional NodeJS objects (usually from https://nodejs.org/api/globals.html) to add to the VM context in addition to our `supportModules` defaults. + Object shorthand notation may be used, but is not required. + Example: `{ URL, Crypto }` +1. **stubTimers** - (default: `env.RENDERER_STUB_TIMERS` if that environment variable is set, `true` otherwise) - With this option set, use of functions `setTimeout`, `setInterval`, `setImmediate`, `clearTimeout`, `clearInterval`, `clearImmediate`, and `queueMicrotask` will do nothing during server-rendering. + This is useful when using dependencies like [react-virtuoso](https://github.com/petyosi/react-virtuoso) that use these functions during hydration. + In RORP, hydration typically is synchronous and single-task (unless you use streaming) and thus callbacks passed to task-scheduling functions should never run during server-side rendering. + Because these functions are valid client-side, they are ignored on server-side rendering without errors or warnings. + See also `supportModules`. Deprecated options: -1. **honeybadgerApiKey**, **sentryDsn**, **sentryTracing**, **sentryTracesSampleRate** - Deprecated and have no effect. -If you have any of them set, see [Error Reporting and Tracing](./error-reporting-and-tracing.md) for the new way to set up error reporting and tracing. +1. **bundlePath** - Renamed to `serverBundleCachePath`. The old name will continue to work but will log a deprecation warning. +1. **honeybadgerApiKey**, **sentryDsn**, **sentryTracing**, **sentryTracesSampleRate** - Deprecated and have no effect. + If you have any of them set, see [Error Reporting and Tracing](./error-reporting-and-tracing.md) for the new way to set up error reporting and tracing. 1. **includeTimerPolyfills** - Renamed to `stubTimers`. ## Example Launch Files @@ -53,13 +54,14 @@ If you have any of them set, see [Error Reporting and Tracing](./error-reporting ### Simple example: Create a file './node-renderer.js' + ```js import path from 'path'; import { reactOnRailsProNodeRenderer } from '@shakacode-tools/react-on-rails-pro-node-renderer'; const config = { // Save bundles to relative "./.node-renderer-bundles" dir of our app - bundlePath: path.resolve(__dirname, './.node-renderer-bundles'), + serverBundleCachePath: path.resolve(__dirname, './.node-renderer-bundles'), // All other values are the defaults, as described above }; @@ -76,7 +78,6 @@ else if (process.env.CI) { } reactOnRailsProNodeRenderer(config); - ``` And add this line to your `scripts` section of `package.json` diff --git a/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts b/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts index cb4494d066..d63a9e52d3 100644 --- a/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts +++ b/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts @@ -34,8 +34,11 @@ export interface Config { // Additional options to pass to the Fastify server factory. // See https://fastify.dev/docs/latest/Reference/Server/#factory. fastifyServerOptions: FastifyServerOptions; - // Path to a temp directory where uploaded bundle files will be stored. - bundlePath: string; + // Path to a cache directory where uploaded server bundle files will be stored. + // This is distinct from Shakapacker's public asset directory. + serverBundleCachePath: string; + // @deprecated Use serverBundleCachePath instead. This will be removed in a future version. + bundlePath?: string; // If set to true, `supportModules` enables the server-bundle code to call a default set of NodeJS // global objects and functions that get added to the VM context: // `{ Buffer, TextDecoder, TextEncoder, URLSearchParams, ReadableStream, process, setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, queueMicrotask }`. @@ -102,7 +105,7 @@ function defaultWorkersCount() { } // Find the .node-renderer-bundles folder if it exists, otherwise use /tmp -function defaultBundlePath() { +function defaultServerBundleCachePath() { let currentDir = process.cwd(); const maxDepth = 10; for (let i = 0; i < maxDepth; i += 1) { @@ -148,7 +151,8 @@ const defaultConfig: Config = { fastifyServerOptions: {}, - bundlePath: env.RENDERER_BUNDLE_PATH || defaultBundlePath(), + serverBundleCachePath: + env.RENDERER_SERVER_BUNDLE_CACHE_PATH || env.RENDERER_BUNDLE_PATH || defaultServerBundleCachePath(), supportModules: truthy(env.RENDERER_SUPPORT_MODULES), @@ -192,7 +196,10 @@ function envValuesUsed() { RENDERER_PORT: !userConfig.port && env.RENDERER_PORT, RENDERER_LOG_LEVEL: !userConfig.logLevel && env.RENDERER_LOG_LEVEL, RENDERER_LOG_HTTP_LEVEL: !userConfig.logHttpLevel && env.RENDERER_LOG_HTTP_LEVEL, - RENDERER_BUNDLE_PATH: !userConfig.bundlePath && env.RENDERER_BUNDLE_PATH, + RENDERER_SERVER_BUNDLE_CACHE_PATH: + !userConfig.serverBundleCachePath && env.RENDERER_SERVER_BUNDLE_CACHE_PATH, + RENDERER_BUNDLE_PATH: + !userConfig.serverBundleCachePath && !userConfig.bundlePath && env.RENDERER_BUNDLE_PATH, RENDERER_WORKERS_COUNT: !userConfig.workersCount && env.RENDERER_WORKERS_COUNT, RENDERER_PASSWORD: !userConfig.password && env.RENDERER_PASSWORD && '', RENDERER_SUPPORT_MODULES: !('supportModules' in userConfig) && env.RENDERER_SUPPORT_MODULES, @@ -241,6 +248,28 @@ export function buildConfig(providedUserConfig?: Partial): Config { userConfig = providedUserConfig || {}; config = { ...defaultConfig, ...userConfig }; + // Handle bundlePath deprecation + if ('bundlePath' in userConfig) { + log.warn( + 'bundlePath is deprecated and will be removed in a future version. ' + + 'Use serverBundleCachePath instead. This path stores uploaded server bundles for the node renderer, ' + + 'not client-side webpack assets from Shakapacker.', + ); + // If serverBundleCachePath is not set, use bundlePath as fallback + if ( + !config.serverBundleCachePath || + config.serverBundleCachePath === defaultConfig.serverBundleCachePath + ) { + config.serverBundleCachePath = userConfig.bundlePath; + } + } + if (env.RENDERER_BUNDLE_PATH && !env.RENDERER_SERVER_BUNDLE_CACHE_PATH) { + log.warn( + 'RENDERER_BUNDLE_PATH environment variable is deprecated and will be removed in a future version. ' + + 'Use RENDERER_SERVER_BUNDLE_CACHE_PATH instead.', + ); + } + config.supportModules = truthy(config.supportModules); if (config.maxVMPoolSize <= 0 || !Number.isInteger(config.maxVMPoolSize)) { diff --git a/react_on_rails_pro/packages/node-renderer/src/shared/utils.ts b/react_on_rails_pro/packages/node-renderer/src/shared/utils.ts index 26cb5cc7ad..f11acb3b59 100644 --- a/react_on_rails_pro/packages/node-renderer/src/shared/utils.ts +++ b/react_on_rails_pro/packages/node-renderer/src/shared/utils.ts @@ -157,8 +157,8 @@ export const delay = (milliseconds: number) => }); export function getBundleDirectory(bundleTimestamp: string | number) { - const { bundlePath } = getConfig(); - return path.join(bundlePath, `${bundleTimestamp}`); + const { serverBundleCachePath } = getConfig(); + return path.join(serverBundleCachePath, `${bundleTimestamp}`); } export function getRequestBundleFilePath(bundleTimestamp: string | number) { diff --git a/react_on_rails_pro/packages/node-renderer/tests/helper.ts b/react_on_rails_pro/packages/node-renderer/tests/helper.ts index 0f078ba7e5..080577c1a5 100644 --- a/react_on_rails_pro/packages/node-renderer/tests/helper.ts +++ b/react_on_rails_pro/packages/node-renderer/tests/helper.ts @@ -35,23 +35,23 @@ export function getOtherFixtureAsset() { return path.resolve(__dirname, `./fixtures/${ASSET_UPLOAD_OTHER_FILE}`); } -export function bundlePath(testName: string) { +export function serverBundleCachePath(testName: string) { return path.resolve(__dirname, 'tmp', testName); } export function setConfig(testName: string) { buildConfig({ - bundlePath: bundlePath(testName), + serverBundleCachePath: serverBundleCachePath(testName), }); } export function vmBundlePath(testName: string) { - return path.resolve(bundlePath(testName), `${BUNDLE_TIMESTAMP}`, `${BUNDLE_TIMESTAMP}.js`); + return path.resolve(serverBundleCachePath(testName), `${BUNDLE_TIMESTAMP}`, `${BUNDLE_TIMESTAMP}.js`); } export function vmSecondaryBundlePath(testName: string) { return path.resolve( - bundlePath(testName), + serverBundleCachePath(testName), `${SECONDARY_BUNDLE_TIMESTAMP}`, `${SECONDARY_BUNDLE_TIMESTAMP}.js`, ); @@ -76,7 +76,7 @@ export function secondaryLockfilePath(testName: string) { } export function uploadedBundleDir(testName: string) { - return path.resolve(bundlePath(testName), 'uploads'); + return path.resolve(serverBundleCachePath(testName), 'uploads'); } export function uploadedBundlePath(testName: string) { @@ -96,11 +96,11 @@ export function uploadedAssetOtherPath(testName: string) { } export function assetPath(testName: string, bundleTimestamp: string) { - return path.resolve(bundlePath(testName), bundleTimestamp, ASSET_UPLOAD_FILE); + return path.resolve(serverBundleCachePath(testName), bundleTimestamp, ASSET_UPLOAD_FILE); } export function assetPathOther(testName: string, bundleTimestamp: string) { - return path.resolve(bundlePath(testName), bundleTimestamp, ASSET_UPLOAD_OTHER_FILE); + return path.resolve(serverBundleCachePath(testName), bundleTimestamp, ASSET_UPLOAD_OTHER_FILE); } export async function createUploadedBundle(testName: string) { @@ -129,7 +129,7 @@ export async function createAsset(testName: string, bundleTimestamp: string) { } export async function resetForTest(testName: string) { - await fsExtra.emptyDir(bundlePath(testName)); + await fsExtra.emptyDir(serverBundleCachePath(testName)); resetVM(); setConfig(testName); } diff --git a/react_on_rails_pro/packages/node-renderer/tests/testingNodeRendererConfigs.js b/react_on_rails_pro/packages/node-renderer/tests/testingNodeRendererConfigs.js index b84c246f70..97965053fe 100644 --- a/react_on_rails_pro/packages/node-renderer/tests/testingNodeRendererConfigs.js +++ b/react_on_rails_pro/packages/node-renderer/tests/testingNodeRendererConfigs.js @@ -8,7 +8,7 @@ if (fs.existsSync(BUNDLE_PATH)) { const config = { // This is the default but avoids searching for the Rails root - bundlePath: BUNDLE_PATH, + serverBundleCachePath: BUNDLE_PATH, port: env.RENDERER_PORT || 3800, // Listen at RENDERER_PORT env value or default port 3800 logLevel: env.RENDERER_LOG_LEVEL || 'info', diff --git a/react_on_rails_pro/packages/node-renderer/tests/worker.test.ts b/react_on_rails_pro/packages/node-renderer/tests/worker.test.ts index d024c936a3..6e5be066b8 100644 --- a/react_on_rails_pro/packages/node-renderer/tests/worker.test.ts +++ b/react_on_rails_pro/packages/node-renderer/tests/worker.test.ts @@ -15,14 +15,14 @@ import { getFixtureAsset, getOtherFixtureAsset, createAsset, - bundlePath, + serverBundleCachePath, assetPath, assetPathOther, } from './helper'; const testName = 'worker'; const createVmBundleForTest = () => createVmBundle(testName); -const bundlePathForTest = () => bundlePath(testName); +const serverBundleCachePathForTest = () => serverBundleCachePath(testName); const gemVersion = packageJson.version; const { protocolVersion } = packageJson; @@ -41,7 +41,7 @@ describe('worker', () => { test('POST /bundles/:bundleTimestamp/render/:renderRequestDigest when bundle is provided and did not yet exist', async () => { const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const form = formAutoContent({ @@ -69,7 +69,7 @@ describe('worker', () => { test('POST /bundles/:bundleTimestamp/render/:renderRequestDigest', async () => { const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const form = formAutoContent({ @@ -105,7 +105,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'password', }); @@ -132,7 +132,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'password', }); @@ -159,7 +159,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -187,7 +187,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const res = await app @@ -211,7 +211,7 @@ describe('worker', () => { await createAsset(testName, bundleHash); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -237,7 +237,7 @@ describe('worker', () => { await createAsset(testName, bundleHash); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -261,7 +261,7 @@ describe('worker', () => { test('post /asset-exists requires targetBundles (protocol version 2.0.0)', async () => { await createAsset(testName, String(BUNDLE_TIMESTAMP)); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -283,7 +283,7 @@ describe('worker', () => { const bundleHash = 'some-bundle-hash'; const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -307,7 +307,7 @@ describe('worker', () => { const bundleHashOther = 'some-other-bundle-hash'; const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), password: 'my_password', }); @@ -334,7 +334,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const res = await app @@ -355,7 +355,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const res = await app @@ -379,7 +379,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const res = await app @@ -400,7 +400,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); // If package version is 4.0.0, this tests that 4.0.0.rc.1 gets normalized to 4.0.0-rc.1 @@ -426,7 +426,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const gemVersionUpperCase = packageJson.version.toUpperCase(); @@ -449,7 +449,7 @@ describe('worker', () => { await createVmBundleForTest(); const app = worker({ - bundlePath: bundlePathForTest(), + serverBundleCachePath: serverBundleCachePathForTest(), }); const gemVersionWithWhitespace = ` ${packageJson.version} `; diff --git a/react_on_rails_pro/spec/dummy/client/node-renderer.js b/react_on_rails_pro/spec/dummy/client/node-renderer.js index f2abb36592..f5f2a5c400 100644 --- a/react_on_rails_pro/spec/dummy/client/node-renderer.js +++ b/react_on_rails_pro/spec/dummy/client/node-renderer.js @@ -29,7 +29,7 @@ require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/sentry') const config = { // This is the default but avoids searching for the Rails root - bundlePath: path.resolve(__dirname, '../.node-renderer-bundles'), + serverBundleCachePath: path.resolve(__dirname, '../.node-renderer-bundles'), port: env.RENDERER_PORT || 3800, // Listen at RENDERER_PORT env value or default port 3800 logLevel: env.RENDERER_LOG_LEVEL || 'info', From 5f7a3826d475c44d645198fd34cc896a157ed0e6 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 12 Nov 2025 16:30:15 -1000 Subject: [PATCH 2/4] Fix worker.ts to use serverBundleCachePath instead of deprecated bundlePath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The worker.ts file was still using the old bundlePath property name in two places: 1. When destructuring config from getConfig() 2. When constructing the upload destination path This was a critical runtime bug - when users only set serverBundleCachePath (the new property name), the code would receive undefined for bundlePath, breaking file upload functionality. Changes: - Line 121: Updated destructuring to use serverBundleCachePath - Line 154: Updated path.join call to use serverBundleCachePath 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- react_on_rails_pro/packages/node-renderer/src/worker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react_on_rails_pro/packages/node-renderer/src/worker.ts b/react_on_rails_pro/packages/node-renderer/src/worker.ts index 1fb09efcbc..a8fead3d3f 100644 --- a/react_on_rails_pro/packages/node-renderer/src/worker.ts +++ b/react_on_rails_pro/packages/node-renderer/src/worker.ts @@ -118,7 +118,7 @@ export default function run(config: Partial) { // getConfig(): buildConfig(config); - const { bundlePath, logHttpLevel, port, fastifyServerOptions, workersCount } = getConfig(); + const { serverBundleCachePath, logHttpLevel, port, fastifyServerOptions, workersCount } = getConfig(); const app = fastify({ http2: useHttp2 as true, @@ -151,7 +151,7 @@ export default function run(config: Partial) { fileSize: Infinity, }, onFile: async (part) => { - const destinationPath = path.join(bundlePath, 'uploads', part.filename); + const destinationPath = path.join(serverBundleCachePath, 'uploads', part.filename); // TODO: inline here await saveMultipartFile(part, destinationPath); // eslint-disable-next-line no-param-reassign From 722edd171d03c0c8a5281d9c5229de9522798d3e Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 12 Nov 2025 16:49:04 -1000 Subject: [PATCH 3/4] Fix TypeScript errors from bundlePath to serverBundleCachePath rename in Pro package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following the rename in the main package, update the Pro package's node-renderer to use serverBundleCachePath consistently: 1. configBuilder.ts: Add null check when using deprecated bundlePath as fallback 2. vm.ts: Use serverBundleCachePath instead of bundlePath for debug file paths These changes fix TypeScript compilation errors where bundlePath (optional) was being used where a string was required. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../packages/node-renderer/src/shared/configBuilder.ts | 4 ++-- react_on_rails_pro/packages/node-renderer/src/worker/vm.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts b/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts index d63a9e52d3..cc4df6c809 100644 --- a/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts +++ b/react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts @@ -257,8 +257,8 @@ export function buildConfig(providedUserConfig?: Partial): Config { ); // If serverBundleCachePath is not set, use bundlePath as fallback if ( - !config.serverBundleCachePath || - config.serverBundleCachePath === defaultConfig.serverBundleCachePath + userConfig.bundlePath && + (!config.serverBundleCachePath || config.serverBundleCachePath === defaultConfig.serverBundleCachePath) ) { config.serverBundleCachePath = userConfig.bundlePath; } diff --git a/react_on_rails_pro/packages/node-renderer/src/worker/vm.ts b/react_on_rails_pro/packages/node-renderer/src/worker/vm.ts index 2f751512a4..de3d3e1b83 100644 --- a/react_on_rails_pro/packages/node-renderer/src/worker/vm.ts +++ b/react_on_rails_pro/packages/node-renderer/src/worker/vm.ts @@ -112,7 +112,7 @@ export async function runInVM( filePath: string, vmCluster?: typeof cluster, ): Promise { - const { bundlePath } = getConfig(); + const { serverBundleCachePath } = getConfig(); try { // Wait for VM creation if it's in progress @@ -137,7 +137,7 @@ export async function runInVM( const workerId = vmCluster?.worker?.id; log.debug(`worker ${workerId ? `${workerId} ` : ''}received render request for bundle ${filePath} with code ${smartTrim(renderingRequest)}`); - const debugOutputPathCode = path.join(bundlePath, 'code.js'); + const debugOutputPathCode = path.join(serverBundleCachePath, 'code.js'); log.debug(`Full code executed written to: ${debugOutputPathCode}`); await writeFileAsync(debugOutputPathCode, renderingRequest); } @@ -165,7 +165,7 @@ ${smartTrim(renderingRequest)}`); if (log.level === 'debug') { log.debug(`result from JS: ${smartTrim(result)}`); - const debugOutputPathResult = path.join(bundlePath, 'result.json'); + const debugOutputPathResult = path.join(serverBundleCachePath, 'result.json'); log.debug(`Wrote result to file: ${debugOutputPathResult}`); await writeFileAsync(debugOutputPathResult, result); } From 9713fcf57ea126ea6198cf9f10805ea91c89c75b Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 12 Nov 2025 17:00:25 -1000 Subject: [PATCH 4/4] Add CHANGELOG entry for bundlePath to serverBundleCachePath rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents the configuration option rename in the CHANGELOG under the Changed section, noting backward compatibility with deprecation warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- react_on_rails_pro/CHANGELOG.md | 163 ++++++++++++++++++++++++++------ 1 file changed, 134 insertions(+), 29 deletions(-) diff --git a/react_on_rails_pro/CHANGELOG.md b/react_on_rails_pro/CHANGELOG.md index 651ad786ec..9e4d46c731 100644 --- a/react_on_rails_pro/CHANGELOG.md +++ b/react_on_rails_pro/CHANGELOG.md @@ -1,7 +1,9 @@ # Change Log + All notable changes to this project will be documented in this file. Items under `Unreleased` is upcoming features that will be out in next release. ## Gem and Package Versions + Gem and package versions are the same except for beta releases where the gem uses a `.beta` and the package uses a `-beta` (same for `rc`). 1. **Gem**: `3.0.0.rc.1` @@ -9,55 +11,69 @@ Gem and package versions are the same except for beta releases where the gem use You can find the **package** version numbers from this repo's tags and below in this file. ----- +--- [HEAD compared to 3.3.1]: Click to see all changes compared to the last 3.x version. See the [4.0 Release Notes](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/release-notes/4.0.md). ## [Unreleased] -*Add changes in master not yet tagged.* + +_Add changes in master not yet tagged._ ### Added + - Added `cached_stream_react_component` helper method, similar to `cached_react_component` but for streamed components. - **License Validation System**: Implemented comprehensive JWT-based license validation with offline verification using RSA-256 signatures. License validation occurs at startup in both Ruby and Node.js environments. Supports required fields (`sub`, `iat`, `exp`) and optional fields (`plan`, `organization`, `iss`). FREE evaluation licenses are available for 3 months at [shakacode.com/react-on-rails-pro](https://shakacode.com/react-on-rails-pro). [PR #1857](https://github.com/shakacode/react_on_rails/pull/1857) by [AbanoubGhadban](https://github.com/AbanoubGhadban). - **Pro-Specific Configurations Moved from Open-Source**: The following React Server Components (RSC) configurations are now exclusively in the Pro gem and should be configured in `ReactOnRailsPro.configure`: + - `rsc_bundle_js_file` - Path to the RSC bundle file - `react_server_client_manifest_file` - Path to the React server client manifest - `react_client_manifest_file` - Path to the React client manifest These configurations were previously available in the open-source `ReactOnRails.configure` block but have been moved to Pro where they belong since RSC is a Pro-only feature. + - **Streaming View Helpers Now Pro-Exclusive**: The following view helpers are now defined exclusively in the Pro gem: + - `stream_react_component` - Progressive SSR using React 18+ streaming - `rsc_payload_react_component` - RSC payload rendering These helpers were previously in the open-source gem but have been moved to Pro as they are Pro-only features. + - **Node Renderer Gem Version Validation**: The node renderer now validates that the Ruby gem version (`react_on_rails_pro`) matches the node renderer package version (`@shakacode-tools/react-on-rails-pro-node-renderer`) on every render request. Environment-aware: strict enforcement in development (returns 412 Precondition Failed on mismatch), permissive in production (allows with warning). Includes version normalization to handle Ruby gem vs NPM format differences (e.g., `4.0.0.rc.1` vs `4.0.0-rc.1`). [PR #1881](https://github.com/shakacode/react_on_rails/pull/1881) by [AbanoubGhadban](https://github.com/AbanoubGhadban). +### Changed + +- Renamed Node Renderer configuration option `bundlePath` to `serverBundleCachePath` to better clarify its purpose as a cache directory for uploaded server bundles, distinct from Shakapacker's public asset directory. The old `bundlePath` property and `RENDERER_BUNDLE_PATH` environment variable continue to work with deprecation warnings. [PR 2008](https://github.com/shakacode/react_on_rails/pull/2008) by [justin808](https://github.com/justin808). + ### Changed (Breaking) + - `config.prerender_caching`, which controls caching for non-streaming components, now also controls caching for streamed components. To disable caching for an individual render, pass `internal_option(:skip_prerender_cache)`. - **Configuration Migration Required**: If you are using RSC features, you must move the RSC-related configurations from `ReactOnRails.configure` to `ReactOnRailsPro.configure` in your initializers. See the migration example in the [React on Rails CHANGELOG](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#unreleased). ## [4.0.0-rc.15] - 2025-08-11 ### Fixed + - Fixed an issue where, when React Server Components (RSC) support was disabled, the Node Renderer unnecessarily requested bundles on every render. Now, bundles are only requested when actually needed, improving performance and reducing redundant network traffic. [PR 545](https://github.com/shakacode/react_on_rails_pro/pull/545) by [AbanoubGhadban](https://github.com/AbanoubGhadban). - **Fix `descriptor closed` error**: The errors happens when the node renderer restarts while it's still handling an in-progress request (especially if it's a streaming request that may take more time to handle). Implemented a fix that makes worker shutdown gracefully after it finishes all active requests. When a worker receives the shutdown message, if it doesn't shut down during the `gracefulWorkerRestartTimeout`, the master forcibly kills it. [PR #1970][https://github.com/shakacode/react_on_rails/pull/1970] by [AbanoubGhadban](https://github.com/AbanoubGhadban). ### Changed + - Upgraded HTTPX dependency from 1.3.4 to ~> 1.5 (currently 1.5.1). [PR 520](https://github.com/shakacode/react_on_rails_pro/pull/520) by [AbanoubGhadban](https://github.com/AbanoubGhadban). ## [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 - Seamlessly use React Server Components in your Rails apps @@ -68,24 +84,29 @@ You can find the **package** version numbers from this repo's tags and below in [PR 422](https://github.com/shakacode/react_on_rails_pro/pull/422) by [AbanoubGhadban](https://github.com/AbanoubGhadban). ### Changed (Breaking) + - `ReactOnRailsPro::Utils#copy_assets` retuns `nil` instead of `Response` object. Because it throws an error if an error occurs. ## [4.0.0.rc.11] - 2025-02-09 ### Changed + - [PR 511](https://github.com/shakacode/react_on_rails_pro/pull/511) by [Romex91](https://github.com/Romex91) + - Set `bodyLimit` to 100 MB by default to fix error 413. - Add `fastifyServerOptions` to the config -- Specify exact httpx version until the bug there is fixed [PR #496](https://github.com/shakacode/react_on_rails_pro/pull/496) by [alexeyr-ci](https://github.com/alexeyr-ci) +- Specify exact httpx version until the bug there is fixed [PR #496](https://github.com/shakacode/react_on_rails_pro/pull/496) by [alexeyr-ci](https://github.com/alexeyr-ci) ### Changed + - Renamed `includeTimerPolyfills` configuration option to `stubTimers`. [PR 506](https://github.com/shakacode/react_on_rails_pro/pull/506) by [alexeyr-ci](https://github.com/alexeyr-ci). - Fail immediately on detecting obsolete config options to prevent unexpected misconfigurations. [PR 506](https://github.com/shakacode/react_on_rails_pro/pull/506) by [alexeyr-ci](https://github.com/alexeyr-ci). ## [4.0.0.rc.9] - 2024-12-05 ### Changed + - Error reporting and tracing integrations are completely redone. See [the docs](./docs/node-renderer/error-reporting-and-tracing.md) for details. [PR 471](https://github.com/shakacode/react_on_rails_pro/pull/471) by [alexeyr-ci](https://github.com/alexeyr-ci). - Upgraded to Fastify 5 by default, with an option to fall back to Fastify 4 on older Node versions. [PR 478](https://github.com/shakacode/react_on_rails_pro/pull/478) by [alexeyr-ci](https://github.com/alexeyr-ci). - Logging now uses Pino instead of Winston, aligning with Fastify. [PR 479](https://github.com/shakacode/react_on_rails_pro/pull/479) by [alexeyr-ci](https://github.com/alexeyr-ci). @@ -96,6 +117,7 @@ You can find the **package** version numbers from this repo's tags and below in ## [4.0.0.rc.6] - 2024-11-12 ### Added + - Added streaming server rendering support: - [PR 407](https://github.com/shakacode/react_on_rails_pro/pull/407) by [AbanoubGhadban](https://github.com/AbanoubGhadban). - New `stream_view_containing_react_components` helper method that can be used with `stream_react_component` helper method in react_on_rails gem. @@ -110,24 +132,29 @@ You can find the **package** version numbers from this repo's tags and below in - [PR 440](https://github.com/shakacode/react_on_rails_pro/pull/440) by [AbanoubGhadban](https://github.com/AbanoubGhadban) ### Removed + - Drop support for EOL'd Ruby 2.7 [PR 365](https://github.com/shakacode/react_on_rails_pro/pull/365) by [ahangarha](https://github.com/ahangarha). - Drop support for React on Rails below 14.0.4 [PR 415](https://github.com/shakacode/react_on_rails_pro/pull/415) by [rameziophobia](https://github.com/rameziophobia). ### Fixed + - Updated multiple JS dependencies for bug fixes. - Added execute permission for `spec/dummy/bin/dev` [PR 387](https://github.com/shakacode/react_on_rails_pro/pull/387) by [alexeyr](https://github.com/alexeyr). - Made default bundle paths in node-renderer and Rails consistent [PR 399](https://github.com/shakacode/react_on_rails_pro/pull/399) by [alexeyr-ci](https://github.com/alexeyr-ci). ### Changed + - Support Shakapacker 8.0.0, Modified webpack configurations to use shakapacker instead of webpacker. This drops support for shakapacker 6.X [PR 415](https://github.com/shakacode/react_on_rails_pro/pull/415) by [rameziophobia](https://github.com/rameziophobia). - Converted the node-renderer worker from Express to Fastify [PR 398](https://github.com/shakacode/react_on_rails_pro/pull/398) by [alexeyr-ci](https://github.com/alexeyr-ci). ## [3.3.1] - 2025-08-11 ### Changed + - Converted JS code to TS [PR 386](https://github.com/shakacode/react_on_rails_pro/pull/386) and [PR 389](https://github.com/shakacode/react_on_rails_pro/pull/389) by [alexeyr-ci](https://github.com/alexeyr-ci). ### Fixed + - Removed file size limit for assets and bundles. [PR 459](https://github.com/shakacode/react_on_rails_pro/pull/459) by [alexeyr-ci](https://github.com/alexeyr-ci). - Enabled use as a `git:` dependency. [PR 490](https://github.com/shakacode/react_on_rails_pro/pull/490) by [alexeyr-ci](https://github.com/alexeyr-ci). - Enabled `queueMicrotask` use in server bundle to support React 19. [PR 505](https://github.com/shakacode/react_on_rails_pro/pull/505) by [alexeyr-ci](https://github.com/alexeyr-ci). @@ -135,65 +162,84 @@ You can find the **package** version numbers from this repo's tags and below in - Made compatible with Ruby 3.4. [PR 541](https://github.com/shakacode/react_on_rails_pro/pull/541) by [alexeyr-ci2](https://github.com/alexeyr-ci2). ## [3.2.1] - 2023-06-07 + Fixed release, supports Ruby 2.7.5. See branch https://github.com/shakacode/react_on_rails_pro/tree/3-support-ruby-2-7 ### Fixed + - Removed console errors when `setTimeout` is used server-size. The call is silently ignored for seamless integration of https://github.com/petyosi/react-virtuoso - Numerous Dependabot alerts ## Doc and Spec Only Updates + React 18 is now supported! Check the [React on Rails CHANGELOG.md](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md) for details and the updates to the [loadable-components instructions](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/code-splitting-loadable-components.md). ### Improved + - Updated `Rubocop` version from `1.18.3` to `1.36.0`. Fixed Rubocop warnings. [PR 296](https://github.com/shakacode/react_on_rails_pro/pull/296) by [alkesh26](https://github.com/alkesh26). - Updated dependencies to address known security vulnerabilities ## [3.1.0] - 2022-08-03 + ### Fixed + - Removes `include_execjs_polyfills` options from RoRP gem configuration & adds `include_timer_polyfills` option for Node Renderer configuration, which enables use of setTimeout & other timer functions during server rendering. [PR 281](https://github.com/shakacode/react_on_rails_pro/pull/281) by [judahmeek](https://github.com/judahmeek). ### Improvement + - Warn, do not raise on missing assets [PR 280](https://github.com/shakacode/react_on_rails_pro/pull/280) by [Romex91](https://github.com/Romex91) ## [3.0.1] - 2022-07-011 + ### Fixed + - Fix possible `uninitialized constant ReactOnRails (NameError)` in `lib/react_on_rails_pro/error.rb:4`. [PR 277](https://github.com/shakacode/react_on_rails_pro/pull/273) by [alexeyr](https://github.com/alexeyr). ## [3.0.0] - 2022-07-07 + ### Fixed + - Make asset paths in PrepareNodeRenderBundles relative too. The symlink to the bundle itself was made relative in #231, but asset symlinks remained absolute. This makes them relative too. Fixes #272. [PR 273](https://github.com/shakacode/react_on_rails_pro/pull/273) by [alexeyr](https://github.com/alexeyr). ## [3.0.0-rc.4] - 2022-06-28 + ### Fixed + - Add RAILS_ENV to bundle cache key. This ensures a development bundle will never get accidentally deployed to production. [PR 270](https://github.com/shakacode/react_on_rails_pro/pull/270) by [justin808](https://github.com/justin808). - Replace use of utc_timestamp with Utils.bundle_hash. Important fix as timestamps are not stable between build time and the deployment of a Heroku slug. [PR 269](https://github.com/shakacode/react_on_rails_pro/pull/269) by [Judahmeek](https://github.com/Judahmeek). ## [3.0.0-rc.3] - 2022-04-14 ### Fixed + - Fix prepare_node_renderer script. [PR 254](https://github.com/shakacode/react_on_rails_pro/pull/254) by [judahmeek](https://github.com/judahmeek). - Better logging for error 'Request protocol undefined does not match installed renderer protocol'. [PR 252](https://github.com/shakacode/react_on_rails_pro/pull/252) by [justin808](https://github.com/justin808). ## [3.0.0-rc.1] - 2022-02-26 ### Fixed + - Use relative source path for bundle symlink which conflicted with extraction of (Heroku) slugs caching resulting in incorrect extraction of the slugs due to absolute paths in the symlinks. [PR 231](https://github.com/shakacode/react_on_rails_pro/pull/231) by [judahmeek](https://github.com/judahmeek). ## [3.0.0-rc.0] - 2021-10-27 ### Upgrading to 3.0 + 1. Changed rake task name from vm to node: Rename react_on_rails_pro:pre_stage_bundle_for_vm_renderer to react_on_rails_pro:pre_stage_bundle_for_node_renderer 2. **Bundle Caching**: ReactOnRailsPro::AssetsPrecompile will automatically pre_stage_bundle_for_node_renderer if using the node_renderer. So don't do this twice in another place if using ReactOnRailsPro::AssetsPrecompile for bundle caching. You might have modified your own assets:precompile task. ### Changed + - Moved default location of placed node renderer sym links to be /.node-renderer-bundles as the /tmp directory is typically cleared during slug trimming ### Added + - [PR 220](https://github.com/shakacode/react_on_rails_pro/pull/220) by [justin808](https://github.com/justin808). + - **Add `ssr_timeout` configuration** so the Rails server will not wait more than this many seconds for a SSR request to return once issued. - Change default for `renderer_use_fallback_exec_js` to `false`. - Change default log level to info. @@ -201,6 +247,7 @@ React 18 is now supported! Check the [React on Rails CHANGELOG.md](https://githu - Add support for render functions to be async (returning promises). Also add `include_execjs_polyfills` option to configuration for React on Rails to optionally stop stubbing of setTimeout, setInterval, & clearTimeout polyfills while using NodeRenderer. [PR 210](https://github.com/shakacode/react_on_rails_pro/pull/210) by [judahmeek](https://github.com/judahmeek). ### Fixed + - Ability to call `server_render_js(raw_js)` fixed. Previously, always errored. - Errors during rendering result in ReactOnRails::PrerenderError - When retrying rendering, the retry message is more clear @@ -208,6 +255,7 @@ React 18 is now supported! Check the [React on Rails CHANGELOG.md](https://githu ## [2.3.0] - 2021-09-22 ### Added + - Configuration option for `ssr_timeout` so the Rails server will not wait more than this many seconds for a SSR request to return once issued. Default timeout if not set is 5. `config.ssr_timeout = 5` @@ -222,110 +270,144 @@ React 18 is now supported! Check the [React on Rails CHANGELOG.md](https://githu [justin808](https://github.com/justin808) and [ershadul1](https://github.com/ershadul1). ## [2.2.0] - 2021-07-13 + - Change rake react_on_rails_pro:pre_stage_bundle_for_vm_renderer to use symlinks to save slug size. [PR 202](https://github.com/shakacode/react_on_rails_pro/pull/202) by [justin808](https://github.com/justin808). ## [2.1.1] - 2021-05-29 + - Add optional extra cache values for bundle caching. The cache adapter can now provide a method cache_keys. [PR 196](https://github.com/shakacode/react_on_rails_pro/pull/196) by [justin808](https://github.com/justin808). ## [2.1.0] - 2021-05-15 ### Added + - Optional production bundle caching. [PR 179](https://github.com/shakacode/react_on_rails_pro/pull/179) by [judahmeek](https://github.com/judahmeek). - Added configurations: - `excluded_dependency_globs`: don't include these in caches - `remote_bundle_cache_adapter`: See `docs/bundle-caching.md ------- +--- ### 2.0 Upgrade Steps + 1. Update React on Rails to 12.2.0 2. Be sure to use an API key that has the Github package access and know your API key username. For questions, message Justin Gordon on Slack or [justin@shakacode.com](mailto:justin@shakacode.com). - In your `config/initializers/react_on_rails_pro.rb`: + 1. Rename any references from `config.serializer_globs` to `config.dependency_globs` 1. Rename any references from `vm-renderer` to `node-renderer` 1. Rename `vmRenderer` to `NodeRenderer` Follow the steps for the new installation that uses Github Packages: [docs/installation.md](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/installation.md). + 1. Be sure to namespace the package like `require('@shakacode-tools/react-on-rails-pro-node-renderer');` 1. Add the Honeybadger ("@honeybadger-io/js") or Sentry ("@sentry/node") NPM packages, as those used to be **dependencies**. Now they are optional. 1. Add the `@sentry/tracing` package if you want to try Sentry tracing. See [Error Reporting and Tracing for Sentry and HoneyBadger](./docs/node-renderer/error-reporting-and-tracing.md). For example, the old code might be: + ```js const { reactOnRailsProVmRenderer } = require('react-on-rails-pro-vm-renderer'); ``` + New + ```js const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); ``` ------- + +--- + ## [2.0.0] - 2021-04-02 + - See 2.0 Upgrade steps! ## [2.0.0.beta.3] - 2021-03-31 + #### Improved + - Warn, do not raise on missing assets [PR 176](https://github.com/shakacode/react_on_rails_pro/pull/176) by [Romex91](https://github.com/Romex91) ## [2.0.0.beta.2] - 2021-03-23 + #### Added + - Added option `config.throw_js_errors` so that any errors in SSR will go to the console plus HoneyBadger/Sentry. [PR 174](https://github.com/shakacode/react_on_rails_pro/pull/174) by [justin808](https://github.com/justin808). #### Fixed + - Logs missing error reporting packages (Sentry/HoneyBadger) instead of throwing an error. [PR 174](https://github.com/shakacode/react_on_rails_pro/pull/174) by [justin808](https://github.com/justin808). ## [2.0.0.beta.1] - 2021-03-14 -* Added Sentry Tracing support. [PR 150](https://github.com/shakacode/react_on_rails_pro/pull/150) by [ashgaliyev](https://github.com/ashgaliyev). To use this feature, you need to add `config.sentryTracing = true` (or ENV `SENTRY_TRACING=true`) and optionally the `config.sentryTracesSampleRate = 0.5` (or ENV `SENTRY_TRACES_SAMPLE_RATE=0.5`). The value of the sample rate is the percentage of requests to trace. For documentation of Sentry Tracing, see the [Sentry Performance Monitoring Docs](https://docs.sentry.io/platforms/ruby/performance/), the [Sentry Distributed Tracing Docs](https://docs.sentry.io/product/performance/distributed-tracing/), and the [Sentry Sampling Transactions Docs](https://docs.sentry.io/platforms/ruby/performance/sampling/). The default **config.sentryTracesSampleRate** is **0.1**. -- Renamed `config.serializer_globs`to `config.dependency_globs`. [PR 165](https://github.com/shakacode/react_on_rails_pro/pull/165) by [judahmeek](https://github.com/judahmeek) -- RORP_CACHE_HIT and RORP_CACHE_KEY is returned for prerender caching, which is only when there is no fragment caching. -- Improve cache information from react_component_hash. Hash result now includes 2 new keys - * RORP_CACHE_HIT - * RORP_CACHE_KEY - Additionally, ReactOnRailsPro::Utils.printable_cache_key(cache_key) added. -- [PR 170](https://github.com/shakacode/react_on_rails_pro/pull/170) by [justin808](https://github.com/justin808). +- Added Sentry Tracing support. [PR 150](https://github.com/shakacode/react_on_rails_pro/pull/150) by [ashgaliyev](https://github.com/ashgaliyev). To use this feature, you need to add `config.sentryTracing = true` (or ENV `SENTRY_TRACING=true`) and optionally the `config.sentryTracesSampleRate = 0.5` (or ENV `SENTRY_TRACES_SAMPLE_RATE=0.5`). The value of the sample rate is the percentage of requests to trace. For documentation of Sentry Tracing, see the [Sentry Performance Monitoring Docs](https://docs.sentry.io/platforms/ruby/performance/), the [Sentry Distributed Tracing Docs](https://docs.sentry.io/product/performance/distributed-tracing/), and the [Sentry Sampling Transactions Docs](https://docs.sentry.io/platforms/ruby/performance/sampling/). The default **config.sentryTracesSampleRate** is **0.1**. + +* Renamed `config.serializer_globs`to `config.dependency_globs`. [PR 165](https://github.com/shakacode/react_on_rails_pro/pull/165) by [judahmeek](https://github.com/judahmeek) +* RORP_CACHE_HIT and RORP_CACHE_KEY is returned for prerender caching, which is only when there is no fragment caching. +* Improve cache information from react_component_hash. Hash result now includes 2 new keys + - RORP_CACHE_HIT + - RORP_CACHE_KEY + Additionally, ReactOnRailsPro::Utils.printable_cache_key(cache_key) added. +* [PR 170](https://github.com/shakacode/react_on_rails_pro/pull/170) by [justin808](https://github.com/justin808). ## [2.0.0.beta.0] - 2020-12-03 -* Renamed VM Renderer to Node Renderer. [PR 140](https://github.com/shakacode/react_on_rails_pro/pull/140) by [justin808](https://github.com/justin808). + +- Renamed VM Renderer to Node Renderer. [PR 140](https://github.com/shakacode/react_on_rails_pro/pull/140) by [justin808](https://github.com/justin808). ### Fixed + - Cache key not stable between machines same deploy. [PR 159](https://github.com/shakacode/react_on_rails_pro/pull/136) by [justin808](https://github.com/justin808). ## [1.5.6] - 2020-12-02 + Switched to releases being published packages. ### Fixed + - Minor fix to error messages - Updated gem and package dependencies ## [1.5.5] - 2020-08-17 + ### Added + - Added request retrying in case of timeouts. [PR 136](https://github.com/shakacode/react_on_rails_pro/pull/136) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.5.4] - 2020-07-22 + ### Added + - Added support for Github packages. To switch from using the Github private repo with a tag, request a new auth token from justin@shakacode.com. ## [1.5.3] - 2020-06-30 + ### Added + - Added sentry support. [PR 132](https://github.com/shakacode/react_on_rails_pro/pull/132) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.5.2] - 2020-06-25 + ### Improved + - Added `process` and `Buffer` to the context if `suppportModules === true`. [PR 131](https://github.com/shakacode/react_on_rails_pro/pull/131) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.5.1] - 2020-03-25 + ### Improved -- config.assets_to_copy can take a single value in addition to an array. [PR 122](https://github.com/shakacode/react_on_rails_pro/pull/122 ) [justin808](https://github.com/justin808). -- Better handling for an invalid renderer_url configuration. [PR 109](https://github.com/shakacode/react_on_rails_pro/pull/109 ) [justin808](https://github.com/justin808). + +- config.assets_to_copy can take a single value in addition to an array. [PR 122](https://github.com/shakacode/react_on_rails_pro/pull/122) [justin808](https://github.com/justin808). +- Better handling for an invalid renderer_url configuration. [PR 109](https://github.com/shakacode/react_on_rails_pro/pull/109) [justin808](https://github.com/justin808). ## [1.5.0] - 2020-03-17 + ### Added + - Added support for loadable components SSR [PR 112](https://github.com/shakacode/react_on_rails_pro/pull/112) and [PR 118](https://github.com/shakacode/react_on_rails_pro/pull/118) by [ashgaliyev](https://github.com/ashgaliyev) and [justin808](https://github.com/justin808). - New option added to the node-renderer: `supportModules`. This setting is necessary for using [loadable-components](https://github.com/gregberge/loadable-components/). See [Server-side rendering with code-splitting using Loadable/Components](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/code-splitting-loadable-components.md) for more detailss. ### Changed + - Updated to bundler V2. [PR 114](https://github.com/shakacode/react_on_rails_pro/pull/114) by [justin808](https://github.com/justin808). - Updated spec dummy. [PR 115](https://github.com/shakacode/react_on_rails_pro/pull/115) by [justin808](https://github.com/justin808). @@ -334,28 +416,39 @@ Switched to releases being published packages. ## [1.4.4] - 2019-06-10 ### Fixed + - Improve error handling. [PR 103](https://github.com/shakacode/react_on_rails_pro/pull/103) by [justin808](https://github.com/justin808). ## [1.4.3] - 2019-06-06 + ### Fixed + - Lock timeouts and update error handling. Previously, many renderer errors resulted in crashes rather than a fallback -to ExecJS. Also, lengthened the lock timeouts for the bundle lock. [PR 100](https://github.com/shakacode/react_on_rails_pro/pull/100) by [justin808](https://github.com/justin808). + to ExecJS. Also, lengthened the lock timeouts for the bundle lock. [PR 100](https://github.com/shakacode/react_on_rails_pro/pull/100) by [justin808](https://github.com/justin808). - Added check to skip pre-render cache for components rendered by `cache_react_component` and `cache_react_component_hash` because this saves on cache storage, thus improving overall performance. [PR 91](https://github.com/shakacode/react_on_rails_pro/pull/91) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.4.2] - 2019-05-26 + ### Changed + - Removed babel processing. Node v12 recommended. [PR 93](https://github.com/shakacode/react_on_rails_pro/pull/91) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.4.1] - 2019-03-19 + ### Fixed + - `cached_react_component_hash` incorrectly failed to include the bundle_hash unless `prerender: true` was used as an option. This fix addresses that issue. There is no need to use `prerender: true` as generating a hash only makes sense if prerendering is done. [PR 82](https://github.com/shakacode/react_on_rails_pro/pull/82) by [justin808](https://github.com/justin808). ## [1.4.0] - 2019-01-15 + ### Added + - Added config option `honeybadgerApiKey` or ENV value `HONEYBADGER_API_KEY` so that errors can flow to HoneyBadger. [PR 93](https://github.com/shakacode/react_on_rails_pro/pull/75) by [ashgaliyev](https://github.com/ashgaliyev). ## [1.3.1] - 2018-12-26 + ### Added + - Added option `cache_options:` to the cached_react_component_hash and cached_react_component a hash including values such as :compress, :expires_in, :race_condition_ttl - Added option `:if`, `:unless` to the cached_react_component_hash and cached_react_component @@ -366,49 +459,61 @@ to ExecJS. Also, lengthened the lock timeouts for the bundle lock. [PR 100](http Above are in [PR 82](https://github.com/shakacode/react_on_rails_pro/pull/82) by [justin808](https://github.com/justin808) ## [1.3.0] - 2018-12-18 -* **Migration:** react_on_rails must be updated to version >= 11.2.1. + +- **Migration:** react_on_rails must be updated to version >= 11.2.1. ### Added + - Added `config.ssr_pre_hook_js` to call some JavaScript to clear out state from libraries that misbehave during server Rendering. For example, suppose that we had to call `SomeLibrary.clearCache()` between calls to server renderer. Note, SomeLibrary needs to be globally exposed in the server rendering webpack bundle. ## [1.2.1] - 2018-08-26 + ### Fixed -* Major overhaul of the node-renderer. Improved logging and error handling, ready for async -* Fixed race conditions with init of renderer -* Improved logging -* Ensuring all places that an error will result in a 400 sent to the rails server. -* Handle threading issue with writing the bundle by using a lockfile. -* Change internals so that async rendering is ready. -* Add debugging instructions -* Promisified some node APIs and wrote everything with careful async/await syntax, ensuring that errors are always caught and that promises are always returned from the async functions. + +- Major overhaul of the node-renderer. Improved logging and error handling, ready for async +- Fixed race conditions with init of renderer +- Improved logging +- Ensuring all places that an error will result in a 400 sent to the rails server. +- Handle threading issue with writing the bundle by using a lockfile. +- Change internals so that async rendering is ready. +- Add debugging instructions +- Promisified some node APIs and wrote everything with careful async/await syntax, ensuring that errors are always caught and that promises are always returned from the async functions. Above are in [PR 65](https://github.com/shakacode/react_on_rails_pro/pull/65) by [justin808](https://github.com/justin808). ## [1.2.0] -* **Migration:** react_on_rails must be updated to version 11.1.x+. + +- **Migration:** react_on_rails must be updated to version 11.1.x+. ### Added + - Added `serializer_globs` configuration value to add a MD5 of serializer files to the cache key for fragment caching. [#60](https://github.com/shakacode/react_on_rails_pro/pull/60) by [justin808](https://github.com/justin808). - More efficient calculation of the request digest. Previously, we would do a regexp replace to filter out the dom node id because if was randomized. React on Rails 11.1.x provides a default to say not to randomize. [#64](https://github.com/shakacode/react_on_rails_pro/pull/64) by [justin808](https://github.com/justin808). ### Fixed + - Fix for truncation of code and better error logs. This fixes the issue with truncation of the code when over 1 MB due to large props. Max changes to 10 MB. [#63](https://github.com/shakacode/react_on_rails_pro/pull/63) by [justin808](https://github.com/justin808). ## [1.1.0] + ### Added + - Added `tracing` configuration flag to time server rendering calls ### Changed + - Default usage of PORT and LOG_LEVEL for the node-renderer bin file changed to use values RENDERER_PORT and RENDERER_LOG_LEVEL - Default Rails config.server_render is "ExecJS". Previously was "VmRenderer" Above changes in [PR 52](https://github.com/shakacode/react_on_rails_pro/pull/52) by [justin808](https://github.com/justin808). ## [1.0.0] + ### Added + - support for node renderer & fallback renderer - support for javascript evaluation caching - advanced error handling