Re:Rux: A JSX-inspired way to render view components in Ruby
by petepete on Tuesday March 07, 2023 @06:15AM
(#35054066)
> Am I understanding correctly that there’s a significant difference in performance between using a ViewComponent + a partial vs. a ViewComponent which renders html via a tag - from inside the component?
I don't think there will be much difference at all in everyday use, but some libraries that value performance don't avoid templates for that reason, Pagy for example.
I don't think there will be much difference at all in everyday use, but some libraries that value performance don't avoid templates for that reason, Pagy for example.
https://github.com/ddnexus/pagy
Personally I omit them in my projects whenever we want to customise attributes, I hate seeing stuff like this in templates:
I'd much rather see: And as lots of the components allow attributes to be customised, using the tag helpers directly seems like a good choice.> Also - the gov.uk project makes my heart sing ;)
Thanks :) Although I just reimplement the components and forms in Rails, the proper hard work is done upstream.