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 .
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 .
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
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.
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
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 ^.^).
A great thank for all your work, Drab is awesome !
I got 2 questions on your library (sorry, Iām quite a newbie here) :
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 ?
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ā¦
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
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!)