# Clearwater, a front-end app framework in Ruby

**URL:** <https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121>\
**Category:** Ruby Chat\
**Tags:** clearwater\
**Created:** [June 18, 2015, 2:52am UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121 "2015-06-18T02:52:17Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![kofno](https://metaruby.com/user_avatar/metaruby.com/kofno/32/159_2.png) [@kofno](https://metaruby.com/u/kofno)\
**Post date:** [June 21, 2015, 1:57pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/21 "2015-06-21T13:57:55Z")

</div>

I wonder if a templating engine would be more likely to encourage developers to build too large components.

---

<div class="post-metadata">

**Author:** ![jgaskins](https://metaruby.com/user_avatar/metaruby.com/jgaskins/32/834_2.png) [@jgaskins](https://metaruby.com/u/jgaskins)\
**Post date:** [June 21, 2015, 8:09pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/22 "2015-06-21T20:09:16Z")

</div>

I’d like to chat about this with you sometime. The Slim-\>React compiler I tried before was a lot harder than I expected — I couldn’t figure out a way to get Temple to get commas in between outputs.

One benefit of keeping dependencies out of the `Component` mixin is that people will be able to build on top of it or replace it with something that fits their development style. As long as the object responds to `render` and returns virtual DOM nodes, you can use it (there are two additional attr\_accessors needed on routed components, but that’s it). I’m going to try my best not to let Clearwater assume much (if any) more about components. I like that simplicity.

---

<div class="post-metadata">

**Author:** ![jgaskins](https://metaruby.com/user_avatar/metaruby.com/jgaskins/32/834_2.png) [@jgaskins](https://metaruby.com/u/jgaskins)\
**Post date:** [June 21, 2015, 10:24pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/23 "2015-06-21T22:24:23Z")

</div>

I’m not sure how I feel about separating templates and components. After using React for a while, I really do like the cohesion of the component with its output. Switching back and forth between the two files in my editor feels like unnecessary context switches now. I’m not sure yet if that’s laziness, but I admit it feels nice to have it all in one place.

Clearwater actually used the template approach originally. I liked the idea behind `opal-haml`, so I wrote the `opal-slim` gem (based on `opal-haml`) so I could use Slim templates instead. It blew my mind that it was possible, and I’d be glad to support the existence of gems that allow that in Clearwater, but I don’t think I want it inside Clearwater itself.

---

<div class="post-metadata">

**Author:** ![AstonJ](https://metaruby.com/user_avatar/metaruby.com/astonj/32/8_2.png) [@AstonJ](https://metaruby.com/u/AstonJ)\
**Post date:** [October 22, 2015, 6:18pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/24 "2015-10-22T18:18:13Z")

</div>

[![](https://metaruby.com/uploads/default/original/2X/f/f82696916348a9b543f73478fd2dfc9e7518c733.jpeg "10. ClearWater with Jamie Gaskins") ](https://www.youtube.com/watch?v=T3nInu1mpPM)

---

<div class="post-metadata">

**Author:** ![zw963](https://metaruby.com/user_avatar/metaruby.com/zw963/32/1060_2.png) [@zw963](https://metaruby.com/u/zw963)\
**Post date:** [July 23, 2017, 3:59pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/25 "2017-07-23T15:59:04Z")

</div>

me too~

---

<div class="post-metadata">

**Author:** ![danielpclark](https://metaruby.com/user_avatar/metaruby.com/danielpclark/32/823_2.png) [@danielpclark](https://metaruby.com/u/danielpclark)\
**Post date:** [July 24, 2017, 6:15pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/26 "2017-07-24T18:15:58Z")

</div>

On the whole brackets/templating issue I like to use the gem [arbre](https://github.com/activeadmin/arbre)

```ruby
html = Arbre::Context.new do
  h2 "Why is Arbre awesome?"

  ul do
    li "The DOM is implemented in ruby"
    li "You can create object oriented views"
    li "Templates suck"
  end
end

puts html.to_s # =>

```

```auto
<h2>Why is Arbre awesome?</h2>
<ul>
  <li>The DOM is implemented in ruby</li>
  <li>You can create object oriented views</li>
  <li>Templates suck</li>
</ul>

```

I haven’t tried this with Clearwater but with Ruby being Ruby I imagine it wouldn’t be hard to disable the existing HTML code gen code and just use arbre.

* * *

**UPDATE**

After watching a bit of the video Aston posted I see the code it has generates DOM nodes rather than HTML. ☹

---

<div class="post-metadata">

**Author:** ![alexblack10](https://metaruby.com/user_avatar/metaruby.com/alexblack10/32/1078_2.png) [@alexblack10](https://metaruby.com/u/alexblack10)\
**Post date:** [January 17, 2018, 5:36pm UTC](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121/28 "2018-01-17T17:36:19Z")

</div>

You will not regret using ember with your Rails app . Ror and node.js both scales very well with ember but i would prefer node if its a small to medium sized application while rails for large application.  
Its completely upto your style to choose from rails or node .

[Previous page](https://metaruby.com/t/clearwater-a-front-end-app-framework-in-ruby/121.md?page=1)
