react_on_rails 17.1.0.rc.2 → 17.1.0.rc.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 755a6c4b2ac4efd6c1591b88a4bce952b792911ee2a59fb0e9a4e199d3b96330
4
- data.tar.gz: 3db2f83572bb6c064b2af1b3b82475f8987ae883d288b5a683a8e776561a6020
3
+ metadata.gz: 0e7d9c8f6a68c9aeb59fa6094c0a1a26ad619abe7a5a636c83bb5838f4cde0b8
4
+ data.tar.gz: bee1a6f8dd68cf9f40241125380aecc869cccd3cc79126343b2a0b8642f0d0f1
5
5
  SHA512:
6
- metadata.gz: 86943c8e0e56d4aac18559eeffc022148faa3d6e42da438e888af5395f9f91a89229414a829400790d5460c7ef32c9f29b2090b321c3a7bd8f919fbcb0279e65
7
- data.tar.gz: fd7e49db1ff4ddbdad5619545deba2485c20fe37dc2b26b401ab82d164fbf6c82a1272d87a4bf74d70b1426ff592231021c7f7ec779e4018b7d86940b7fb7cb6
6
+ metadata.gz: 61992afb879fc1677b1310110b65e542fd7685e10c5242a9328fd791bb1acea99e219c5e75ead0badfe910defb1969863d8db59862e21c7856c7d08f86b5597f
7
+ data.tar.gz: 8a84822dc47c9ed9168f0db02e5d208df6b97cec9a8478598edcc4211e1fb0776f5dcd7c0b8140328e44c2c6c72c3ff4a3aef6211acb5ec9f8da865376a2b633
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- react_on_rails (17.1.0.rc.2)
4
+ react_on_rails (17.1.0.rc.3)
5
5
  addressable
6
6
  connection_pool
7
7
  execjs (~> 2.5)
@@ -486,8 +486,10 @@ module GeneratorHelper
486
486
  match = react_version.match(/(\d+)\.(\d+)\.(\d+)(?:[-.]([0-9A-Za-z.-]+))?/)
487
487
  return nil unless match
488
488
 
489
- # Return the matched version (without pre-release suffix for comparison)
490
- "#{match[1]}.#{match[2]}.#{match[3]}"
489
+ return nil unless Gem::Version.correct?(match[0])
490
+
491
+ # Preserve prerelease identifiers so callers can distinguish stable releases.
492
+ match[0]
491
493
  rescue StandardError
492
494
  nil
493
495
  end
@@ -145,23 +145,23 @@ module ReactOnRails
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.7 - see https://react.dev/reference/rsc/server-components
148
+ # Requires React 19.2.x with patch >= 19.2.8 - 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.7 minimum. Do not widen this to later minors just because those releases are
155
+ # with a 19.2.8 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 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"
160
+ # use the tested React 19.2.x range with the exact RSC package pin.
161
+ RSC_REACT_VERSION_RANGE = "~19.2.8"
162
+ # Qualify the JSX/TSX loader and Rspack chunk fixes during the 19.3.0 RC soak.
163
+ # Keep the React 19.2 runtime line independent from the RSC package minor.
164
+ RSC_PACKAGE_VERSION_PIN = "19.3.0-rc.3"
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.7 while using the matching stable RSC package.
258
+ # Pin React to ~19.2.8 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 keeps react-on-rails-rsc/WebpackPlugin compatible while adding " \
455
- "react-on-rails-rsc/RspackPlugin. Keep the pin until stable " \
454
+ "This prerelease includes the qualified client-export parsing fixes and " \
455
+ "react-on-rails-rsc/RspackPlugin splitChunks fix. 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: 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 " \
469
+ "All RSC projects are temporarily pinned to that version for its client-export parsing " \
470
+ "and react-on-rails-rsc/RspackPlugin splitChunks fixes. The unversioned `latest` tag " \
471
+ "does not include these fixes 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."
@@ -82,9 +82,17 @@ module ReactOnRails
82
82
  react_version = detect_react_version
83
83
  return if react_version.nil? # React not installed yet, will be installed by generator
84
84
 
85
- major, minor, patch = react_version.split(".").map(&:to_i)
85
+ version = Gem::Version.new(react_version)
86
+ major, minor, patch = version.segments
86
87
 
87
- if major != RSC_SUPPORTED_REACT_MAJOR || minor != RSC_SUPPORTED_REACT_MINOR
88
+ if version.prerelease?
89
+ GeneratorMessages.add_warning(<<~MSG.strip)
90
+ ⚠️ RSC requires stable React (detected: #{react_version}).
91
+
92
+ React prereleases are not supported. Install matching stable React/React DOM versions:
93
+ #{manual_add_packages_command(["react@#{RSC_REACT_VERSION_RANGE}", "react-dom@#{RSC_REACT_VERSION_RANGE}"])}
94
+ MSG
95
+ elsif major != RSC_SUPPORTED_REACT_MAJOR || minor != RSC_SUPPORTED_REACT_MINOR
88
96
  GeneratorMessages.add_warning(<<~MSG.strip)
89
97
  ⚠️ RSC requires React #{RSC_SUPPORTED_REACT_LINE} (detected: #{react_version})
90
98
 
@@ -97,13 +105,14 @@ module ReactOnRails
97
105
  MSG
98
106
  elsif patch < RSC_MINIMUM_REACT_PATCH
99
107
  GeneratorMessages.add_warning(<<~MSG.strip)
100
- ⚠️ React #{react_version} is below the recommended minimum for RSC.
108
+ ⚠️ React #{react_version} is below the required minimum for RSC.
101
109
 
102
- Please upgrade to at least React #{RSC_MINIMUM_REACT_VERSION}:
103
- #{manual_add_packages_command(["react@#{RSC_MINIMUM_REACT_VERSION}", "react-dom@#{RSC_MINIMUM_REACT_VERSION}"])}
110
+ react-on-rails-rsc #{JsDependencyManager::RSC_PACKAGE_VERSION_PIN} requires
111
+ matching stable React/React DOM #{RSC_MINIMUM_REACT_VERSION}+ on #{RSC_SUPPORTED_REACT_LINE}.
112
+ The Node Renderer refuses startup until React and React DOM are upgraded together:
113
+ #{manual_add_packages_command(["react@#{RSC_REACT_VERSION_RANGE}", "react-dom@#{RSC_REACT_VERSION_RANGE}"])}
104
114
 
105
- react-on-rails-rsc 19.2.x with patch >= 19.2.1 is coordinated with
106
- React/React DOM #{RSC_MINIMUM_REACT_VERSION}+ for the React on Rails Pro 17 RSC runtime.
115
+ The standalone RSC generator does not upgrade your React or React DOM dependencies.
107
116
  MSG
108
117
  end
109
118
  end
@@ -4301,7 +4301,9 @@ module ReactOnRails
4301
4301
  RSC_PACKAGE_NAME = "react-on-rails-rsc"
4302
4302
  RSC_MINIMUM_PACKAGE_VERSION = "19.2.1"
4303
4303
  RSC_SUPPORTED_PACKAGE_MAJOR = 19
4304
- RSC_SUPPORTED_PACKAGE_MINORS = [2].freeze
4304
+ # Package and React minors differ: RSC 19.3 uses the React 19.2.8 runtime.
4305
+ RSC_REACT_MINIMUM_BY_PACKAGE_MINOR = { 2 => "19.2.7", 3 => "19.2.8" }.freeze
4306
+ RSC_SUPPORTED_PACKAGE_MINORS = RSC_REACT_MINIMUM_BY_PACKAGE_MINOR.keys.freeze
4305
4307
  RSC_SUPPORTED_PACKAGE_LINE = RSC_SUPPORTED_PACKAGE_MINORS.map do |minor|
4306
4308
  "#{RSC_SUPPORTED_PACKAGE_MAJOR}.#{minor}.x"
4307
4309
  end.join(" or ")
@@ -4313,7 +4315,10 @@ module ReactOnRails
4313
4315
  RSC_MINIMUM_REACT_VERSION = "19.2.7"
4314
4316
  RSC_MINIMUM_REACT_VERSION_TUPLE = RSC_MINIMUM_REACT_VERSION.split(".").map(&:to_i).freeze
4315
4317
  RSC_SUPPORTED_REACT_MAJOR = RSC_MINIMUM_REACT_VERSION_TUPLE.fetch(0)
4316
- RSC_SUPPORTED_REACT_LINE = RSC_SUPPORTED_PACKAGE_MINORS.map do |minor|
4318
+ RSC_SUPPORTED_REACT_MINORS = RSC_REACT_MINIMUM_BY_PACKAGE_MINOR.values.map do |version|
4319
+ version.split(".").fetch(1).to_i
4320
+ end.uniq.freeze
4321
+ RSC_SUPPORTED_REACT_LINE = RSC_SUPPORTED_REACT_MINORS.map do |minor|
4317
4322
  "#{RSC_SUPPORTED_REACT_MAJOR}.#{minor}.x"
4318
4323
  end.join(" or ")
4319
4324
  RSC_DIST_TAGS_TO_CHECK = %w[next rc].freeze
@@ -4603,6 +4608,8 @@ module ReactOnRails
4603
4608
  return true unless check_rsc_package_minimum_version(rsc_package)
4604
4609
 
4605
4610
  unless rsc_package_declares_react_peer_dependencies?(rsc_package)
4611
+ return true unless check_rsc_supported_react_packages_for_package(rsc_package, react_version)
4612
+
4606
4613
  checker.add_warning(<<~MSG.strip)
4607
4614
  ⚠️ #{RSC_PACKAGE_NAME} #{rsc_package['version']} does not declare React peer dependencies.
4608
4615
 
@@ -4624,8 +4631,11 @@ module ReactOnRails
4624
4631
  rsc_version = rsc_package["version"].to_s
4625
4632
  return true if rsc_package_version_at_or_above_minimum?(rsc_version)
4626
4633
 
4634
+ react_requirements = RSC_REACT_MINIMUM_BY_PACKAGE_MINOR.map do |minor, minimum|
4635
+ "RSC #{RSC_SUPPORTED_PACKAGE_MAJOR}.#{minor}.x requires stable React/React DOM ~#{minimum}"
4636
+ end.join("; ")
4627
4637
  prerelease_requirement = if RSC_MINIMUM_PACKAGE_PRERELEASE_VERSION.present?
4628
- "\n(or #{RSC_MINIMUM_PACKAGE_PRERELEASE_VERSION} during the 17.0 RC soak)"
4638
+ "\n(or #{RSC_MINIMUM_PACKAGE_PRERELEASE_VERSION} during the RC soak)"
4629
4639
  else
4630
4640
  ""
4631
4641
  end
@@ -4634,10 +4644,10 @@ module ReactOnRails
4634
4644
  🚫 #{RSC_PACKAGE_NAME} #{rsc_version.presence || 'unknown'} is not supported by React on Rails Pro 17 RSC.
4635
4645
 
4636
4646
  React on Rails Pro 17 requires #{RSC_PACKAGE_NAME} >= #{RSC_MINIMUM_PACKAGE_VERSION}#{prerelease_requirement}
4637
- on the supported #{RSC_SUPPORTED_PACKAGE_LINE} package line
4638
- with React/React DOM #{RSC_MINIMUM_REACT_VERSION}+.
4647
+ on the supported #{RSC_SUPPORTED_PACKAGE_LINE} package line.
4648
+ #{react_requirements}.
4639
4649
 
4640
- Fix: npm install react@~#{RSC_MINIMUM_REACT_VERSION} react-dom@~#{RSC_MINIMUM_REACT_VERSION} #{RSC_PACKAGE_NAME}@#{RSC_PACKAGE_INSTALL_VERSION} --save-exact
4650
+ Fix: npm install react@#{ReactOnRails::Generators::JsDependencyManager::RSC_REACT_VERSION_RANGE} react-dom@#{ReactOnRails::Generators::JsDependencyManager::RSC_REACT_VERSION_RANGE} && npm install #{RSC_PACKAGE_NAME}@#{RSC_PACKAGE_INSTALL_VERSION} --save-exact
4641
4651
  MSG
4642
4652
  false
4643
4653
  end
@@ -4665,13 +4675,14 @@ module ReactOnRails
4665
4675
  end
4666
4676
 
4667
4677
  def supported_rsc_react_version?(react_version)
4668
- supported_rsc_react_line?(react_version) &&
4678
+ npm_prerelease(react_version).empty? &&
4679
+ supported_rsc_react_line?(react_version) &&
4669
4680
  !npm_version_less_than?(react_version, RSC_MINIMUM_REACT_VERSION)
4670
4681
  end
4671
4682
 
4672
4683
  def supported_rsc_react_line?(react_version)
4673
4684
  major, minor, = npm_version_tuple(react_version)
4674
- major == RSC_SUPPORTED_REACT_MAJOR && RSC_SUPPORTED_PACKAGE_MINORS.include?(minor)
4685
+ major == RSC_SUPPORTED_REACT_MAJOR && RSC_SUPPORTED_REACT_MINORS.include?(minor)
4675
4686
  end
4676
4687
 
4677
4688
  def rsc_react_major_or_newer?(react_version)
@@ -4690,17 +4701,21 @@ module ReactOnRails
4690
4701
 
4691
4702
  def check_rsc_supported_react_version_for_package(rsc_package, package_name, package_version)
4692
4703
  return true if package_version.blank?
4693
- return true unless unsupported_rsc_react_version?(package_version)
4704
+
4705
+ rsc_minor = npm_version_tuple(rsc_package["version"])[1]
4706
+ minimum_version = RSC_REACT_MINIMUM_BY_PACKAGE_MINOR.fetch(rsc_minor)
4707
+ return true if npm_prerelease(package_version).blank? && supported_rsc_react_line?(package_version) &&
4708
+ !npm_version_less_than?(package_version, minimum_version)
4694
4709
 
4695
4710
  package_label = package_name == "react" ? "React" : "React DOM"
4696
4711
 
4697
4712
  checker.add_error(<<~MSG.strip)
4698
4713
  🚫 #{RSC_PACKAGE_NAME} #{rsc_package['version']} is installed with unsupported #{package_label} #{package_version}.
4699
4714
 
4700
- React on Rails Pro 17 RSC currently supports React/React DOM #{RSC_SUPPORTED_REACT_LINE} with patch >= #{RSC_MINIMUM_REACT_VERSION}.
4715
+ React on Rails Pro 17 RSC currently supports stable React/React DOM #{RSC_SUPPORTED_REACT_LINE} with patch >= #{minimum_version}.
4701
4716
  The node renderer enforces the same support window at startup.
4702
4717
 
4703
- Fix: npm install react@~#{RSC_MINIMUM_REACT_VERSION} react-dom@~#{RSC_MINIMUM_REACT_VERSION} --save-exact
4718
+ Fix: npm install react@~#{minimum_version} react-dom@~#{minimum_version}
4704
4719
  MSG
4705
4720
  false
4706
4721
  end
@@ -4810,7 +4825,8 @@ module ReactOnRails
4810
4825
  checker.add_warning(<<~MSG.strip)
4811
4826
  ⚠️ #{RSC_PACKAGE_NAME} #{installed_version} is behind the npm #{tag} dist-tag #{tag_version}.
4812
4827
 
4813
- React Server Components track React minor versions. If your React version is on the #{tag_version.split('.')[0, 2].join('.')} line, install the matching RSC package instead of relying on a stale latest tag.
4828
+ Before upgrading, check the candidate package's React peer requirements
4829
+ and the React runtime versions supported by this React on Rails Pro release.
4814
4830
 
4815
4831
  Check peer requirements with:
4816
4832
  npm view #{RSC_PACKAGE_NAME}@#{tag_version} peerDependencies
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "17.1.0.rc.2"
4
+ VERSION = "17.1.0.rc.3"
5
5
  end
@@ -196,6 +196,14 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength
196
196
  sh_in_dir(example_type.dir, "touch .gitignore")
197
197
  sh_in_dir(example_type.dir,
198
198
  "echo \"gem 'react_on_rails', path: '#{relative_gem_root}'\" >> #{example_type.gemfile}")
199
+ # json 3.0.0 (2026-09-07) raises ArgumentError on unknown keywords, and Rails < 8.1
200
+ # ActiveSupport still passes the removed quirks_mode: option to JSON.generate
201
+ # (fixed upstream in rails/rails#55534; released only in Rails >= 8.1.0).
202
+ # Self-retires when example apps generate on Rails >= 8.1; also removable if a
203
+ # json 3.x release restores tolerance for removed keywords.
204
+ if Gem::Version.new(Rails.version) < Gem::Version.new("8.1")
205
+ File.write(example_type.gemfile, "gem 'json', '>= 2', '< 3'\n", mode: "a")
206
+ end
199
207
  # Shakapacker is automatically included as a dependency via react_on_rails.gemspec (>= 6.0)
200
208
  bundle_install_in(example_type.dir)
201
209
  # Use unbundled_sh_in_dir to ensure we're using the generated app's Gemfile
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: 17.1.0.rc.2
4
+ version: 17.1.0.rc.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon