Drab: remote controlled frontend framework for Phoenix

I know phoenix is a great framework, I love it too.

But it it designed as a normal server side framework (api/regular).

Leveraging drab, we can build a framework that can replace any client side framework, at least in elixir world :slight_smile:.

The thing that always bothers me about client side frameworks is that you need server side rendering if you want to go for SEO or such. With this, we can eliminate it.

Anyway, you made it clear that you are not planning to add routing support to drab. End of discussion :slight_smile:.

Anyway, Is there an issue or todo list somewhere? I canā€™t seem to find one in repo or docs. Maybe I can help.

Opened issues are on github, todoā€¦ hmm there is a TODO.md on github, but not very consistent, I still use it as a scratchpad :wink:

Any help appreciated! Please take a look on CONTRIBUTING.md and README.md (for description how to run tests). Unfortunately, I couldnā€™t force phantomjs to work with Drab, so chromedriver is required for tests.

My bad, I did not see it! :smile:

Yeah, definitely Brad has to be the name for something Drab related. Maybe Drabā€™s evil twin. :laughing:

1 Like

Rather the gentle one! ā€œDrabā€ means thug, ruffian :slight_smile:

In English it means something thatā€™s a bit boring or ā€˜dullā€™, lacklustre even.

Lacking brightness or interest; drearily dull: the landscape was drab and grey | her drab suburban existence.

:101:

Yes, and this makes the name mysterious :slight_smile:

But the truth is I didnā€™t know the English meaning when I started this projectā€¦ :wink:

Must admit I always wondered why you chose it :lol:

3 Likes

The opposite of Drab is not Brad, itā€™s Bard. Which is cool too.

2 Likes

Omg you are right - my eyesight is going :043:

Bard is pretty cool. Some people in Wales say ā€˜bardā€™ when theyā€™re feeling bad (ill) :lol:

1 Like

Bard:
a poet, traditionally one reciting epics and associated with a particular oral tradition.

Shakespeare.
singular proper noun: Bard of Avon; noun: the Bard

1 Like

and from now on, also a tiny project Iā€™m working on haha.

3 Likes

itā€™s Polish, you could call a street thug ā€œdrabā€, although not in the face as he could return a punch.

2 Likes

Can be done.
It could look up for a drab-commander attribute in the parents tree (not only <div>, as I can imagine it would be useful also with <form>). If not found, it should use the default (resolved from the controller) one. Also, you may use drab-commander attribute directly in the tag with drab-event.

PS. Sorry for a late reply, was quite busy recently :slight_smile:

Would be awesome! ^.^

No worry, Iā€™ve been crazy-busy at work recently as well, plus Iā€™ve been watching you update to Elixir 1.5 support (I updated my Drab when you did that 24 minutes after your release ^.^).

1 Like

Hi there

A great thank for all your work, Drab is awesome ! :heart_eyes:

I got 2 questions on your library (sorry, Iā€™m quite a newbie here) :

  1. I kept using Haml on my templates since Rails, I guess I need to make a choice right now if I want to use Drab ?
  2. My plan is to initialize an html template from a controller, then to post back some datas through a Phoenix API (AJAX call) ; I would like to use Drab as a callback to this POST API : is there any way to trigger Drab from my controller ?

Reason of this is to keep my client playing with datas while being disconnectedā€¦

thanks for your help !

A couple of ways, mostly be embedding javascript to the page you are sending or so, but what are you trying to accomplish?

If you want to use Drab.Live (living assigns), yes. The eex engine is working only with html templates. It could be extended to use haml, anyway I have no plans to do it this days.
But, you probably (I did not test it) use the rest of of Drab modules - like Element or Query.

Theoretically yes (if you find a way to get an access to socket in the controller), but I canā€™t see the point of doing it. Drab is made for replace ajax calls. If you need to run some JS, you can always call Drab event handler from the client side, see Drab.Core ā€“ drab v0.10.5

1 Like

@grych Sooooo, about my PR and (not as important) other bug report and a new release with those? ^.^

Without my PR, Drab is not capable of being put into a mix release without crashing on load (why is testing code existing in the main codebase?!). :slight_smile:

This will be fixed in the next release, all about phoenix 1.3 compatibility. Pls be patient, I am doing it only in my spare time (not too much this days!)

1 Like