Phlex will be used for HTML templating

Accepted

Created

Context

Web apps need to generate HTML. In Ruby apps, this is typically done with ERB, or with some pluggable architecture to allow stuff like HAML as an option.

Concerns or Issues

Having multiple options is usually bad. ERB is a logical choice as the single option, however it is error prone and messy. For large pages, it can create quite a mess, requiring either careful formatting or excessive use of partials to make it manageable.

Decision

Brut will use Phlex instead of ERB and Phlex will be the only option for generating HTML.

Options Considered, but Not Chosen

ERB was the choice for a while, but it became unwieldy in the demo apps I was making. HAML and SLIM are terrible and were never an option. I did consider creating my own templating system based on HTML, however HTML lacks obvious ways to structure loops and conditionals, so this was abandoned

System Qualities or Desired Consequences

Phlex seems very nice, as it is a clean abstraction of HTML that can provide some additional type checking and validation. Having a single way to do it means that documentation is easier, and re-usable components can be created and shared.

Downsides

I guess some people will not like Phlex or really want HAML. They can use another framework.

Additional Rationale

Phlex also seems well-supported and has a burgeoning component community that could be leveraged.

Adjust Control Icon