documentom

35
OM @TAKUFUKUSHIMA

Upload: taku-fukushima

Post on 19-Aug-2014

3.343 views

Category:

Engineering


0 download

DESCRIPTION

This slides for 天下一クライアントサイドJS MV*フレームワーク武道会, which is the event about JavaScript MV* frameworks. http://connpass.com/event/6910/

TRANSCRIPT

Page 1: DocumentOm

OM@TAKUFUKUSHIMA

Page 2: DocumentOm
Page 3: DocumentOm

OM ADDS MORE VALUES TO REACT.JS

Page 4: DocumentOm

OM SWEET OM: (HIGH-)FUNCTIONAL FRONTEND ENGINEERING WITH

CLOJURESCRIPT AND REACT

Page 5: DocumentOm

CONCLUSION: SIMPLICITY WINS

Page 6: DocumentOm
Page 7: DocumentOm

PERFORMANCE

Page 8: DocumentOm
Page 9: DocumentOm

UNDOTHE BIGGEST

DIFFERENTIATOR OF OM

Page 10: DocumentOm

WHO DOES NEED UNDO ON THE CLIENT-SIDE?

Page 11: DocumentOm
Page 12: DocumentOm

SHIFT TO THE WEB TECHNOLOGIES

Page 13: DocumentOm
Page 14: DocumentOm
Page 15: DocumentOm
Page 16: DocumentOm

UNDO MADE EASY

Page 17: DocumentOm
Page 18: DocumentOm

ClojureScript was a big enabler.— David Nolen, Creator of Om

Page 19: DocumentOm

TIME TRAVEL;; Initial state.(def app-history (atom [@app-state]))

;; When the state is changed, it's added to the history.(add-watch app-state :history (fn [_ _ _ n] (when-not (= (last @app-history) n) (swap! app-history conj n)) (set! (.-innerHTML (.getElementById js/document "message")) (let [c (count @app-history)] (str c " Saved " (pluralize c "State"))))));; If the undo button is pressed, pop the state.(aset js/window "undo" (fn [e] (when (> (count @app-history) 1) (swap! app-history pop) (reset! app-state (last @app-history)))))

Page 20: DocumentOm

CLOJURESCRIPT ROCKS1. ClojureScript ecosystem

2. Macros3. Persistent data structures

Page 21: DocumentOm

1. CLOJURESCRIPT ECOSYSTEM

Page 22: DocumentOm

GOOD PARTS OF CLOJURESCRIPT▸ Clojure

▸ 3rd party libraries▸ Source Map

▸ Interop with JavaScript

Page 23: DocumentOm

2. MACROS

Page 24: DocumentOm

MACRO SAVES YOUR TIMECOMPILATION TIME META PROGRAMMING,

WHICH IS HARD IN JAVASCRIPT.▸ prismatic/om-tools

Page 25: DocumentOm

3. PERSISTENT DATA STRUCTURES

Page 26: DocumentOm
Page 27: DocumentOm
Page 28: DocumentOm
Page 29: DocumentOm

PERSISTENT DATA STRURCTURES ARE MEMORY EFFICIENT

Page 30: DocumentOm

GET UNDO NOW

Page 31: DocumentOm

WRAP-UPSIMPLICITY AND UNDO

Page 32: DocumentOm

THE END OF SLIDES; ANY QUESTION?

Page 33: DocumentOm

REFERENCES▸ Om sweet Om: (high-)functional frontend engineering

with ClojureScript and React - http://blog.getprismatic.com/om-sweet-om-high-functional-

frontend-engineering-with-clojurescript-and-react/▸ PrismaticEngineering Tweet - https://twitter.com/

PrismaticEng/status/478988034407276546▸ Vue.js Performance Comparisons - http://vuejs.org/

perf/

Page 34: DocumentOm

REFERENCES▸ IMMUTABILITY, INTERACTIVITY & JAVASCRIPT, Balcerona Future JS: http://futurejs.org/agenda/

immutability-interactivity-javascript▸ GoyaPixel - http://jackschaedler.github.io/goya/▸ Time Travel, dosync - http://swannodette.github.io/

2013/12/31/time-travel/▸ Adobe Photoshop.com - http://www.photoshop.com/

Page 35: DocumentOm

REFERENCES▸ Google Docs - https://docs.google.com/

▸ Atom - https://atom.io/▸ Git - http://git-scm.com/

Other pictures are distributed under © Taku Fukushima