react_on_rails 16.3.0.rc.2 → 16.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 628677c167f906b22c7997308ed630a4c6b93f9b53b4a81cfcfd2960fd6b2d8e
4
- data.tar.gz: fc1bd8c3939152cf92f48fa2f2053c8a0a30c4d5503d9468165e08d32f209e50
3
+ metadata.gz: 0ace0aef17c3665d3f573612c0fb1298834237fab6c25c67dc609fcd844efacf
4
+ data.tar.gz: 9768eec151936531996266b8635cfa9431014a98219b76c6a501ccba63a42ab2
5
5
  SHA512:
6
- metadata.gz: a895060d8fdae1dbc7f96e43aaabbe97cd62fa9ace58bcf06e151cdd7055245b2d68c45873d5c628faff49f0f3ad53dffe6c9bcf4d314d79a21bdc2eadd28e2d
7
- data.tar.gz: e66ccf6a13d26760349dfa591125b28e311ef2e28b6c5cde4a3ce10139bf2886719db25c0576b9d5a59d792fb831f2c549a1f4981b7eed27cd3dbe95260759cf
6
+ metadata.gz: c1f027af8612019f38ab829a9b99ca50f869112f9b6f0f47fd0af27aa4bf6cabfb1ab45121ce7c4607d12f364292cecc21e8aba863b791f52d6fa557231e9fa2
7
+ data.tar.gz: 4d6549c75f9615433be29f67d7ea68963e2f7480ad4468f86a9da2f50d1d490f5311ce188ddac3fb422e52cf20aaffa1d24b175214cd4321574fe616b21f42bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- react_on_rails (16.3.0.rc.2)
4
+ react_on_rails (16.3.0)
5
5
  addressable
6
6
  connection_pool
7
7
  execjs (~> 2.5)
@@ -302,11 +302,21 @@ module ReactOnRails
302
302
 
303
303
  puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow
304
304
 
305
- # Use gsub_file to preserve comments and file structure
306
- # Replace assets_bundler: "webpack" with assets_bundler: "rspack"
307
- gsub_file shakapacker_config_path,
308
- /^(\s*)assets_bundler:\s*["']?webpack["']?\s*$/,
309
- "\\1assets_bundler: \"rspack\""
305
+ # Use regex replacement to preserve file structure (comments, anchors, aliases)
306
+ # This replaces ALL occurrences of assets_bundler, not just in default section
307
+ # Using gsub_file (Thor method) for consistency with Rails generator patterns
308
+ gsub_file(
309
+ shakapacker_config_path,
310
+ /^(\s*assets_bundler:\s*)["']?webpack["']?(\s*(?:#.*)?)$/,
311
+ '\1rspack\2'
312
+ )
313
+
314
+ # Update javascript_transpiler to swc (rspack works best with SWC)
315
+ gsub_file(
316
+ shakapacker_config_path,
317
+ /^(\s*javascript_transpiler:\s*)["']?babel["']?(\s*(?:#.*)?)$/,
318
+ '\1swc\2'
319
+ )
310
320
 
311
321
  puts Rainbow("✅ Updated shakapacker.yml for Rspack").green
312
322
  end
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "fileutils"
5
- require "yaml"
6
5
  require "json"
7
6
 
8
7
  # Script to switch between webpack and rspack bundlers
@@ -48,16 +47,25 @@ class BundlerSwitcher
48
47
  abort "❌ #{@shakapacker_config} not found" unless File.exist?(@shakapacker_config)
49
48
 
50
49
  puts "📝 Updating #{@shakapacker_config}..."
51
- config = YAML.load_file(@shakapacker_config)
52
-
53
- config["default"] ||= {}
54
- config["default"]["assets_bundler"] = @target_bundler
55
-
56
- # Update webpack_loader based on bundler
57
- # Rspack works best with SWC, webpack typically uses babel
58
- config["default"]["webpack_loader"] = @target_bundler == "rspack" ? "swc" : "babel"
59
-
60
- File.write(@shakapacker_config, YAML.dump(config))
50
+ content = File.read(@shakapacker_config)
51
+
52
+ # Use regex replacement to preserve file structure (comments, anchors, aliases)
53
+ # This replaces ALL occurrences of assets_bundler, not just in default section
54
+ old_bundler = @target_bundler == "rspack" ? "webpack" : "rspack"
55
+ new_content = content.gsub(
56
+ /^(\s*assets_bundler:\s*)["']?#{old_bundler}["']?(\s*(?:#.*)?)$/,
57
+ "\\1#{@target_bundler}\\2"
58
+ )
59
+
60
+ # Update javascript_transpiler based on bundler (rspack works best with SWC)
61
+ new_loader = @target_bundler == "rspack" ? "swc" : "babel"
62
+ old_loader = @target_bundler == "rspack" ? "babel" : "swc"
63
+ new_content = new_content.gsub(
64
+ /^(\s*javascript_transpiler:\s*)["']?#{old_loader}["']?(\s*(?:#.*)?)$/,
65
+ "\\1#{new_loader}\\2"
66
+ )
67
+
68
+ File.write(@shakapacker_config, new_content)
61
69
  puts "✅ Updated assets_bundler to '#{@target_bundler}'"
62
70
  end
63
71
 
@@ -135,6 +143,7 @@ if ARGV.empty?
135
143
  puts "\nExamples:"
136
144
  puts " bin/switch-bundler rspack # Switch to Rspack"
137
145
  puts " bin/switch-bundler webpack # Switch to Webpack"
146
+ puts "\nNote: This also updates javascript_transpiler (rspack uses swc, webpack uses babel)"
138
147
  exit 1
139
148
  end
140
149
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "16.3.0.rc.2"
4
+ VERSION = "16.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.3.0.rc.2
4
+ version: 16.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-04 00:00:00.000000000 Z
11
+ date: 2026-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable