You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <noreply@anthropic.com>
0 commit comments