react_on_rails 17.1.0 → 17.2.0.rc.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/Gemfile +1 -1
- data/Gemfile.development_dependencies +2 -2
- data/Gemfile.lock +65 -73
- data/Steepfile +1 -0
- data/docs/agent/install-and-upgrade.md +8 -3
- data/docs/agent/rsc-adoption.md +3 -0
- data/lib/generators/react_on_rails/base_generator.rb +2 -1
- data/lib/generators/react_on_rails/generated_webpack_config_pair.rb +84 -0
- data/lib/generators/react_on_rails/generator_helper.rb +2 -4
- data/lib/generators/react_on_rails/generator_messages.rb +1 -1
- data/lib/generators/react_on_rails/install_generator.rb +2 -1
- data/lib/generators/react_on_rails/js_dependency_manager.rb +14 -14
- data/lib/generators/react_on_rails/pro/USAGE +14 -3
- data/lib/generators/react_on_rails/pro_generator.rb +1 -1
- data/lib/generators/react_on_rails/pro_setup.rb +41 -213
- data/lib/generators/react_on_rails/rsc_setup.rb +7 -16
- data/lib/generators/react_on_rails/templates/pro/base/config/initializers/react_on_rails_pro.rb.tt +1 -1
- data/lib/react_on_rails/agent_guardrails.rb +217 -39
- data/lib/react_on_rails/dev/process_manager.rb +14 -0
- data/lib/react_on_rails/dev/server_manager.rb +1727 -103
- data/lib/react_on_rails/doctor.rb +875 -44
- data/lib/react_on_rails/helper.rb +3 -3
- data/lib/react_on_rails/react_component/render_options.rb +5 -7
- data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +27 -116
- data/lib/react_on_rails/utils.rb +65 -0
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/version_checker/lockfile_resolution.rb +170 -0
- data/lib/react_on_rails/version_checker.rb +43 -22
- data/rakelib/run_rspec.rake +6 -1
- data/sig/react_on_rails/configuration.rbs +28 -26
- data/sig/react_on_rails/controller.rbs +2 -1
- data/sig/react_on_rails/dev/process_manager.rbs +1 -0
- data/sig/react_on_rails/dev/server_manager.rbs +150 -10
- data/sig/react_on_rails/git_utils.rbs +5 -1
- data/sig/react_on_rails/locales.rbs +4 -4
- data/sig/react_on_rails/prerender_error.rbs +2 -2
- data/sig/react_on_rails/test_helper.rbs +15 -1
- data/sig/react_on_rails/utils.rbs +2 -2
- data/sig/react_on_rails/version_checker/lockfile_resolution.rbs +31 -0
- data/sig/react_on_rails/version_checker.rbs +30 -7
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c84e036c05a85bb64d0cdd85522f712816cdd5e7b1042f7635920fa0db020b30
|
|
4
|
+
data.tar.gz: 0a45d5bf692c9260f9a1c7e1c7c0d19908aef14b874e8a61056d78ad454d4916
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '04318a00cc5eba9189a576110532ce85a9221331715c0bd71c10274bc40a02954d6679ed18aacda545b49a12238476d81016052196503a382c75f5c99f7118c9'
|
|
7
|
+
data.tar.gz: 1b666939069f951819cf62d035db80d3f3382ee797269a26cc19d445512d45927965f7383509f541e219e3fb4dd1590adec455e1ef453ea1232b425099731b5e
|
data/Gemfile
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
eval_gemfile
|
|
3
|
+
Dir.chdir(__dir__) { eval_gemfile "../Gemfile.shared_dev_dependencies" }
|
|
4
4
|
|
|
5
5
|
gem "shakapacker", "10.3.2"
|
|
6
6
|
gem "bootsnap", require: false
|
|
7
|
-
gem "rails", "
|
|
7
|
+
gem "rails", ">= 7.2.3.2", "< 7.3"
|
|
8
8
|
|
|
9
9
|
gem "sqlite3", "~> 2.0"
|
|
10
10
|
gem "sass-rails", "~> 6.0"
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
react_on_rails (17.
|
|
4
|
+
react_on_rails (17.2.0.rc.0)
|
|
5
5
|
addressable
|
|
6
6
|
connection_pool
|
|
7
7
|
execjs (~> 2.5)
|
|
@@ -12,85 +12,79 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
actioncable (7.
|
|
16
|
-
actionpack (= 7.
|
|
17
|
-
activesupport (= 7.
|
|
15
|
+
actioncable (7.2.3.2)
|
|
16
|
+
actionpack (= 7.2.3.2)
|
|
17
|
+
activesupport (= 7.2.3.2)
|
|
18
18
|
nio4r (~> 2.0)
|
|
19
19
|
websocket-driver (>= 0.6.1)
|
|
20
20
|
zeitwerk (~> 2.6)
|
|
21
|
-
actionmailbox (7.
|
|
22
|
-
actionpack (= 7.
|
|
23
|
-
activejob (= 7.
|
|
24
|
-
activerecord (= 7.
|
|
25
|
-
activestorage (= 7.
|
|
26
|
-
activesupport (= 7.
|
|
27
|
-
mail (>= 2.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
activejob (= 7.1.6)
|
|
35
|
-
activesupport (= 7.1.6)
|
|
36
|
-
mail (~> 2.5, >= 2.5.4)
|
|
37
|
-
net-imap
|
|
38
|
-
net-pop
|
|
39
|
-
net-smtp
|
|
21
|
+
actionmailbox (7.2.3.2)
|
|
22
|
+
actionpack (= 7.2.3.2)
|
|
23
|
+
activejob (= 7.2.3.2)
|
|
24
|
+
activerecord (= 7.2.3.2)
|
|
25
|
+
activestorage (= 7.2.3.2)
|
|
26
|
+
activesupport (= 7.2.3.2)
|
|
27
|
+
mail (>= 2.8.0)
|
|
28
|
+
actionmailer (7.2.3.2)
|
|
29
|
+
actionpack (= 7.2.3.2)
|
|
30
|
+
actionview (= 7.2.3.2)
|
|
31
|
+
activejob (= 7.2.3.2)
|
|
32
|
+
activesupport (= 7.2.3.2)
|
|
33
|
+
mail (>= 2.8.0)
|
|
40
34
|
rails-dom-testing (~> 2.2)
|
|
41
|
-
actionpack (7.
|
|
42
|
-
actionview (= 7.
|
|
43
|
-
activesupport (= 7.
|
|
35
|
+
actionpack (7.2.3.2)
|
|
36
|
+
actionview (= 7.2.3.2)
|
|
37
|
+
activesupport (= 7.2.3.2)
|
|
44
38
|
cgi
|
|
45
39
|
nokogiri (>= 1.8.5)
|
|
46
40
|
racc
|
|
47
|
-
rack (>= 2.2.4)
|
|
41
|
+
rack (>= 2.2.4, < 3.3)
|
|
48
42
|
rack-session (>= 1.0.1)
|
|
49
43
|
rack-test (>= 0.6.3)
|
|
50
44
|
rails-dom-testing (~> 2.2)
|
|
51
45
|
rails-html-sanitizer (~> 1.6)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
useragent (~> 0.16)
|
|
47
|
+
actiontext (7.2.3.2)
|
|
48
|
+
actionpack (= 7.2.3.2)
|
|
49
|
+
activerecord (= 7.2.3.2)
|
|
50
|
+
activestorage (= 7.2.3.2)
|
|
51
|
+
activesupport (= 7.2.3.2)
|
|
57
52
|
globalid (>= 0.6.0)
|
|
58
53
|
nokogiri (>= 1.8.5)
|
|
59
|
-
actionview (7.
|
|
60
|
-
activesupport (= 7.
|
|
54
|
+
actionview (7.2.3.2)
|
|
55
|
+
activesupport (= 7.2.3.2)
|
|
61
56
|
builder (~> 3.1)
|
|
62
57
|
cgi
|
|
63
58
|
erubi (~> 1.11)
|
|
64
59
|
rails-dom-testing (~> 2.2)
|
|
65
60
|
rails-html-sanitizer (~> 1.6)
|
|
66
|
-
activejob (7.
|
|
67
|
-
activesupport (= 7.
|
|
61
|
+
activejob (7.2.3.2)
|
|
62
|
+
activesupport (= 7.2.3.2)
|
|
68
63
|
globalid (>= 0.3.6)
|
|
69
|
-
activemodel (7.
|
|
70
|
-
activesupport (= 7.
|
|
71
|
-
activerecord (7.
|
|
72
|
-
activemodel (= 7.
|
|
73
|
-
activesupport (= 7.
|
|
64
|
+
activemodel (7.2.3.2)
|
|
65
|
+
activesupport (= 7.2.3.2)
|
|
66
|
+
activerecord (7.2.3.2)
|
|
67
|
+
activemodel (= 7.2.3.2)
|
|
68
|
+
activesupport (= 7.2.3.2)
|
|
74
69
|
timeout (>= 0.4.0)
|
|
75
|
-
activestorage (7.
|
|
76
|
-
actionpack (= 7.
|
|
77
|
-
activejob (= 7.
|
|
78
|
-
activerecord (= 7.
|
|
79
|
-
activesupport (= 7.
|
|
70
|
+
activestorage (7.2.3.2)
|
|
71
|
+
actionpack (= 7.2.3.2)
|
|
72
|
+
activejob (= 7.2.3.2)
|
|
73
|
+
activerecord (= 7.2.3.2)
|
|
74
|
+
activesupport (= 7.2.3.2)
|
|
80
75
|
marcel (~> 1.0)
|
|
81
|
-
activesupport (7.
|
|
76
|
+
activesupport (7.2.3.2)
|
|
82
77
|
base64
|
|
83
78
|
benchmark (>= 0.3)
|
|
84
79
|
bigdecimal
|
|
85
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
80
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
86
81
|
connection_pool (>= 2.2.5)
|
|
87
82
|
drb
|
|
88
83
|
i18n (>= 1.6, < 2)
|
|
89
84
|
logger (>= 1.4.2)
|
|
90
|
-
minitest (>= 5.1)
|
|
91
|
-
mutex_m
|
|
85
|
+
minitest (>= 5.1, < 6)
|
|
92
86
|
securerandom (>= 0.3)
|
|
93
|
-
tzinfo (~> 2.0)
|
|
87
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
94
88
|
addressable (2.8.7)
|
|
95
89
|
public_suffix (>= 2.0.2, < 7.0)
|
|
96
90
|
amazing_print (1.6.0)
|
|
@@ -183,11 +177,8 @@ GEM
|
|
|
183
177
|
method_source (1.1.0)
|
|
184
178
|
mini_mime (1.1.5)
|
|
185
179
|
mini_portile2 (2.8.9)
|
|
186
|
-
minitest (
|
|
187
|
-
drb (~> 2.0)
|
|
188
|
-
prism (~> 1.5)
|
|
180
|
+
minitest (5.27.0)
|
|
189
181
|
msgpack (1.7.2)
|
|
190
|
-
mutex_m (0.3.0)
|
|
191
182
|
net-imap (0.6.2)
|
|
192
183
|
date
|
|
193
184
|
net-protocol
|
|
@@ -245,20 +236,20 @@ GEM
|
|
|
245
236
|
rack (>= 1.3)
|
|
246
237
|
rackup (2.3.1)
|
|
247
238
|
rack (>= 3)
|
|
248
|
-
rails (7.
|
|
249
|
-
actioncable (= 7.
|
|
250
|
-
actionmailbox (= 7.
|
|
251
|
-
actionmailer (= 7.
|
|
252
|
-
actionpack (= 7.
|
|
253
|
-
actiontext (= 7.
|
|
254
|
-
actionview (= 7.
|
|
255
|
-
activejob (= 7.
|
|
256
|
-
activemodel (= 7.
|
|
257
|
-
activerecord (= 7.
|
|
258
|
-
activestorage (= 7.
|
|
259
|
-
activesupport (= 7.
|
|
239
|
+
rails (7.2.3.2)
|
|
240
|
+
actioncable (= 7.2.3.2)
|
|
241
|
+
actionmailbox (= 7.2.3.2)
|
|
242
|
+
actionmailer (= 7.2.3.2)
|
|
243
|
+
actionpack (= 7.2.3.2)
|
|
244
|
+
actiontext (= 7.2.3.2)
|
|
245
|
+
actionview (= 7.2.3.2)
|
|
246
|
+
activejob (= 7.2.3.2)
|
|
247
|
+
activemodel (= 7.2.3.2)
|
|
248
|
+
activerecord (= 7.2.3.2)
|
|
249
|
+
activestorage (= 7.2.3.2)
|
|
250
|
+
activesupport (= 7.2.3.2)
|
|
260
251
|
bundler (>= 1.15.0)
|
|
261
|
-
railties (= 7.
|
|
252
|
+
railties (= 7.2.3.2)
|
|
262
253
|
rails-dom-testing (2.3.0)
|
|
263
254
|
activesupport (>= 5.0.0)
|
|
264
255
|
minitest
|
|
@@ -266,11 +257,11 @@ GEM
|
|
|
266
257
|
rails-html-sanitizer (1.7.1)
|
|
267
258
|
loofah (~> 2.25, >= 2.25.2)
|
|
268
259
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
269
|
-
railties (7.
|
|
270
|
-
actionpack (= 7.
|
|
271
|
-
activesupport (= 7.
|
|
260
|
+
railties (7.2.3.2)
|
|
261
|
+
actionpack (= 7.2.3.2)
|
|
262
|
+
activesupport (= 7.2.3.2)
|
|
272
263
|
cgi
|
|
273
|
-
irb
|
|
264
|
+
irb (~> 1.13)
|
|
274
265
|
rackup (>= 1.0.0)
|
|
275
266
|
rake (>= 12.2)
|
|
276
267
|
thor (~> 1.0, >= 1.2.2)
|
|
@@ -390,6 +381,7 @@ GEM
|
|
|
390
381
|
execjs (>= 0.3.0, < 3)
|
|
391
382
|
unicode-display_width (2.5.0)
|
|
392
383
|
uri (1.1.1)
|
|
384
|
+
useragent (0.16.11)
|
|
393
385
|
webdrivers (5.3.0)
|
|
394
386
|
nokogiri (~> 1.6)
|
|
395
387
|
rubyzip (>= 1.3.0)
|
|
@@ -434,7 +426,7 @@ DEPENDENCIES
|
|
|
434
426
|
pry-rails
|
|
435
427
|
pry-rescue
|
|
436
428
|
puma (~> 6.0)
|
|
437
|
-
rails (
|
|
429
|
+
rails (>= 7.2.3.2, < 7.3)
|
|
438
430
|
rbs
|
|
439
431
|
react_on_rails!
|
|
440
432
|
rspec-rails
|
data/Steepfile
CHANGED
|
@@ -43,6 +43,7 @@ target :lib do
|
|
|
43
43
|
check "lib/react_on_rails/typescript_response_types/generated_file_writer.rb"
|
|
44
44
|
check "lib/react_on_rails/utils.rb"
|
|
45
45
|
check "lib/react_on_rails/version_checker.rb"
|
|
46
|
+
check "lib/react_on_rails/version_checker/lockfile_resolution.rb"
|
|
46
47
|
|
|
47
48
|
# Specify RBS signature directories
|
|
48
49
|
signature "sig"
|
|
@@ -25,9 +25,11 @@ SHAKAPACKER_VERSION="$(bundle exec ruby -rreact_on_rails -e 'print ReactOnRails:
|
|
|
25
25
|
bundle add shakapacker --version="${SHAKAPACKER_VERSION}" --strict
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
For `--pro` or `--rsc`, React on Rails Pro is free
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
For `--pro` or `--rsc`, React on Rails Pro is free in development, test, CI, and staging,
|
|
29
|
+
and in production for small organizations, charities, schools, and hospitals;
|
|
30
|
+
larger organizations subscribe ($1,800 per year per organization).
|
|
31
|
+
No license key is needed to run Pro. Review [pricing](https://reactonrails.com/pricing/)
|
|
32
|
+
and [Pro setup](https://reactonrails.com/docs/pro/upgrading-to-pro/) before proceeding.
|
|
31
33
|
|
|
32
34
|
Skip this Pro-gem preparation for `--standard-only`.
|
|
33
35
|
For `--pro` or `--rsc` only, derive the exact installed base-gem version before adding the Pro gem:
|
|
@@ -89,6 +91,9 @@ Review the generated initializer, Shakapacker configuration, scripts, routes, an
|
|
|
89
91
|
`https://github.com/shakacode/react_on_rails/tree/v<GEM_TARGET_VERSION>`. Compare the complete
|
|
90
92
|
`CURRENT_VERSION..GEM_TARGET_VERSION` release range before changing dependencies:
|
|
91
93
|
`https://github.com/shakacode/react_on_rails/compare/v<CURRENT_VERSION>...v<GEM_TARGET_VERSION>`.
|
|
94
|
+
For Pro apps, treat `ReactOnRailsProHelper` methods as internal rather than stable extension points. If the app
|
|
95
|
+
prepends or overrides a Pro helper, compare its method signature between the exact tags and update the override
|
|
96
|
+
before running streamed SSR or RSC tests.
|
|
92
97
|
|
|
93
98
|
## JavaScript target matrix
|
|
94
99
|
|
data/docs/agent/rsc-adoption.md
CHANGED
|
@@ -25,6 +25,9 @@ bundle exec rake react_on_rails:install_rsc_agent_guardrails
|
|
|
25
25
|
bin/rails react_on_rails:doctor FORMAT=json
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
The generated advisory hook requires Claude Code 2.1.139 or newer. That release added the exec-form
|
|
29
|
+
`args` field that keeps project paths with spaces or special characters intact.
|
|
30
|
+
|
|
28
31
|
Before completion, protect any RSC payload route, keep the Node renderer private, avoid sensitive
|
|
29
32
|
logged props or URLs, build all three bundles, and exercise navigation and hydration in a browser.
|
|
30
33
|
|
|
@@ -904,7 +904,8 @@ module ReactOnRails
|
|
|
904
904
|
end
|
|
905
905
|
|
|
906
906
|
def home_page_pro_note_for_oss_app
|
|
907
|
-
"Review the Pro docs and upgrade guide first, then enable it
|
|
907
|
+
"Review the Pro docs and upgrade guide first, then enable it when you're ready; " \
|
|
908
|
+
"a license key is optional and only marks your pages Licensed."
|
|
908
909
|
end
|
|
909
910
|
|
|
910
911
|
def preferred_rspec_helper_file
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "erb"
|
|
4
|
+
|
|
5
|
+
module ReactOnRails
|
|
6
|
+
module Generators
|
|
7
|
+
# Recognizes whole current generated pairs without interpreting application JavaScript.
|
|
8
|
+
# Every interpolation comes from these fixed variants, never from the input files.
|
|
9
|
+
class GeneratedWebpackConfigPair
|
|
10
|
+
TEMPLATE_ROOT = File.expand_path("templates/base/base/config/webpack", __dir__)
|
|
11
|
+
FILENAMES = %w[serverWebpackConfig.js ServerClientOrBoth.js].freeze
|
|
12
|
+
DOCUMENTATION_MESSAGE = "// The source code including full typescript support is available at:"
|
|
13
|
+
# pro, rsc, rspack: the latter affects source text only when RSC is enabled.
|
|
14
|
+
MODES = [[false, false, false], [true, false, false], [true, true, false], [true, true, true]].freeze
|
|
15
|
+
|
|
16
|
+
def self.pro_upgrade(contents)
|
|
17
|
+
shakapacker_versions = [false, true]
|
|
18
|
+
MODES.each do |pro, rsc, rspack|
|
|
19
|
+
shakapacker_versions.each do |shakapacker9|
|
|
20
|
+
pair = new(pro:, rsc:, rspack:, shakapacker9:)
|
|
21
|
+
next unless pair.contents == contents
|
|
22
|
+
|
|
23
|
+
return contents if pro
|
|
24
|
+
|
|
25
|
+
return new(pro: true, rsc:, rspack:, shakapacker9:).contents
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
nil
|
|
29
|
+
rescue StandardError, SyntaxError
|
|
30
|
+
# Missing templates or a newly introduced ERB dependency make recognition unknown.
|
|
31
|
+
# No input file has been touched; the caller supplies manual migration instructions.
|
|
32
|
+
nil
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(pro:, rsc:, rspack:, shakapacker9:)
|
|
36
|
+
@pro = pro
|
|
37
|
+
@rsc = rsc
|
|
38
|
+
@rspack = rspack
|
|
39
|
+
@shakapacker9 = shakapacker9
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def contents
|
|
43
|
+
FILENAMES.map do |filename|
|
|
44
|
+
template = File.read(File.join(TEMPLATE_ROOT, "#{filename}.tt"))
|
|
45
|
+
ERB.new(template, trim_mode: "-").result(template_binding).b
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
def template_binding
|
|
52
|
+
binding
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def config
|
|
56
|
+
{ message: DOCUMENTATION_MESSAGE }
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def add_documentation_reference(message, source)
|
|
60
|
+
"#{message}\n#{source}"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def use_pro?
|
|
64
|
+
@pro
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def use_rsc?
|
|
68
|
+
@rsc
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def shakapacker_version_9_or_higher?
|
|
72
|
+
@shakapacker9
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def rsc_plugin_class_name
|
|
76
|
+
@rspack ? "RSCRspackPlugin" : "RSCWebpackPlugin"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def rsc_plugin_import_path
|
|
80
|
+
@rspack ? "react-on-rails-rsc/RspackPlugin" : "react-on-rails-rsc/WebpackPlugin"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -486,10 +486,8 @@ module GeneratorHelper
|
|
|
486
486
|
match = react_version.match(/(\d+)\.(\d+)\.(\d+)(?:[-.]([0-9A-Za-z.-]+))?/)
|
|
487
487
|
return nil unless match
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
# Preserve prerelease identifiers so callers can distinguish stable releases.
|
|
492
|
-
match[0]
|
|
489
|
+
# Return the matched version (without pre-release suffix for comparison)
|
|
490
|
+
"#{match[1]}.#{match[2]}.#{match[3]}"
|
|
493
491
|
rescue StandardError
|
|
494
492
|
nil
|
|
495
493
|
end
|
|
@@ -7,7 +7,7 @@ require_relative "generator_messages/ci_section"
|
|
|
7
7
|
require_relative "generator_messages/shakapacker_status_section"
|
|
8
8
|
|
|
9
9
|
module GeneratorMessages
|
|
10
|
-
PRO_UPGRADE_HINT = "\n\n 💎 For RSC, streaming SSR, and
|
|
10
|
+
PRO_UPGRADE_HINT = "\n\n 💎 For RSC, streaming SSR, and a dedicated Node renderer, try React on Rails Pro:" \
|
|
11
11
|
"\n #{Rainbow('https://reactonrails.com/docs/pro/upgrading-to-pro/').cyan.underline}".freeze
|
|
12
12
|
# Package manager constants and detection helpers live in PackageManagerDetection,
|
|
13
13
|
# re-exported here for backwards compatibility (external callers use ::SUPPORTED_PACKAGE_MANAGERS).
|
|
@@ -247,7 +247,8 @@ module ReactOnRails
|
|
|
247
247
|
validate_product_stack_choice!
|
|
248
248
|
return if options.new_app? || explicit_product_stack_choice? || !interactive_install_session?
|
|
249
249
|
|
|
250
|
-
say "
|
|
250
|
+
say "No license key is needed to run Pro. Production is free for small organizations, charities, schools, " \
|
|
251
|
+
"and hospitals; larger organizations subscribe: https://reactonrails.com/pricing/"
|
|
251
252
|
say "Learn more: https://reactonrails.com/docs/pro/upgrading-to-pro/"
|
|
252
253
|
answer = ask(
|
|
253
254
|
"Enable React on Rails Pro features (Node Renderer and streaming SSR; RSC available separately)? [Y/n]",
|
|
@@ -138,30 +138,30 @@ module ReactOnRails
|
|
|
138
138
|
].freeze
|
|
139
139
|
|
|
140
140
|
# React on Rails Pro dependencies (only installed when --pro or --rsc flag is used)
|
|
141
|
-
#
|
|
141
|
+
# Public npm packages with free production use for eligible organizations; see https://reactonrails.com/pricing/
|
|
142
142
|
PRO_DEPENDENCIES = %w[
|
|
143
143
|
react-on-rails-pro
|
|
144
144
|
react-on-rails-pro-node-renderer
|
|
145
145
|
].freeze
|
|
146
146
|
|
|
147
147
|
# React Server Components dependencies (only installed when --rsc flag is used)
|
|
148
|
-
# Requires React 19.2.x with patch >= 19.2.
|
|
148
|
+
# Requires React 19.2.x with patch >= 19.2.7 - see https://react.dev/reference/rsc/server-components
|
|
149
149
|
RSC_DEPENDENCIES = %w[
|
|
150
150
|
react-on-rails-rsc
|
|
151
151
|
].freeze
|
|
152
152
|
|
|
153
153
|
# React peer-dependency range for generated RSC apps. This governs the `react` / `react-dom`
|
|
154
154
|
# installs (see add_react_dependencies) and intentionally stays on the React 19.2.x line
|
|
155
|
-
# with a 19.2.
|
|
155
|
+
# with a 19.2.7 minimum. Do not widen this to later minors just because those releases are
|
|
156
156
|
# current on npm; React's RSC runtime and bundler integration can change between minors.
|
|
157
157
|
#
|
|
158
158
|
# This is intentionally distinct from RSC_PACKAGE_VERSION_PIN below, which pins
|
|
159
159
|
# `react-on-rails-rsc`. Coordination note for #3609: Pro package metadata and generated apps
|
|
160
|
-
# use the tested React 19.2.x range with the exact RSC package pin.
|
|
161
|
-
RSC_REACT_VERSION_RANGE = "~19.2.
|
|
162
|
-
#
|
|
163
|
-
#
|
|
164
|
-
RSC_PACKAGE_VERSION_PIN = "19.
|
|
160
|
+
# use the tested React 19.2.x range with the exact stable RSC package pin.
|
|
161
|
+
RSC_REACT_VERSION_RANGE = "~19.2.7"
|
|
162
|
+
# Pinned to the stable 19.2.1 package, which carries the coordinated React 19.2.7 RSC peer floor
|
|
163
|
+
# required by the React on Rails Pro 17 runtime check.
|
|
164
|
+
RSC_PACKAGE_VERSION_PIN = "19.2.1"
|
|
165
165
|
|
|
166
166
|
private
|
|
167
167
|
|
|
@@ -255,7 +255,7 @@ module ReactOnRails
|
|
|
255
255
|
say "Installing React dependencies..."
|
|
256
256
|
|
|
257
257
|
# RSC requires the coordinated React 19.2.x patch line.
|
|
258
|
-
# Pin React to ~19.2.
|
|
258
|
+
# Pin React to ~19.2.7 while using the matching stable RSC package.
|
|
259
259
|
react_deps = if respond_to?(:use_rsc?) && use_rsc?
|
|
260
260
|
["react@#{RSC_REACT_VERSION_RANGE}", "react-dom@#{RSC_REACT_VERSION_RANGE}",
|
|
261
261
|
"prop-types@^15.0.0"]
|
|
@@ -451,8 +451,8 @@ module ReactOnRails
|
|
|
451
451
|
if rsc_package_version_prerelease?
|
|
452
452
|
"React Server Components package pin: all --rsc installs temporarily use " \
|
|
453
453
|
"react-on-rails-rsc@#{RSC_PACKAGE_VERSION_PIN}, including Webpack projects. " \
|
|
454
|
-
"This prerelease
|
|
455
|
-
"react-on-rails-rsc/RspackPlugin
|
|
454
|
+
"This prerelease keeps react-on-rails-rsc/WebpackPlugin compatible while adding " \
|
|
455
|
+
"react-on-rails-rsc/RspackPlugin. Keep the pin until stable " \
|
|
456
456
|
"react-on-rails-rsc@#{rsc_stable_package_version_target} " \
|
|
457
457
|
"is published and tagged latest."
|
|
458
458
|
else
|
|
@@ -466,9 +466,9 @@ module ReactOnRails
|
|
|
466
466
|
def rsc_dependency_pin_failed_warning
|
|
467
467
|
if rsc_package_version_prerelease?
|
|
468
468
|
"Warning: Could not install the pinned react-on-rails-rsc@#{RSC_PACKAGE_VERSION_PIN}. " \
|
|
469
|
-
"All RSC projects are temporarily pinned to that version
|
|
470
|
-
"
|
|
471
|
-
"
|
|
469
|
+
"All RSC projects are temporarily pinned to that version: the prerelease keeps " \
|
|
470
|
+
"react-on-rails-rsc/WebpackPlugin compatible while adding react-on-rails-rsc/RspackPlugin, " \
|
|
471
|
+
"and the unversioned `latest` tag may not include both until stable " \
|
|
472
472
|
"#{rsc_stable_package_version_target} " \
|
|
473
473
|
"is published, so the generator left the version pin in package.json rather than " \
|
|
474
474
|
"install a potentially incompatible version."
|
|
@@ -10,12 +10,23 @@ Example:
|
|
|
10
10
|
- Node renderer process to Procfile.dev
|
|
11
11
|
|
|
12
12
|
Modifies:
|
|
13
|
-
- config/webpack/serverWebpackConfig.js (enables Pro settings: libraryTarget,
|
|
14
|
-
target, extractLoader, Babel SSR caller, object exports)
|
|
15
|
-
- config/webpack/ServerClientOrBoth.js (switches to destructured import)
|
|
16
13
|
- package.json (replaces react-on-rails with react-on-rails-pro and
|
|
17
14
|
react-on-rails-pro-node-renderer)
|
|
18
15
|
|
|
16
|
+
Bundler configuration:
|
|
17
|
+
Upgrades serverWebpackConfig.js and ServerClientOrBoth.js in the active
|
|
18
|
+
config/webpack/ or config/rspack/ directory only when both files exactly
|
|
19
|
+
match a supported current generated pair. Enables Pro server settings,
|
|
20
|
+
extractLoader, Babel SSR caller handling, and matching exports/imports.
|
|
21
|
+
A supported pair using the legacy companion filename generateWebpackConfigs.js
|
|
22
|
+
keeps that filename; it is not renamed.
|
|
23
|
+
|
|
24
|
+
Customized, unknown, unsupported historical, incomplete, or ambiguous pairs
|
|
25
|
+
are left unchanged, including their paths. If the pair is skipped, complete
|
|
26
|
+
the manual migration before building and verifying SSR; rerunning the
|
|
27
|
+
generator does not migrate these files:
|
|
28
|
+
https://reactonrails.com/docs/pro/upgrading-to-pro/#complete-a-skipped-webpackrspack-migration-manually
|
|
29
|
+
|
|
19
30
|
Prerequisites:
|
|
20
31
|
- React on Rails must be installed (rails g react_on_rails:install)
|
|
21
32
|
- react_on_rails_pro gem must be in your Gemfile
|
|
@@ -951,7 +951,7 @@ module ReactOnRails
|
|
|
951
951
|
|
|
952
952
|
GeneratorMessages.add_info(<<~MSG)
|
|
953
953
|
Next steps:
|
|
954
|
-
1.
|
|
954
|
+
1. Optional: set the license key from your subscription: export REACT_ON_RAILS_PRO_LICENSE=your_key
|
|
955
955
|
2. Start the app: bin/dev (or foreman start -f Procfile.dev)
|
|
956
956
|
3. Visit http://localhost:3000/#{route}
|
|
957
957
|
4. The Node Renderer will start on port 3800
|