docs/oss/upgrading/release-notes/16.1.0.md
Update your gem and npm package versions:
# Gemfile
gem "react_on_rails", "16.1.1"
gem "shakapacker", "8.2.0"
// package.json
{
"dependencies": {
"react-on-rails": "16.1.1",
"shakapacker": "8.2.0"
}
}
Then run bundle install and your package manager's install command.
Important: The shakapacker gem and npm package versions must match exactly.
| Component | Minimum | Recommended |
|---|---|---|
| Ruby | 3.0 | 3.3+ |
| Node.js | 18 | 22+ |
| Shakapacker | 6.0 | 8.2.0+ |
| React | 18 | 18+ |
| Rails | 5.2 | 7.0+ |
Note: CI tests against Ruby 3.2+ and Node.js 20+, but the gem supports lower versions as shown above.
New diagnostic command for troubleshooting setup issues:
rake react_on_rails:doctor
VERBOSE=true rake react_on_rails:doctor # For detailed output
New configuration options for enhanced server bundle security:
# config/initializers/react_on_rails.rb
ReactOnRails.configure do |config|
# Directory for server bundle output (default: "ssr-generated")
config.server_bundle_output_path = "ssr-generated"
# When enabled, server bundles only load from private directories
config.enforce_private_server_bundles = true
end
The updated bin/dev script provides better development server management with support for multiple modes:
bin/dev - Default HMR mode with webpack-dev-serverbin/dev static - Watch mode without HMRbin/dev prod - Development with production-optimized assetsThree Procfile configurations for different development scenarios:
generateWebpackConfigs.js helper for better configuration managementNote: These improvements only affect newly generated code from rails g react_on_rails:install or component generators. Existing applications are unaffected.
"moduleResolution": "bundler"bin/dev defaults that auto-navigate to /hello_world routev16.1.0 includes important security improvements:
CSS.escape() and proper JavaScript escaping for XSS protection (PR 1791) by AbanoubGhadbanrake react_on_rails:doctor when using packaged gem (PR 1795) by justin808server_bundle_js_file is empty (PR 1802) by justin808Remove config.generated_assets_dirs from your configuration - asset paths are now automatically determined from shakapacker.yml.
Symptom: Assets fail to compile or inconsistent behavior between development and production.
Solution: Ensure your Shakapacker gem and npm package versions match exactly:
# Check gem version
bundle show shakapacker
# Check npm version
npm list shakapacker
# or
yarn list shakapacker
Both should show the same version (e.g., 8.2.0).
Symptom: Server-side rendering fails with "bundle not found" errors.
Solution: If you're using server_bundle_output_path, ensure the directory exists and your build process outputs to that location. Run rake react_on_rails:doctor to diagnose configuration issues.
v16.1.0 introduced foundational changes for React on Rails Pro, including:
These changes are internal and do not affect open-source users. For information about Pro features like streaming SSR, React Server Components, and enhanced performance optimizations, see React on Rails Pro.