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
I am using view_component in a Rails application with config.action_view.annotate_rendered_view_with_filenames set to true. For view components with templates, the HTML is annotated with the usual BEGIN and END. However for inline components (so relying on call and not having a template), the HTML doesn't contain those annotations.
Steps to reproduce
Set config.action_view.annotate_rendered_view_with_filenames set to true in your Rails config.
Render a view component with a template.
Render an inline view component.
See the BEGIN and END comments for the view component with a template, but not for the inline view component.
Example in which the <abbr> tag is an inline view component and another component with a template which renders Hello!:
Expected behavior
I expect the annotations to be added for inline view components.
Actual behavior
The annotations are not added for inline view components.
@dmarcoux thanks for filing this issue! The current implementation of template annotations hooks into the template compilation process, which isn't used for inline components.
I'd love to see this feature added to the framework, would you like to take it on? I'd be happy to pair with you to get it off the ground: [email protected]
@joevandyk yes, I think we'd do it in that area of the codebase! Happy to pair with you if you'd like, email me with your availability if you'd like: [email protected]
I am using view_component in a Rails application with
config.action_view.annotate_rendered_view_with_filenames
set totrue
. For view components with templates, the HTML is annotated with the usualBEGIN
andEND
. However for inline components (so relying oncall
and not having a template), the HTML doesn't contain those annotations.Steps to reproduce
config.action_view.annotate_rendered_view_with_filenames
set totrue
in your Rails config.BEGIN
andEND
comments for the view component with a template, but not for the inline view component.Example in which the
<abbr>
tag is an inline view component and another component with a template which rendersHello!
:Expected behavior
I expect the annotations to be added for inline view components.
Actual behavior
The annotations are not added for inline view components.
System configuration
Rails version: Rails 7.0.2.2
Ruby version: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
Gem version: 2.49.1
The text was updated successfully, but these errors were encountered: