home.social

#phlex — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #phlex, aggregated by home.social.

fetched live
  1. @joeldrapper any recommendations for integrating #Phlex with #Hanami? Anyone I find talking about it is doing it in Hanami 2.

    A Hanami::View is almost the same in principle to a Phlex::HTML, so it feels like with a small adapter or something I could write my Phlex view inside a Hanami view.

  2. Another Weekly Brain Dump is online!

    - Taylor Community site switching back to #Rails from #Hanami
    - I also switch to using #Phlex for view rendering
    - I start learning how to build a programming language

    sean.taylormadetech.dev/2026/0

    #WeeklyBrainDump #programming #ruby #blog #TaylorEngine

  3. Just had another very nice "aha moment" with #Phlex

    For my `Event` model, I had method `notified_changes` - to be able to list changes on object since user last saw it.

    First, I put it in Notifiable concern, but that's shared with many models, and I need this only for Event.

    So I created presenter/decorator, which is okay. But still - I need this only for events#show, so general presenter is bit of an overkill.

    Luckily, in Phlex, I can to this:

  4. Ok, I'm really enjoying using #Phlex in my #rails app.

    I started using it in new project to try (didn't manage to rewrite the layouts and get rid of simple_form, but other than that, I'm full on Phlex).

    Now I'm rewriting ViewComponents to Phlex (with help of RubyUI, nice library!), and it's so much cleaner!

    I wrote a post about why I like Phlex now, as it would be bit long for here:
    dev.to/janmpeterka/using-phlex

    Thanks @joeldrapper for this delightful gem!

  5. Phlex + Literal combo to build your design system

    #ruby #phlex

  6. Added features do Pikoin:
    - Cashflow insight
    - Spending breakdown insight
    - Support for pt-BR language
    - Support for different currencies (input and display)
    - More 2 filter options for insights (last month, last year)

    Pikoin repo: github.com/gunbolt/pikoin

    #ruby #phlex

  7. I need to migrate an "old" framework based on #phlex . I'm working on adding the deferred rendering to our existing stack; and can't wrap my head around what that `vanish(&)` thing do.

    So many unexpected behaviours, if only we had time to do this more thoughtfully at first.

  8. Actually playing with #phlex and #literal in #ruby on #rails and it feels awesome. Rock solid gems !

  9. It’s lazy fediverse wednesday.
    Are there *nice* HTML rendering/templating libs for #golang? Maybe even something like Rubies #phlex? Coming from doing Hugo templates in that awful native go template language and maybe required to do a go project in the future.

  10. I just published Phlex::Variants gem, to help building components with Phlex + utility-first CSS frameworks (eg. Tailwind CSS).

    github.com/stephannv/phlex-var

    #phlex #ruby

  11. 🤔 random thought—does DHH's recent "system tests are dead" proclamation open the door to ViewComponents (or Phlex, or ?) being stock Rails features? I like ViewComponents because I can test UI things without the browser overhead—even if I only use a component once in my whole app. #RubyOnRails #RSpec #ViewComponent #phlex

  12. Oh, apparently #phlex defines a method `format` for the components; which shadows the #ruby kernel's `format` method D:

  13. @joeldrapper BTW, nested layouts are so much simpler with #Phlex than the way proposed in Rails Guides.

  14. @joeldrapper Tried #Phlex for a small side project and enjoyed it a lot.

    One thing I noticed is that docs still use `template` everywhere even though it seem to have been deprecated.

  15. @joeldrapper, what the story for I18n for #Phlex? I'm specifically thinking of the Rails idiom where I can have an `app/views/statics/home.fr.html.erb` and an `app/views/statics/home.en.html.erb` and depending on the Accept-Language header, one of the views will be rendered.

  16. @joeldrapper I've been watching Phlex develop and like what I see! However, I've also found a lot of value in staying vanilla/golden path Rails in the past.

    It looks like with phlex.js/morphlex, phlex is moving further away from that - I'm curious what the motivation is in writing turbo and idiomorph replacements.

    Have you written or spoken somewhere about this you could point me to?

    Thanks!

    #ruby #phlex

  17. Here's how to render the JavaScript for the new debugbar Rails gem in a Phlex layout (add this to the `head` block in your template).

    github.com/phlex-ruby/phlex-ra

    debugbar.dev/docs/installation

    #Phlex #Debugbar #RubyOnRails #Ruby #JavaScript

  18. I just released Phlex-Slotable 0.2.0 with two new features:

    1) Accepts string as phlex view class name. It is useful when using an inner class that will be evaluated later.

    2) Allows lambda slots. It is useful in cases where writing another component may be unnecessary or as wrappers for another phlex view with specific default values.

    github.com/stephannv/phlex-slo

    #ruby #phlex #rails

  19. I just published my first gem, Phlex-Slotable. It is a Slot API for @joeldrapper 's Phlex lib inspired by ViewComponent slots.

    I'm already using this on my side-project and it is working fine. I'm planning to add some features to improve its usage (eg. allow passing String as component class name). I'm putting off refactoring the code until these new things are ready.

    BTW, Its API can change.

    github.com/stephannv/phlex-slo

    #ruby #rails #phlex

  20. I have finally got around to trying out #phlex and so far I am loving it.
    I am experimenting with wrapping layout primitives (see ruby.social/@Sandbagger/110866) into Phlex components, and being able to render them like the method calls to HTML tags

  21. Phlex isn’t a “competitor” to React but I recently rewrote a small React/GraphQL (Apollo + Rails backend) app in Rails/Phlex (no JavaScript at all) which removed loads of code, a ton of complexity, and additional maintenance hassle. I’m not even all-in with Phlex but it immediately gives benefits for even the smallest of components #phlex #mpa

  22. While working with #phlex I see two kinds of components emerging:

    1. Pretty dumb UI components that usually accept a lot of arguments which are all primitive value. For example `Components::Card`.
    2. Specialized components which accept one complex object and a component knows a lot about this object. Usually only used in a few places. For example `Components::TournamentInfobox`.

    I would like to distinguish somehow between them, but I'm missing the name for 2.