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
68
Other Decks in Programming
See All in Programming
Amazon Qを使ってIaCを触ろう!
maruto
0
420
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
デザインパターンで理解するLLMエージェントの作り方 / How to develop an LLM agent using agentic design patterns
rkaga
3
400
受け取る人から提供する人になるということ
little_rubyist
0
250
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
3
1.2k
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
180
Better Code Design in PHP
afilina
PRO
0
130
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
1
110
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
710
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
BBQ
matthewcrist
85
9.3k
Optimizing for Happiness
mojombo
376
70k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Navigating Team Friction
lara
183
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Rails Girls Zürich Keynote
gr2m
94
13k
Docker and Python
trallard
40
3.1k
KATA
mclloyd
29
14k
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