Live data from Hacker News

RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

github.com

11–20 of 40 posts

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#11
the fact that this mentions Tailwind already signifies that its target audience is 10 year olds

edit: yeah, after reading more, this is an affront against nature. forget about separation of content and presentation, now you can even throw your backend into the dumpster fire!

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#12
post #6

I’m impressed by this project’s progress. It’s more than just a render library. Although they claim it’s 12x faster than ERB, but I couldn’t find their benchmark.

I believe it's referencing this: https://github.com/KonnorRogers/view-layer-benchmarks

Can't believe this still has to be debunked. No Phlex certainly isn't 12x faster than ERB. It's noticeably slower than ERB, e.g.: https://github.com/KonnorRogers/view-layer-benchmarks/commit...

In some extreme scenarios with tons of very small partials, it can win against Action View because the Action View partial lookup is significant overhead.

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#14
Phlex is an amazing project. Makes frontend fun again. I've built my own UI library using DaisyUI and Tailwindcss that we use in all our Rails projects: https://github.com/inhouse-work/protos

It cannot be overstated how nice it is to move away from erb and into pure ruby. Private methods as partials is a game changer for refactoring your UI.

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#15
post #12

Earlier quoted context omitted.

I believe it's referencing this: https://github.com/KonnorRogers/view-layer-benchmarks

Can't believe this still has to be debunked. No Phlex certainly isn't 12x faster than ERB. It's noticeably slower than ERB, e.g.: https://github.com/KonnorRogers/view-layer-benchmarks/commit... In some extreme scenarios with tons of very small partials, it can win against Action View because the Action View partial lookup is significant overhead.

It says on the website it's 12x faster so it must be true!

https://rubyui.com

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#16

Looks interesting, but I wish there was a way to alias the component names, since every component class, some of which have common names, take root in the global namespace. (though I suspect that easily enough done manually)

They’re not in the root namespace. They are instance methods (on the instance of the component) that start with a capital letter. https://www.phlex.fun/components/kits.html

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#17

Phlex is an amazing project. Makes frontend fun again. I've built my own UI library using DaisyUI and Tailwindcss that we use in all our Rails projects: https://github.com/inhouse-work/protos It cannot be overstated how nice it is to move away from erb and into pure ruby. Private methods as partials is a game changer for refactoring your UI.

Have you had much luck with slots? I have a project using View Components that leverages slots. I've tried migrating to Phlex, but the lack of explicit slot support has been a bit frustrating.

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#18
post #12

Earlier quoted context omitted.

Can't believe this still has to be debunked. No Phlex certainly isn't 12x faster than ERB. It's noticeably slower than ERB, e.g.: https://github.com/KonnorRogers/view-layer-benchmarks/commit... In some extreme scenarios with tons of very small partials, it can win against Action View because the Action View partial lookup is significant overhead.

It says on the website it's 12x faster so it must be true! https://rubyui.com

It probably is (or at least was) faster than ActionView if you use lots of small partials, but it is not faster than ERB since it is not compiled. It generates HTML at about 1.6gbps per core on my laptop so probably fast enough for most things.

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#19
post #5

this looks dope. has anyone built anything substantial with phlex ?

I believe Clearscope is the largest app using Phlex views exclusively, with 454 components and counting. There’s a list of some other users here. https://www.phlex.fun/project/community.html#who-s-using-phl...

Re: RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

#20
post #12

Earlier quoted context omitted.

I believe it's referencing this: https://github.com/KonnorRogers/view-layer-benchmarks

Can't believe this still has to be debunked. No Phlex certainly isn't 12x faster than ERB. It's noticeably slower than ERB, e.g.: https://github.com/KonnorRogers/view-layer-benchmarks/commit... In some extreme scenarios with tons of very small partials, it can win against Action View because the Action View partial lookup is significant overhead.

In my experience, it’s not an extreme scenario to render several thousand components in a single view.

I think you’re looking at this from the perspective of having maybe a partial for your header and another for your footer. The way you build views in Phlex is you would have a component not just for the header but also the nav, each item in the nav, and each icon in each item.

We can argue about whether that level of abstraction and reuse is worth it, but the fact is ActionView gets very slow when you build views like that composing thousands of partials — and for people who want to build views like that, it matters.

Still, I think these “12× faster” comparisons are silly. If ActionView was just as fast at rendering thousands of small components, I’d still pick Phlex for the developer experience. I enjoy writing Ruby, not toggling between Ruby and HTML.

Post reply on HN