Commit 233b789
Simplify PackerUtils by removing legacy Webpacker compatibility code
Since React on Rails 16 dropped Webpacker support and requires shakapacker >= 6.0
in the gemspec, we can eliminate all the complex version checking and gem availability
logic that was needed to support both Webpacker and Shakapacker.
## Changes
- `using_packer?` and `using_shakapacker_const?` now always return `true`
- `packer_type` always returns `"shakapacker"`
- `packer` method simplified (no need for availability checks)
- `shakapacker_version` simplified (no need for gem_available? check)
- Feature detection methods (`supports_async_loading?`, `supports_auto_registration?`)
simplified to remove unnecessary `using_shakapacker_const?` checks
- Tests simplified to remove mocking of gem availability
## Impact
- ✅ Code is much simpler and easier to understand
- ✅ Removes unnecessary complexity from legacy Webpacker/Shakapacker dual support
- ✅ All tests pass
- ✅ Maintains the same public API behavior
- ✅ Leverages the gemspec dependency requirement instead of runtime checks
Since shakapacker >= 6.0 is guaranteed by the gemspec, all this checking was redundant.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent a3c3391 commit 233b789
File tree
2 files changed
+10
-59
lines changed- lib/react_on_rails
- spec/react_on_rails
2 files changed
+10
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 14 | + | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
38 | 31 | | |
39 | 32 | | |
40 | 33 | | |
41 | | - | |
42 | 34 | | |
43 | 35 | | |
44 | 36 | | |
| |||
57 | 49 | | |
58 | 50 | | |
59 | 51 | | |
60 | | - | |
| 52 | + | |
61 | 53 | | |
62 | 54 | | |
63 | 55 | | |
64 | | - | |
65 | | - | |
| 56 | + | |
66 | 57 | | |
67 | 58 | | |
68 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | | - | |
| 87 | + | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
104 | | - | |
| 96 | + | |
105 | 97 | | |
106 | 98 | | |
107 | 99 | | |
108 | 100 | | |
109 | 101 | | |
110 | | - | |
111 | | - | |
| 102 | + | |
112 | 103 | | |
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
116 | 107 | | |
117 | 108 | | |
118 | | - | |
119 | | - | |
| 109 | + | |
120 | 110 | | |
121 | 111 | | |
122 | 112 | | |
123 | 113 | | |
124 | 114 | | |
125 | 115 | | |
126 | 116 | | |
127 | | - | |
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | 120 | | |
132 | 121 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 122 | | |
163 | 123 | | |
164 | 124 | | |
0 commit comments