How do Ruby 3, Rails 7, and packwerk 2 affect the source code for Gradual Modularization for Ruby and Rails? Let’s find out!
Ruby 3 has been out for over a year. Reflecting on it, I don’t know why I didn’t update the code much earlier. Ruby 3 comes with a whole host of new feature.
Check out the code samples and you will see a ton of changes. This is typical and expected and not in itself particularly insightful.
It is better to look at the code generation scripts to see the delta to the changes Sportsball needs to make to the starter app.
importmap.rb. The opportunity with change is to switch the asynchronous frontend communication example in the event-based refactor of C5S09.
Packwerk was updated to version 2 because of some changes to the configuration introduced by my fellow gustie Alex Evanczuk in PR #159. Most notably, we no longer need to specify
load_paths. These two options were previously in place to improve packwerk load times. Now, after some speed-up work, they both don’t need to be cached anymore and are instead both pulled from the Rails app directly.
The generator scripts saw 417 deletions with only 40 additions. Basically the entire net reduction in lines stems from deleting now obsolete packwerk config lines!