Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Om/React.js/Clojurescript: An introduction
Search
Peter Brachwitz
May 21, 2014
Programming
1
290
Om/React.js/Clojurescript: An introduction
An introduction to Om/React.js/ClojureScript
Peter Brachwitz
May 21, 2014
Tweet
Share
More Decks by Peter Brachwitz
See All by Peter Brachwitz
Core.async
pebrc
0
52
Introduction to Clojure for Java Devs
pebrc
1
68
Other Decks in Programming
See All in Programming
LangChainの現在とv0.3にむけて
os1ma
4
920
Shinjuku.rb#95:心の技術書紹介
free_world21
1
110
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
マイグレーションコード自作して File-Based Routing に自動移行!! ~250 ページの歴史的経緯を添えて~
cut0
1
260
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
580
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
130
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
From Idea to IDE: Developing Plugins for Android Studio
thisaay
1
220
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
990
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
270
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
610
Featured
See All Featured
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
Into the Great Unknown - MozCon
thekraken
29
1.4k
Typedesign – Prime Four
hannesfritz
39
2.3k
Making Projects Easy
brettharned
113
5.8k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Fontdeck: Realign not Redesign
paulrobertlloyd
80
5.1k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
4 Signs Your Business is Dying
shpigford
179
21k
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
GitHub's CSS Performance
jonrohan
1030
450k
Transcript
OM AN INTRODUCTION / Peter Brachwitz @p_brc
WHAT? ... WHY? A new way of building web UIs
using Facebook's new React.js library ... but in ClojureScript with added "functional" benefits.
PARTIES INVOLVED 1. ClojureScript 2. React.js 3. Om
CLOJURESCRIPT A Clojure compiler that emits JavaScript code
Its output can be optimized with Google's Closure compiler
ALL OF CLOJURE? Almost. Excluded are the bits that don't
make sense in a JavaScript environment.
THINGS THAT WON'T WORK: Concurrency : Refs, Agents Data types:
BigDecimal, BigInteger, Ratio Host (Java, CLR) IO related things: *out* Full list of differences on GitHub
REACT.JS? A JavaScript library for building user interfaces
MVC? No.
MVP? No.
MVVM? No.
SIMPLE Just the view. No models. No controllers.
REACTIVE Data flow into the UI
FAST Let v be a virtual DOM dif f (
, ) = Δ v 0 v 1
WHY? JavaScript is fast DOM mutation is slow Minimize DOM
mutation and gain performance
OM A ClojureScript interface to React.js written by David Nolen
IMMUTABLE, PERSISTENT DATA STRUCTURES Snapshots, Undo, efficient rendering
xs d b g a c f h ys d'
g' f' e Source http://en.wikipedia.org/wiki/File:Purely_functional_tree_after.svg
TYPICALLY: CENTRALIZED APPLICATION STATE Using Clojure's atom (CAS) and om's
transact!
NO (VIEW) MODELS Cursors into global application state
LET'S LOOK AT SOME CODE!
SOURCES Om on Github Basic Om Tutorial React on Github
Comparing JavaScript and ClojureScript A ClojureScript tutorial by David Nolen