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
50
Introduction to Clojure for Java Devs
pebrc
1
66
Other Decks in Programming
See All in Programming
プロンプトエンジニアリング入門
tomokusaba
2
990
Data Contracts In Practice With Debezium and Apache Flink (Kafka Summit London)
gunnarmorling
2
280
品質が高いコードって何?Rev2.1
ickx
1
490
ONE WEDGE_Company_Information
1wedge
0
180
とにかくHTTP3をライトニングに話す / Anyway, I'll talk to Lightning about HTTP3.
seike460
PRO
0
120
マイ隙間家具OSSたちのご紹介
karupanerura
2
160
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
350
オブジェクト指向コードレビューの新しいアプローチ
akkie76
3
1.6k
Introduction for Open Source Swift Workshop
giginet
PRO
0
290
AppDeveloperCon 2024 EU: Building polyglot developer experiences in 2024
salaboy
0
380
Laravel標準バリデーションでできること
hmb_ok
2
360
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
421
63k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
The Power of CSS Pseudo Elements
geoffreycrofte
58
4.9k
Web Components: a chance to create the future
zenorocha
304
41k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
Producing Creativity
orderedlist
PRO
335
39k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Music & Morning Musume
bryan
39
5.5k
The Cost Of JavaScript in 2023
addyosmani
13
3.7k
Building Adaptive Systems
keathley
29
1.8k
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