Repository navigation
render_in: Skip emission of render_template.action_view - #58805
Closed
joelhawksley wants to merge 2 commits into
Closed
joelhawksley wants to merge 2 commits into
joelhawksley wants to merge 2 commits into
Conversation
Related to rails#57781 As reported in rails#57781, new calls to `#render_in` emit `render_template.action_view` Active Support notifications, which themselves cause a spike in object allocations. This commit explores an alternative that preserves the behavior introduced in [rails#50623][] (support for passing `:locals` at the `#render_in` call-site) without also emitting `render_template.action_view` notifications. Rather than rely on the `ActionView::Renderer` instance returned by the `ActionView::Helpers::RenderingHelper#view_renderer` invocation, construct an instance of `Template::Renderable` and invoke `#render` on it directly. [rails#50623]: rails#50623
Bring in upstream JSON 3 compatibility fixes and the known guide-template skips while preserving Sean Doyle’s original commit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #57781
As reported in #57781, new calls to
#render_inemitrender_template.action_viewActive Support notifications, which themselves cause a spike in object allocations.This commit explores an alternative that preserves the behavior introduced in #50623 (support for passing
:localsat the#render_incall-site) without also emittingrender_template.action_viewnotifications.Rather than rely on the
ActionView::Rendererinstance returned by theActionView::Helpers::RenderingHelper#view_rendererinvocation, construct an instance ofTemplate::Renderableand invoke#renderon it directly.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]