react_on_rails 16.0.1.rc.4 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AI_AGENT_INSTRUCTIONS.md +63 -0
- data/CHANGELOG.md +38 -63
- data/Gemfile.development_dependencies +4 -0
- data/Gemfile.lock +7 -1
- data/README.md +28 -22
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/tasks/generate_packs.rake +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e606cadbca5e1019c44272e88ae2a7ec148b9becf9817dc74925fc531bb2b80f
|
4
|
+
data.tar.gz: 88a6a32f2def3bdb2231a39e5900c1b0c5054e2f2d7c3126a53599b85e54a767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4548a73877807049e0ce8ba5146468e473e6c0b17765e1866f001cd2dba6564d00e51b1a70a9ff8a421dc396f108908da68913a97f86167d6aac32e6ca792658
|
7
|
+
data.tar.gz: 8f4ab4ed17438e1d64ccd1c7b54417e6158ea39d3b1498f04b7778fe65eb735a8fdbe0cce112d11388ab14d26ff6e0cbdd846a7af79740333af35aecdf34a942
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# 🤖 AI Agent Instructions: React on Rails Setup
|
2
|
+
|
3
|
+
_Super concise, copy-paste instructions for AI agents to set up React on Rails in common scenarios._
|
4
|
+
|
5
|
+
## 🔍 **Before Starting: Check Current Versions**
|
6
|
+
|
7
|
+
```bash
|
8
|
+
# Get latest available versions (recommended approach)
|
9
|
+
gem search react_on_rails --remote
|
10
|
+
```
|
11
|
+
|
12
|
+
Install and update gem and npm package using strict option.
|
13
|
+
|
14
|
+
---
|
15
|
+
|
16
|
+
## 🆕 Scenario 1: New Rails App with React on Rails
|
17
|
+
|
18
|
+
```bash
|
19
|
+
# Create new Rails app
|
20
|
+
rails new myapp --skip-javascript --database=postgresql
|
21
|
+
cd myapp
|
22
|
+
|
23
|
+
# Use latest version
|
24
|
+
bundle add react_on_rails --strict
|
25
|
+
|
26
|
+
bin/rails generate react_on_rails:install
|
27
|
+
|
28
|
+
# Accept change to bin/dev
|
29
|
+
|
30
|
+
# Start development servers
|
31
|
+
bin/dev
|
32
|
+
```
|
33
|
+
|
34
|
+
**✅ Success Check:** Visit `http://localhost:3000/hello_world` → Should see "Hello World" from React
|
35
|
+
|
36
|
+
---
|
37
|
+
|
38
|
+
## 🔄 Scenario 2: Add React on Rails to Existing Rails App
|
39
|
+
|
40
|
+
```bash
|
41
|
+
cd /path/to/existing/app
|
42
|
+
# Use latest version
|
43
|
+
bundle add react_on_rails --strict
|
44
|
+
|
45
|
+
bin/rails generate react_on_rails:install
|
46
|
+
|
47
|
+
# Accept change to bin/dev
|
48
|
+
|
49
|
+
# Start development servers
|
50
|
+
bin/dev
|
51
|
+
# Navigate to existing Rails app root
|
52
|
+
|
53
|
+
# Start development
|
54
|
+
bin/dev
|
55
|
+
```
|
56
|
+
|
57
|
+
---
|
58
|
+
|
59
|
+
## 🛠️ Common Troubleshooting Commands
|
60
|
+
|
61
|
+
- Always run `bin/dev` to test setup, and check browser console for any JavaScript errors
|
62
|
+
- `bin/dev kill` stops other conflicting processes
|
63
|
+
- `bin/rake react_on_rails:doctor` for helpful information
|
data/CHANGELOG.md
CHANGED
@@ -23,100 +23,74 @@ After a release, please make sure to run `bundle exec rake update_changelog`. Th
|
|
23
23
|
|
24
24
|
Changes since the last non-beta release.
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
- **Removed `generated_assets_dirs` configuration**: The legacy `config.generated_assets_dirs` option is no longer supported and will raise an error if used. Since Shakapacker is now required, asset paths are automatically determined from `shakapacker.yml` configuration. Remove any `config.generated_assets_dirs` from your `config/initializers/react_on_rails.rb` file. Use `public_output_path` in `config/shakapacker.yml` to customize asset output location instead. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798)
|
26
|
+
### [16.1.0] - 2025-09-23
|
29
27
|
|
30
28
|
#### New Features
|
31
29
|
|
32
30
|
- **Server Bundle Security**: Added new configuration options for enhanced server bundle security and organization:
|
33
31
|
|
34
|
-
- `server_bundle_output_path`: Configurable directory (relative to the Rails root) for server bundle output (default: "ssr-generated"). If set to `nil`, the server bundle will be loaded from the same public directory as client bundles.
|
35
|
-
- `enforce_private_server_bundles`: When enabled, ensures server bundles are only loaded from private directories outside the public folder (default: false for backward compatibility)
|
32
|
+
- `server_bundle_output_path`: Configurable directory (relative to the Rails root) for server bundle output (default: "ssr-generated"). If set to `nil`, the server bundle will be loaded from the same public directory as client bundles. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
33
|
+
- `enforce_private_server_bundles`: When enabled, ensures server bundles are only loaded from private directories outside the public folder (default: false for backward compatibility) [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
36
34
|
|
37
35
|
- **Improved Bundle Path Resolution**: Bundle path resolution for server bundles now works as follows:
|
36
|
+
|
38
37
|
- If `server_bundle_output_path` is set, the server bundle is loaded from that directory.
|
39
38
|
- If `server_bundle_output_path` is not set, the server bundle falls back to the client bundle directory (typically the public output path).
|
40
39
|
- If `enforce_private_server_bundles` is enabled:
|
41
40
|
- The server bundle will only be loaded from the private directory specified by `server_bundle_output_path`.
|
42
41
|
- If the bundle is not found there, it will _not_ fall back to the public directory.
|
43
42
|
- If `enforce_private_server_bundles` is not enabled and the bundle is not found in the private directory, it will fall back to the public directory.
|
44
|
-
- This logic ensures that, when strict enforcement is enabled, server bundles are never loaded from public directories, improving security and clarity of bundle resolution.
|
43
|
+
- This logic ensures that, when strict enforcement is enabled, server bundles are never loaded from public directories, improving security and clarity of bundle resolution. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
44
|
+
|
45
|
+
- **`react_on_rails:doctor` rake task**: New diagnostic command to validate React on Rails setup and identify configuration issues. Provides comprehensive checks for environment prerequisites, dependencies, Rails integration, and Webpack configuration. Use `rake react_on_rails:doctor` to diagnose your setup, with optional `VERBOSE=true` for detailed output. [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
46
|
+
|
47
|
+
#### Deprecations
|
48
|
+
|
49
|
+
- **Deprecated `generated_assets_dirs` configuration**: The legacy `config.generated_assets_dirs` option is now deprecated and will show a deprecation warning if used. Since Shakapacker is now required, asset paths are automatically determined from `shakapacker.yml` configuration. Remove any `config.generated_assets_dirs` from your `config/initializers/react_on_rails.rb` file. Use `public_output_path` in `config/shakapacker.yml` to customize asset output location instead. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
45
50
|
|
46
51
|
#### API Improvements
|
47
52
|
|
48
53
|
- **Method Naming Clarification**: Added `public_bundles_full_path` method to clarify bundle path handling:
|
49
54
|
- `public_bundles_full_path`: New method specifically for webpack bundles in public directories
|
50
55
|
- `generated_assets_full_path`: Now deprecated (backwards-compatible alias)
|
51
|
-
- This eliminates confusion between webpack bundles and general Rails public assets
|
56
|
+
- This eliminates confusion between webpack bundles and general Rails public assets [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
52
57
|
|
53
58
|
#### Security Enhancements
|
54
59
|
|
55
|
-
- **Private Server Bundle Enforcement**: When `enforce_private_server_bundles` is enabled, server bundles bypass public directory fallbacks and are only loaded from designated private locations
|
56
|
-
- **Path Validation**: Added validation to ensure `server_bundle_output_path` points to private directories when enforcement is enabled
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
- **Non-Packer Environment Compatibility**: Fixed potential NoMethodError when using bundle path resolution in environments without Shakapacker
|
61
|
-
- **Shakapacker version requirements**: Fixed inconsistent version requirements between basic pack generation (6.5.1+) and advanced auto-bundling features (7.0.0+). Added backward compatibility for users on Shakapacker 6.5.1-6.9.x while providing clear upgrade guidance for advanced features. Added new constants `MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING` and improved version checking performance with caching. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798)
|
60
|
+
- **Private Server Bundle Enforcement**: When `enforce_private_server_bundles` is enabled, server bundles bypass public directory fallbacks and are only loaded from designated private locations [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
61
|
+
- **Path Validation**: Added validation to ensure `server_bundle_output_path` points to private directories when enforcement is enabled [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
62
|
+
- **Fixed command injection vulnerabilities**: Replaced unsafe string interpolation in generator package installation commands with secure array-based system calls [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
63
|
+
- **Improved input validation**: Enhanced package manager validation and argument sanitization across all generators [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
64
|
+
- **Hardened DOM selectors**: Using `CSS.escape()` and proper JavaScript escaping for XSS protection [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
62
65
|
|
63
|
-
|
66
|
+
#### Pro License Features
|
64
67
|
|
65
|
-
|
68
|
+
- **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
69
|
+
- **Runtime license validation**: Implemented Pro license gating with graceful fallback to core functionality when Pro license unavailable [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
70
|
+
- **Enhanced immediate hydration**: Improved immediate hydration functionality with Pro license validation and warning badges [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
71
|
+
- **License documentation**: Added NOTICE files in Pro directories referencing canonical `REACT-ON-RAILS-PRO-LICENSE.md` [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
66
72
|
|
67
|
-
|
73
|
+
#### Generator Improvements
|
68
74
|
|
69
|
-
|
75
|
+
- **Modern TypeScript patterns**: Generators now produce more idiomatic TypeScript code with improved type inference instead of explicit type annotations [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
76
|
+
- **Optimized tsconfig.json**: Updated compiler options to use `"moduleResolution": "bundler"` for better bundler compatibility [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
77
|
+
- **Enhanced Redux TypeScript integration**: Improved type safety and modern React patterns (useMemo, type-only imports) [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
78
|
+
- **Smart bin/dev defaults**: Generated `bin/dev` script now automatically navigates to `/hello_world` route for immediate component visibility [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
79
|
+
- **Better component templates**: Removed unnecessary type annotations while maintaining type safety through TypeScript's inference [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
80
|
+
- **Cleaner generated code**: Streamlined templates following modern React and TypeScript best practices [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
81
|
+
- **Improved helper methods**: Added reusable `component_extension` helper for consistent file extension handling [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
70
82
|
|
71
83
|
#### Bug Fixes
|
72
84
|
|
73
|
-
- **Doctor rake task**: Fixed LoadError in `rake react_on_rails:doctor` when using packaged gem. The task was trying to require excluded `rakelib/task_helpers` file. [PR 1795](https://github.com/shakacode/react_on_rails/pull/1795)
|
74
|
-
- **
|
85
|
+
- **Doctor rake task**: Fixed LoadError in `rake react_on_rails:doctor` when using packaged gem. The task was trying to require excluded `rakelib/task_helpers` file. [PR 1795](https://github.com/shakacode/react_on_rails/pull/1795) by [justin808](https://github.com/justin808)
|
86
|
+
- **Packs generator**: Fixed error when `server_bundle_js_file` configuration is empty (default). Added safety check to prevent attempting operations on invalid file paths when server-side rendering is not configured. [PR 1802](https://github.com/shakacode/react_on_rails/pull/1802) by [justin808](https://github.com/justin808)
|
87
|
+
- **Non-Packer Environment Compatibility**: Fixed potential NoMethodError when using bundle path resolution in environments without Shakapacker [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
88
|
+
- **Shakapacker version requirements**: Fixed inconsistent version requirements between basic pack generation (6.5.1+) and advanced auto-bundling features (7.0.0+). Added backward compatibility for users on Shakapacker 6.5.1-6.9.x while providing clear upgrade guidance for advanced features. Added new constants `MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_BUNDLING` and improved version checking performance with caching. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
|
75
89
|
|
76
|
-
#### Code
|
90
|
+
#### Code Improvements
|
77
91
|
|
78
92
|
- **PackerUtils abstraction removal**: Removed unnecessary `PackerUtils.packer` abstraction method and replaced all calls with direct `::Shakapacker` usage. This simplifies the codebase by eliminating an abstraction layer that was originally created to support multiple webpack tools but is no longer needed since we only support Shakapacker. All tests updated accordingly. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [claude-code](https://claude.ai/code)
|
79
|
-
|
80
|
-
### [16.0.1-rc.0] - 2025-09-19
|
81
|
-
|
82
|
-
#### Pro License Structure Implementation
|
83
|
-
|
84
|
-
**🔐 License Architecture**
|
85
|
-
|
86
|
-
- **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [abanoubghadban](https://github.com/AbanoubGhadban)
|
87
|
-
- **Runtime license validation**: Implemented Pro license gating with graceful fallback to core functionality when Pro license unavailable
|
88
|
-
- **License documentation**: Added NOTICE files in Pro directories referencing canonical `REACT-ON-RAILS-PRO-LICENSE.md`
|
89
|
-
- **Updated LICENSE.md**: Clearly distinguishes core MIT license from Pro-licensed directories
|
90
|
-
|
91
|
-
**⚡ Pro Feature Enhancements**
|
92
|
-
|
93
|
-
- **Immediate hydration**: Enhanced immediate hydration functionality with Pro license validation and warning badges
|
94
|
-
- **Security improvements**: Hardened DOM selectors using `CSS.escape()` and proper JavaScript escaping for XSS protection
|
95
|
-
- **Architecture refactoring**: Centralized Pro utilities and clean separation between core and Pro helper functionality
|
96
|
-
|
97
|
-
#### Enhanced TypeScript Generator Support
|
98
|
-
|
99
|
-
**🔧 Generator Improvements**
|
100
|
-
|
101
|
-
- **Modern TypeScript patterns**: Generators now produce more idiomatic TypeScript code with improved type inference instead of explicit type annotations [PR 1786](https://github.com/shakacode/react_on_rails/pull/1786) by [justin808](https://github.com/justin808)
|
102
|
-
- **Optimized tsconfig.json**: Updated compiler options to use `"moduleResolution": "bundler"` for better bundler compatibility
|
103
|
-
- **Enhanced Redux TypeScript integration**: Improved type safety and modern React patterns (useMemo, type-only imports)
|
104
|
-
- **Smart bin/dev defaults**: Generated `bin/dev` script now automatically navigates to `/hello_world` route for immediate component visibility
|
105
|
-
|
106
|
-
**🔐 Security Enhancements**
|
107
|
-
|
108
|
-
- **Fixed command injection vulnerabilities**: Replaced unsafe string interpolation in generator package installation commands with secure array-based system calls
|
109
|
-
- **Improved input validation**: Enhanced package manager validation and argument sanitization across all generators
|
110
|
-
|
111
|
-
**🎯 Developer Experience**
|
112
|
-
|
113
|
-
- **Better component templates**: Removed unnecessary type annotations while maintaining type safety through TypeScript's inference
|
114
|
-
- **Cleaner generated code**: Streamlined templates following modern React and TypeScript best practices
|
115
|
-
- **Improved helper methods**: Added reusable `component_extension` helper for consistent file extension handling
|
116
|
-
|
117
|
-
#### Added
|
118
|
-
|
119
|
-
- **`react_on_rails:doctor` rake task**: New diagnostic command to validate React on Rails setup and identify configuration issues. Provides comprehensive checks for environment prerequisites, dependencies, Rails integration, and Webpack configuration. Use `rake react_on_rails:doctor` to diagnose your setup, with optional `VERBOSE=true` for detailed output.
|
93
|
+
- **Architecture refactoring**: Centralized Pro utilities and clean separation between core and Pro helper functionality [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
|
120
94
|
|
121
95
|
### [16.0.0] - 2025-09-16
|
122
96
|
|
@@ -1702,7 +1676,8 @@ such as:
|
|
1702
1676
|
|
1703
1677
|
- Fix several generator-related issues.
|
1704
1678
|
|
1705
|
-
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/16.0.1-rc.
|
1679
|
+
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/16.0.1-rc.4...master
|
1680
|
+
[16.0.1-rc.4]: https://github.com/shakacode/react_on_rails/compare/16.0.1-rc.2...16.0.1-rc.4
|
1706
1681
|
[16.0.1-rc.2]: https://github.com/shakacode/react_on_rails/compare/16.0.1-rc.0...16.0.1-rc.2
|
1707
1682
|
[16.0.1-rc.0]: https://github.com/shakacode/react_on_rails/compare/16.0.0...16.0.1-rc.0
|
1708
1683
|
[16.0.0]: https://github.com/shakacode/react_on_rails/compare/14.2.0...16.0.0
|
@@ -39,6 +39,10 @@ group :development, :test do
|
|
39
39
|
gem "scss_lint", require: false
|
40
40
|
gem "spring", "~> 4.0"
|
41
41
|
gem "lefthook", require: false
|
42
|
+
# Added for Ruby 3.5+ compatibility to silence warnings
|
43
|
+
gem "benchmark", require: false
|
44
|
+
gem "logger", require: false
|
45
|
+
gem "ostruct", require: false
|
42
46
|
end
|
43
47
|
|
44
48
|
group :test do
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
react_on_rails (16.
|
4
|
+
react_on_rails (16.1.0)
|
5
5
|
addressable
|
6
6
|
connection_pool
|
7
7
|
execjs (~> 2.5)
|
@@ -91,6 +91,7 @@ GEM
|
|
91
91
|
amazing_print (1.6.0)
|
92
92
|
ast (2.4.2)
|
93
93
|
base64 (0.2.0)
|
94
|
+
benchmark (0.4.1)
|
94
95
|
bigdecimal (3.1.8)
|
95
96
|
bootsnap (1.18.3)
|
96
97
|
msgpack (~> 1.2)
|
@@ -160,6 +161,7 @@ GEM
|
|
160
161
|
listen (3.9.0)
|
161
162
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
162
163
|
rb-inotify (~> 0.9, >= 0.9.10)
|
164
|
+
logger (1.7.0)
|
163
165
|
loofah (2.22.0)
|
164
166
|
crass (~> 1.0.2)
|
165
167
|
nokogiri (>= 1.12.0)
|
@@ -189,6 +191,7 @@ GEM
|
|
189
191
|
nokogiri (1.16.6)
|
190
192
|
mini_portile2 (~> 2.8.2)
|
191
193
|
racc (~> 1.4)
|
194
|
+
ostruct (0.6.1)
|
192
195
|
package_json (0.1.0)
|
193
196
|
parallel (1.24.0)
|
194
197
|
parser (3.3.1.0)
|
@@ -402,6 +405,7 @@ PLATFORMS
|
|
402
405
|
|
403
406
|
DEPENDENCIES
|
404
407
|
amazing_print
|
408
|
+
benchmark
|
405
409
|
bootsnap
|
406
410
|
capybara
|
407
411
|
capybara-screenshot
|
@@ -415,6 +419,8 @@ DEPENDENCIES
|
|
415
419
|
launchy
|
416
420
|
lefthook
|
417
421
|
listen
|
422
|
+
logger
|
423
|
+
ostruct
|
418
424
|
package_json
|
419
425
|
pry
|
420
426
|
pry-byebug
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
[](https://github.com/shakacode/react_on_rails/actions/workflows/rspec-package-specs.yml)
|
17
17
|
[](https://github.com/shakacode/react_on_rails/actions/workflows/lint-js-and-ruby.yml)
|
18
18
|
|
19
|
-
#
|
19
|
+
# ⚡ What's New
|
20
20
|
|
21
21
|
**🚀 React on Rails v16.0 Released!** Major modernization with ESM support, enhanced React Server Components, and streamlined configuration.
|
22
22
|
|
@@ -31,11 +31,13 @@
|
|
31
31
|
|
32
32
|
_These are the docs for React on Rails 16. To see the older docs and code: [v14](https://github.com/shakacode/react_on_rails/tree/14.0.0), [v13](https://github.com/shakacode/react_on_rails/tree/13.4.0), [v12](https://github.com/shakacode/react_on_rails/tree/12.6.0), and [v11](https://github.com/shakacode/react_on_rails/tree/11.3.0)._
|
33
33
|
|
34
|
-
# About
|
34
|
+
# 🎯 About React on Rails
|
35
35
|
|
36
|
-
React
|
36
|
+
**Seamlessly integrate React components into your Rails application** with server-side rendering, hot reloading, and automatic bundle optimization.
|
37
37
|
|
38
|
-
|
38
|
+
> **"The easiest way to add React to Rails"** - Thousands of developers rely on React on Rails for production applications.
|
39
|
+
|
40
|
+
This project is maintained by [ShakaCode](https://www.shakacode.com) with ❤️ from the Rails and React communities.
|
39
41
|
|
40
42
|
## ShakaCode Upgrade Support
|
41
43
|
|
@@ -93,30 +95,34 @@ We did this for Popmenu, [lowering Heroku costs 20-25% while getting a 73% decre
|
|
93
95
|
|
94
96
|
If you're interested, read more about [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro/) and [book a call](https://meetings.hubspot.com/justingordon/30-minute-consultation).
|
95
97
|
|
96
|
-
#
|
98
|
+
# 📚 Quick Start
|
99
|
+
|
100
|
+
**New to React on Rails?** Get up and running in minutes:
|
97
101
|
|
98
|
-
|
102
|
+
🚀 **[15-Minute Quick Start](https://www.shakacode.com/react-on-rails/docs/quick-start/)** - Your first React component
|
103
|
+
📖 **[Complete Documentation](https://www.shakacode.com/react-on-rails/docs/)** - Comprehensive guides and API reference
|
104
|
+
🎮 **[Live Demo](https://reactrails.com)** - See it in action with [source code](https://github.com/shakacode/react-webpack-rails-tutorial)
|
99
105
|
|
100
106
|
## Project Objective
|
101
107
|
|
102
108
|
To provide a high-performance framework for integrating Ruby on Rails with React, especially regarding React Server-Side Rendering for better SEO and improved performance.
|
103
109
|
|
104
|
-
##
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
110
|
+
## ✨ Why React on Rails?
|
111
|
+
|
112
|
+
| Feature | Benefit |
|
113
|
+
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
114
|
+
| 🎯 **Smart Bundle Loading** | [Automated bundle optimization](./docs/guides/auto-bundling-file-system-based-automated-bundle-generation.md) based on components used - no more manual `javascript_pack_tags` configuration |
|
115
|
+
| ⚡ **Server-Side Rendering** | Enhanced React Server Components support for better SEO and UX performance |
|
116
|
+
| 🚀 **Advanced Loading** | `sync`, `async`, and `defer` options for optimal performance based on your needs |
|
117
|
+
| 🔥 **Hot Module Replacement** | Instant feedback during development with tight [Shakapacker](https://github.com/shakacode/shakapacker) integration |
|
118
|
+
| 📦 **Easy Props Passing** | Direct Rails → React data flow without separate API calls |
|
119
|
+
| 🗺️ **Router Integration** | [React Router](https://reactrouter.com/) with SSR support |
|
120
|
+
| 🏪 **State Management** | [Redux](https://redux.js.org/) integration with server-side rendering |
|
121
|
+
| 🌍 **Internationalization** | [I18n and localization support](https://www.shakacode.com/react-on-rails/docs/guides/i18n) for global apps |
|
122
|
+
| 🎨 **Modern React** | React 18+ with enhanced React Server Components and latest patterns |
|
123
|
+
| 🦄 **ReScript Support** | [ReScript integration](https://github.com/shakacode/rescript-react-on-rails-example) for type-safe development |
|
124
|
+
|
125
|
+
> **Trusted by thousands** - See [real production sites](https://publicwww.com/websites/%22react-on-rails%22++-undeveloped.com+depth%3Aall/) using React on Rails
|
120
126
|
|
121
127
|
See [Rails/Shakapacker React Integration Options](https://www.shakacode.com/react-on-rails/docs/guides/rails-webpacker-react-integration-options) for comparisons to other gems.
|
122
128
|
|
@@ -83,7 +83,7 @@ namespace :react_on_rails do
|
|
83
83
|
puts Rainbow(" • Keep only the client/server specific files " \
|
84
84
|
"(Component.client.jsx, Component.server.jsx)").white
|
85
85
|
puts Rainbow(" • See: https://www.shakacode.com/react-on-rails/docs/guides/" \
|
86
|
-
"file-system-based-automated-bundle-generation.md").cyan
|
86
|
+
"auto-bundling-file-system-based-automated-bundle-generation.md").cyan
|
87
87
|
|
88
88
|
when /Cannot find component/
|
89
89
|
puts Rainbow(" • Check that your component file exists in the expected location").white
|
@@ -118,7 +118,7 @@ namespace :react_on_rails do
|
|
118
118
|
puts ""
|
119
119
|
puts Rainbow("📚 DOCUMENTATION:").magenta.bold
|
120
120
|
puts Rainbow(" • File-system based components: https://www.shakacode.com/react-on-rails/docs/" \
|
121
|
-
"guides/file-system-based-automated-bundle-generation.md").cyan
|
121
|
+
"guides/auto-bundling-file-system-based-automated-bundle-generation.md").cyan
|
122
122
|
puts Rainbow(" • Component registration: https://www.shakacode.com/react-on-rails/docs/").cyan
|
123
123
|
puts Rainbow("=" * 80).red
|
124
124
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
@@ -114,6 +114,7 @@ executables: []
|
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
|
+
- AI_AGENT_INSTRUCTIONS.md
|
117
118
|
- CHANGELOG.md
|
118
119
|
- CLAUDE.md
|
119
120
|
- CODING_AGENTS.md
|