← Graph

Phlex

tool 20 connections

Ruby gem for building HTML views as Ruby objects/methods instead of template files. Created by Joel Drapper. One file per component handles both view and logic; supports native Ruby syntax and can be made type-safe (components can extend Literal::Properties for typed props — e.g. Button with size small/medium/large and variant primary/secondary). Implements Rails' 'renderable' interface (the abstraction pioneered by the ViewComponent team) so every Turbo helper works out of the box; also has an early/experimental selective-rendering feature that can render only the requested Turbo Frame. Benchmarks: not a blanket '12× faster than ERB' — Phlex actually does more work than ERB when rendering a single tag, but scales far better when a page contains thousands of small components/partials, where ActionView's partial-lookup overhead dominates. In real-world rendering Phlex typically saturates the network before the CPU. Upcoming work includes a validator that writes literal schemas for HTML attributes and reports helpful errors (wrong boolean values, malformed dates in time elements, MDN documentation links). A test-environment mode that compiles to a queryable data structure (instead of HTML strings) is under discussion. Mentioned in Yaroslav Shmarov's wroclove.rb 2022 talk as a potential substitute for ViewComponent and adopted by Statesert/Ruby UI at wroclove.rb 2025.

author
Joel Drapper
category
library
Mentioned as a potential substitute for ViewComponent.
about
Phlex tool
Phlex Button component demonstrated as a user of Literal::Properties.
Developer-experience / error-message behavior of Phlex.
about
Phlex tool
Testing story for Phlex.
Central subject of the talk — adopting Phlex for Rails view rendering.
about
Phlex tool
Concerns the performance characteristics of Phlex vs ActionView/ERB.
about
Phlex tool
Describes Phlex's single-file component style.
about
Phlex tool
Topic: Phlex behavior in the Turbo ecosystem.
about
Phlex tool
Cited as an alternative approach to view-logic extraction
Mentioned (as 'Flex') as another innovative view-logic solution
about
Phlex tool
Talk devotes its view-layer section to Phlex views, components, kits, and selective rendering.
person Seth Horsley
recommends
Phlex tool
Recommends Phlex over ERB/ActionView and ViewComponent for Rails view layers.
tool Phlex
related_to
Turbo tool
Phlex implements Rails' renderable interface so all Turbo helpers work; experimental support for frame-scoped selective rendering.
tool Phlex
related_to
ViewComponent team pioneered the 'renderable' abstraction that Phlex implements to get Turbo interop for free.
tool Phlex
uses
Literal tool
Phlex components can extend Literal::Properties to get typed props like union-typed size/variant.
project Ruby UI
uses
Phlex tool
Ruby UI is a component library for Phlex.
company Statesert
uses
Phlex tool
Uses Phlex as the front-end view layer after migrating away from React.
project Yippee
uses
Phlex tool
Yippee's view layer is built entirely on Phlex — every Yippee view and component is a Phlex class.
project Cidurial
uses
Phlex tool
Pages are Ruby classes using Phlex for templating and sub-components.
person Joel Drapper
works_on
Phlex tool
Creator of Phlex; explained its design and benchmarks on stage.
role: creator

Provenance

Total updates
2 extractions
Read by
12 extractions