You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Important:** The shakapacker gem and npm package versions MUST match exactly.
28
-
29
-
### Step 2: Install Updates
30
-
31
-
```bash
32
-
bundle update react_on_rails shakapacker
33
-
yarn install # or npm install
34
-
```
35
-
36
-
### Step 3: Run the Generator (Optional)
23
+
Then run `bundle install` and your package manager's install command.
37
24
38
-
Run the generator to get the latest improvements:
25
+
**Important:** The shakapacker gem and npm package versions must match exactly.
39
26
40
-
```bash
41
-
rails generate react_on_rails:install
42
-
```
43
-
44
-
**Note:** The generator will prompt to overwrite files. Review each change carefully, especially if you have customizations. Key files that may be updated:
45
-
46
-
-`bin/dev` - Enhanced development workflow
47
-
- Webpack configurations
48
-
-`shakapacker.yml` settings
49
-
- TypeScript configuration
27
+
## New Features in v16.1.0
50
28
51
-
### Step 4: Use the New Doctor Command
29
+
### Doctor Rake Task
52
30
53
-
v16.1.0 introduces a diagnostic rake task to validate your setup:
31
+
New diagnostic command for troubleshooting setup issues:
54
32
55
33
```bash
56
34
rake react_on_rails:doctor
35
+
VERBOSE=true rake react_on_rails:doctor # For detailed output
57
36
```
58
37
59
-
For detailed output:
60
-
61
-
```bash
62
-
VERBOSE=true rake react_on_rails:doctor
63
-
```
64
-
65
-
The doctor command checks:
66
-
67
-
- Environment prerequisites
68
-
- Dependencies and version compatibility
69
-
- Rails integration
70
-
- Webpack configuration
71
-
- Shakapacker setup
72
-
73
-
### Step 5: Test Your Application
74
-
75
-
```bash
76
-
# Test asset compilation
77
-
bundle exec rails assets:precompile
78
-
79
-
# Test development server
80
-
bin/dev
81
-
82
-
# Run your test suite
83
-
bundle exec rspec # or your test command
84
-
```
85
-
86
-
## New Features in v16.1.0
87
-
88
38
### Server Bundle Security
89
39
90
40
New configuration options for enhanced server bundle security:
@@ -93,153 +43,38 @@ New configuration options for enhanced server bundle security:
93
43
# config/initializers/react_on_rails.rb
94
44
ReactOnRails.configure do |config|
95
45
# Directory for server bundle output (default: "ssr-generated")
96
-
# Set to nil to load from public directory (legacy behavior)
97
46
config.server_bundle_output_path ="ssr-generated"
98
47
99
48
# When enabled, server bundles only load from private directories
100
-
# (default: false for backward compatibility)
101
49
config.enforce_private_server_bundles =true
102
50
end
103
51
```
104
52
105
-
**Bundle Path Resolution Logic:**
106
-
107
-
1. If `server_bundle_output_path` is set, server bundles load from that directory
108
-
2. If not set, falls back to client bundle directory (public output path)
109
-
3. When `enforce_private_server_bundles` is enabled:
110
-
- Server bundles only load from the private directory
111
-
- No fallback to public directory (improved security)
112
-
113
-
### Doctor Rake Task
114
-
115
-
New diagnostic command for troubleshooting:
116
-
117
-
```bash
118
-
rake react_on_rails:doctor
119
-
```
120
-
121
-
Provides comprehensive checks for:
122
-
123
-
- Environment prerequisites
124
-
- Dependency versions
125
-
- Rails integration
126
-
- Webpack configuration
127
-
- Common setup issues
128
-
129
53
### Generator Improvements
130
54
131
-
-**Modern TypeScript patterns**: Better type inference instead of explicit annotations
132
-
-**Optimized tsconfig.json**: Uses `"moduleResolution": "bundler"` for bundler compatibility
133
-
-**Enhanced Redux TypeScript**: Improved type safety with modern React patterns (useMemo, type-only imports)
134
-
-**Smart bin/dev defaults**: Auto-navigates to `/hello_world` route for immediate component visibility
135
-
-**Cleaner generated code**: Follows modern React and TypeScript best practices
136
-
137
-
## Deprecations
138
-
139
-
### `generated_assets_dirs` Configuration
140
-
141
-
The `config.generated_assets_dirs` option is deprecated. Remove it from `config/initializers/react_on_rails.rb`.
142
-
143
-
**Why:** Since Shakapacker is now required, asset paths are automatically determined from `shakapacker.yml`.
144
-
145
-
**Migration:** Use `public_output_path` in `config/shakapacker.yml` to customize asset output location.
146
-
147
-
### `generated_assets_full_path` Method
148
-
149
-
Use `public_bundles_full_path` instead for clarity about webpack bundles in public directories.
150
-
151
-
## Bug Fixes in v16.1.1
55
+
- Modern TypeScript patterns with better type inference
56
+
- Optimized tsconfig.json with `"moduleResolution": "bundler"`
57
+
- Enhanced Redux TypeScript integration
58
+
- Smart `bin/dev` defaults
152
59
153
-
-**React Server Components**: Fixed bug in resolving `react-server-client-manifest.json` file path. The manifest file path is now correctly resolved using `bundle_js_file_path` for improved configuration flexibility. [PR 1818](https://github.com/shakacode/react_on_rails/pull/1818)
60
+
## Bug Fixes
154
61
155
-
##Bug Fixes in v16.1.0
62
+
### v16.1.1
156
63
157
-
-**Doctor rake task**: Fixed LoadError when using packaged gem
158
-
-**Packs generator**: Fixed error when `server_bundle_js_file` is empty
159
-
-**Non-Packer compatibility**: Fixed NoMethodError in environments without Shakapacker
160
-
-**Shakapacker version requirements**: Fixed inconsistent version requirements between basic pack generation (6.5.1+) and advanced auto-bundling (7.0.0+)
For detailed upgrade instructions, see the [v16.1.x Release Notes](release-notes/16.1.0.md).
26
+
This is a minor release - update your gem and npm package versions, then run `bundle install` and your package manager's install command. See the [v16.1.x Release Notes](release-notes/16.1.0.md) for new features and bug fixes.
27
27
28
-
### Quick Summary
29
-
30
-
v16.1.x is a minor release with new features and bug fixes:
31
-
32
-
-**New `rake react_on_rails:doctor` command** for diagnosing setup issues
33
-
-**Server bundle security enhancements** with `server_bundle_output_path` and `enforce_private_server_bundles` options
34
-
-**Generator improvements** with modern TypeScript patterns and better defaults
0 commit comments