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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ace0aef17c3665d3f573612c0fb1298834237fab6c25c67dc609fcd844efacf
|
|
4
|
+
data.tar.gz: 9768eec151936531996266b8635cfa9431014a98219b76c6a501ccba63a42ab2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1f027af8612019f38ab829a9b99ca50f869112f9b6f0f47fd0af27aa4bf6cabfb1ab45121ce7c4607d12f364292cecc21e8aba863b791f52d6fa557231e9fa2
|
|
7
|
+
data.tar.gz: 4d6549c75f9615433be29f67d7ea68963e2f7480ad4468f86a9da2f50d1d490f5311ce188ddac3fb422e52cf20aaffa1d24b175214cd4321574fe616b21f42bc
|
data/Gemfile.lock
CHANGED
|
@@ -302,11 +302,21 @@ module ReactOnRails
|
|
|
302
302
|
|
|
303
303
|
puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow
|
|
304
304
|
|
|
305
|
-
# Use
|
|
306
|
-
#
|
|
307
|
-
gsub_file
|
|
308
|
-
|
|
309
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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
|
|
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-
|
|
11
|
+
date: 2026-02-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|