Are you jealous of how quickly your Javascript friends can whip up front-end Single Page Applications? Confused about React, Angular, Vue, and all that other nonsense? You don't need any of that to rapidly build reactive, responsive, usable, performant, and easy-to-iterate on web applications. Come learn how to build the whole thing without leaving the comfort of Elixir or the Server. Look Ma!
Github: https://github.com/ijcd/presto
Twitter: @ijcd
San Francisco, California
SPEAKER NOTES:
-------------
Why a front-end and a back-end? Can't I just stay in Elixir? Can't I just stay on the server? Why can't my UI just be a projection of my database?
We have to invent the future we want.
I’d felt uneasy about working in Rails. Something just didn't feel right.
Found Uncle Bob's "Screaming Architecture" series. Yes, this is what I was missing. I was being blinded by my framework.
Looking back, it seems to me that Rails ruined a generation of programmers.
Feature folders.
Context switching is painful for me. I want to stay in Elixir, even for HTML.
I set out to fix this, somehow.
1. Simple Elixir-based generation of tag-based markup.
2. Interoperate properly with Phoenix helpers.
I created Taggart - HTML as Elixir.
You can embed Taggart inside Phoenix helpers. You can use Phoenix helpers intermingled with Taggart.
https://github.com/ijcd/taggart
Now I need widgets.
I wrapped UIKit.
https://github.com/ijcd/uikit_ex https://github.com/ijcd/uikit_ex
https://github.com/ijcd/uikit_ex https://github.com/ijcd/uikit_demo
Front-end now... jQuery, Ember, Angular, React, Om/Clojurescript.
Can we just get rid of the whole client side?
Unpoly.js
Replaces fragments of a page in place. Transitions are very smooth. It feels like a client application.
I want:
1. views as a projection of data
2. simplicity of Elm's model/update/render
3. completely in elixir (minimal javascript)
Model. Update. View.
State. Message. Response.
That sounds an awful lot like a GenServer... and we have Channels... and we have this Unpoly thing...
What if I took GenServers, connected with Channles, sent DOM events over the channels, sent views back?
GenServer birthed on first user request. Receives DOM events, updates state, renders HTML back through channel.
DynamicSupervisor to manage GenServers.
You reference your component from your layout or an index.html.eex or whatever.
use Presto.Page
def initial_model
def update
def render
Lovely microsecond-level responses from Phoenix.
It works in Electron.
Testing is easy -- it's just a GenServer.
Growing your app is simple. Expand render() and update() with helpers.