Avoid preloading ActionController::Base #855
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.
Problem
When the gem was updated from 11.3.2 to 11.4.0, a new controller was added to the engine which inherits from
ActionController::Base
(v11.3.2...v11.4.0#diff-81ba7d06ee9616234c28206811e845e9R3). This caused a breakage on an app that installed the new version, where assets were no longer requested from the cdn server, but rather from the app server.While on version 11.3.2, on production we saw:
After we upgraded to 11.4.0, we saw:
which then subsequently made our assets no longer load from our cdn source, causing the breakage.
Solution
Move the controller file from being loaded in the engine to just part of the gem's app folder, so that it's loaded more lazily.
References
rails/rails#16209
https://guides.rubyonrails.org/engines.html#what-are-on-load-hooks-questionmark