-
ViewComponents added support for variants with This is not a feature that Rails supports, see https://github.com/rails/rails/blob/main/actionview/lib/action_view/template/resolver.rb#L21 How important is this feature to the community? Dropping support for this feature for V4 would allow ViewComponents to use the Rails logic for picking templates, which would improve support and consistency for locales, formats, and variants. See #2128 for context. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@sfnelson I'm fine with dropping this in v4 if it aligns with Rails 👍🏻 |
Beta Was this translation helpful? Give feedback.
@sfnelson Thanks for asking! 😄
I'm 100% fine with using the same logic Rails uses. Back when I sent the mentioned pull request, in my project we were using Rails 6.0, where views using variants with dots in their names worked fine (probably by coincidence). That was the motivation behind adding support for them to ViewComponent.
Since Rails no longer supports this feature (not that they ever officially supported it), the use case I mentioned is already broken anyway 😄, so feel free to ignore it 👍.