from Hacker News

RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components

by ksec on 4/1/25, 3:39 PM with 39 comments

  • by GenericCanadian on 4/1/25, 8:01 PM

    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.

  • by budu on 4/1/25, 5:34 PM

    The RubyUI team is doing a fantastic job. This gem is now one of the first ones I add to a new project. Thanks for your work!
  • by bdcravens on 4/1/25, 5:10 PM

    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)
  • by drumpkid on 4/1/25, 6:25 PM

    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.
  • by Sophira on 4/3/25, 1:40 AM

    At first, I thought this was a general Ruby thing, but the install process has you running Rails commands. Does that mean this is web-focused, rather than a UI thing that I can use in native Ruby applications?
  • by anonygler on 4/2/25, 4:32 AM

    I used a rendering library like Phlex back in 2010. I hated it back then and I still don’t like it.

    They claim it’s faster than ERB but only show micro benchmarks. This is basically a form of lying.

    This approach stinks for a lot of reasons:

    - it adds a ton of pressure on the garbage collector. - the backtraces suck to debug. Ruby is better now than in 2010, but it’s still lame. - your templates are largely static. Yet when it lives as code you can’t cache any of it. An efficient ERB generator is just cached strings concatenations. Very efficient in Ruby.

    Finally, Rubyists hate this and it’s why the community is slowly dying. Almost all your frontend should be in JS/JSX at this point. Even the static stuff.

  • by daviding on 4/1/25, 7:17 PM

    Interesting stuff. Unsure about the Phlex approach but could be worth a go.

    Didn't have any luck with the Date Picker component demo page (no pop up or validation?), and that's my usual go-to for seeing how these libraries are doing.

  • by dzonga on 4/1/25, 5:54 PM

    this looks dope. has anyone built anything substantial with phlex ?
  • by alexmccain6 on 4/2/25, 6:18 AM

    RubyUI looks interesting, but I wonder how well it scales in large apps. Moving away from ERB makes sense for maintainability, but does it introduce any trade-offs in terms of memory usage or debugging? Would love to hear from people using it in production.
  • by desireco42 on 4/1/25, 5:28 PM

    Looks really good and I am happy to see many interesting in Ruby world...
  • by jspash on 4/2/25, 8:00 AM

    Just curious why the decision was made to go with PascalCase for the DSL? Is this meant to help React devs feel at home? Seems very un-Rubylike.
  • by ajmaia on 4/2/25, 11:30 AM

    Our team was already using the pre-release version in the current project, a brand new Rails 8 monolith. Its being very useful!
  • by ramesh31 on 4/1/25, 7:58 PM

    Really gorgeous components. I cant say I understand who would use this or why... but this is a good thing.
  • by cbeltrao on 4/2/25, 10:29 AM

    Awesome project!
  • by justinko on 4/2/25, 1:46 AM

    If I can't copy/paste HTML, not interested.
  • by luispimenta on 4/2/25, 10:27 AM

    nice
  • by this_is_madness on 4/1/25, 7:54 PM

    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!