11

Click here to load reader

How I build Textik or another way to design a front-end web app

Embed Size (px)

DESCRIPTION

The approach which I used to design http://textik.com, using ClojureScript, React and Quiescent.

Citation preview

Page 1: How I build Textik or another way to design a front-end web app

How I built TextikOr another way to design a front-end web application

Page 2: How I build Textik or another way to design a front-end web app

Textik

Page 3: How I build Textik or another way to design a front-end web app

Usual design of web front-end apps

View Model 1

View Model 4

View Model 3

View Model 2

View 3

View 4

View 2

View 1

Page 4: How I build Textik or another way to design a front-end web app

Works great, but..

In case of exception it’s hard to figure out what happened

Many inputs, many code paths

Page 5: How I build Textik or another way to design a front-end web app

The synchronous design

{:foo  “bar”    :bla  “bla”    …}    

View

Mutators

Rendering

Events

Change data

Global State

Page 6: How I build Textik or another way to design a front-end web app

Works great, and..

We have only one global code path

We have a full state of the app, when bad things happen

Page 7: How I build Textik or another way to design a front-end web app

ReactNot really handy to use raw React from ClojureScript

• Om • Quiescent • Reagent

Quiescent

Page 8: How I build Textik or another way to design a front-end web app

Quiescent• Very lightweight• Simple to use• Opinionless

Cons:

• Slowly developing• Has bugs fixed in Om

Page 9: How I build Textik or another way to design a front-end web app

The lifecycle

Init!! Call render

View!!

Render Send payload to channel

Mutators!!

Change dataData

Dispatch!!

Listen to channel Call mutators Call render

via core.async channel

Page 10: How I build Textik or another way to design a front-end web app

How cool is that?!!

Page 11: How I build Textik or another way to design a front-end web app

Textik http://textik.com

Textik - source code https://github.com/astashov/tixi

Quiescent https://github.com/levand/quiescent

Links

Mintik - minimal app uses the described architecture https://github.com/astashov/mintik