Enable configuring Action View's render tracker #55194
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Ref #55161
In Rails 7, a new render tracking implementation was added to Rails: the RipperTracker. From that commit message:
It was initially made the default render tracker, but that change was later backed out.
Since then, the Prism parser was released and made the default Ruby parser. A Prism render tracker implementation was also added to Rails in 7.2.
Detail
Until now, there hasn't been a "blessed" way for applications to try out the new tracker implementations (you would have to go through private API). This commit adds configuration to not only make it easy for applications to use the new Ruby-parser-based trackers, but it also makes these new trackers the default for new applications on 8.1.
The new trackers are not only better at finding
render
calls, they are also much easier to maintain. When I added trailing interpolation tracking to the three trackers, the Prism tracker was by far the easiest to work with.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]