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
54
Introduction to Clojure for Java Devs
pebrc
1
69
Other Decks in Programming
See All in Programming
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
600
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
330
ドメインイベント増えすぎ問題
h0r15h0
2
540
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
200
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.1k
良いユニットテストを書こう
mototakatsu
11
3.5k
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
140
CloudflareStack でRAGに入門
asahiiwm
0
150
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
360
Androidアプリの One Experience リリース
nein37
0
740
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
790
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.5k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Practical Orchestrator
shlominoach
186
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Code Review Best Practice
trishagee
65
17k
Faster Mobile Websites
deanohume
305
30k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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