-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
1309 lines (1274 loc) · 65.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Case for React.js and ClojureScript</title>
<meta name="description" content="Sonian Tech Talk presentation given on may 2, 2014">
<meta name="author" content="Murilo Pereira">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-id="e44f1a82f2b9dbf4579683a24c39f9a8" class="">
<h2>The Case for</h2>
<h1>React.js and ClojureScript</h1>
<p>
<br>
</p>
<p align="center">Murilo Pereira</p>
<p align="center">
<a target="_blank" href="https://twitter.com/mpereira">@mpereira</a>
</p>
<p align="center">May 2, 2014<br>
</p>
</section>
<section data-id="c3a7395387083933476c1a4e6ac4813e" class="">
<h1>Problem</h1>
</section>
<section data-background-color="rgba( 200, 50, 30, 0.6 )" data-id="42bc3956a9dd6110352ed01e9c321452" class="">
<h1>Building UIs is difficult.<br>
</h1>
</section>
<section data-id="e092c27bcc271643bec578804f32ffdd" class="">
<h2 align="center">Modern Web UIs</h2>
<p align="left">
<br>
</p>
<div align="center">
<ul>
<li>
<font style="font-size: 32px;">visual representations of data changing over time</font>
</li>
<li>
<font style="font-size: 32px;">respond to asynchronous user events</font>
</li>
<li>
<font style="font-size: 32px;">transition both the underlying data and itself to new states<br>
</font>
</li>
</ul>
</div>
</section>
<section data-id="e88cee679de2acbb2dbb31a70496a711" class="">
<h2>"Data changing over time is the root of all evil."</h2>
</section>
<section data-id="ae2688dadb8f312f0404fa07e8738b0d" class="">
<h2 align="center">Incidental Complexity</h2>
<p>
<br>
</p>
<div align="center">
<ul>
<li>JavaScript isn't <a target="_blank" href="http://en.wikipedia.org/wiki/Reactive_programming">reactive</a>
</li>
<li>DOM is stateful<br>
</li>
</ul>
</div>
</section>
<section data-id="1313aa1ceabe7df2fe9b7f15b8c7739e" class="">
<h2>What if the JavaScript DOM API was reactive?<br>
</h2>
</section>
<section data-id="50de3e65493eb22def41afd830f33cbb" class="">
<pre class="stretch"><code data-trim>
function tweetScore(tweet) {
return(tweet.favorites_count + tweet.retweets_count);
}
function compareTweetsByScore(a, b) {
return(tweetScore(b) - tweetScore(a));
}
function renderApplication(tweets) {
return(document.dom.ul(
{ class: 'tweets' },
tweets
.sort(compareTweetsByScore)
.slice(0, 5)
.map(function(tweet) {
return(document.dom.li({ class: 'tweet' }, tweet.text);
})
));
}
var tweets = fetchTweets({ username: 'mpereira' }, { limit: 20 });
document.dom.render(renderApplication(tweets), document.body);
</code></pre>
<br>
</section>
<section data-id="2ed2e2ffce8a42c6ecd0edb738af2436" class="">
<h2>Possible solution: Data binding<br>
</h2>
</section>
<section data-id="f7cf6a30000cde576ad5042a2c92786a" class="">
<h2 align="center">Data Binding</h2>
<p align="center">
<br>
</p>
<div align="left">
<div align="center">
<ul>
<li>Observables</li>
<li>Computed properties</li>
</ul>
</div>
<p align="center">
<br>
</p>
<p align="center">Backbone, Ember, Meteor, et al.<br>
</p>
</div>
</section>
<section data-id="53891e575a4caff5738cf91c0a433c88" class="">
<h2>Contemporary data binding is not simple.<br>
</h2>
</section>
<section data-id="2513fb9d520d57e393d9e58519072da6" class="">
<h2>Simple</h2>
<p>
<br>
</p>
<p>Not to be mistaken for "easy"</p>
<p>
<br>
</p>
<p>Easiness = Familiarity (subjective)</p>
<p>
<br>
</p>
<p>Simplicity = "Does/is one thing" (objective)<br>
</p>
</section>
<section data-id="4ff2082fc4df4e824161d5c8314f6c49" class="">
<h2 align="center">Data Binding</h2>
<p align="center">
<br>
</p>
<div align="left">
<div align="center">
<ul>
<li>Application logic entangled with observables</li>
<li>Forces us to compose our programs with framework constructs instead of language constructs (functions and data structures)<br>
</li>
</ul>
</div>
</div>
</section>
<section data-id="7dfacd1418ee0eecb5dd7f56fa492509" class="">
<h2>"How often are you fighting the framework?"<br>
</h2>
</section>
<section data-id="e4e203af88bcef59e75456c9443b21c1" class="">
<h2>Dirty-checking (Angular)</h2>
<p>
<br>
</p>
<p>Also susceptible to the problems of data binding.<br>
</p>
</section>
<section data-background-color="rgba( 200, 50, 30, 0.6 )" data-background-size="initial" data-background-image="https://s3.amazonaws.com/media-p.slid.es/uploads/mpereira/images/377518/AngularJS__Developer_Guide__Conceptual_Overview_-_Pentadactyl.png" data-id="b266327c77884cb5ee7a46927d9df4ee" class="">
<h2>
<br>
</h2>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
<span style="background-color: transparent;">
<font color="#000000">
<a target="_blank" href="https://docs.angularjs.org/guide/concepts">
<br>
</a>
</font>
</span>
</p>
<p style="position: absolute; width: 417px; height: 47px; z-index: 4; left: 489px; top: 582px;" class="absolute-element" align="right">
<span style="background-color: transparent;">
<font color="#000000">
<a target="_blank" href="http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey">
<font style="font-size: 24px;">https://docs.angularjs.org/guide/concepts</font>
</a>
</font>
</span>
<br>
</p>
</section>
<section data-background-color="rgba( 200, 50, 30, 0.6 )" data-id="87b083471d09e25555e844d2ca0fbfb5" class="">
<h1>Complex<br>
</h1>
</section>
<section data-id="fbb0945d731ea533a05ba6cd8e5236fd" class="">
<h2>Even with shortcomings it's still possible to build complex, modern UIs using contemporary MVC frameworks.<br>
</h2>
</section>
<section data-id="0626842efb5bf5164f4f7bad85b39015" class="">
<h2>"We can create precisely the same programs we're creating right now with drastically simpler tools."</h2>
<p>Rich Hickey<br>
</p>
</section>
<section data-id="d73751f69709b6ae5c7fc8ad1b177efd" class="">
<h2>A different solution to the same problem.<br>
</h2>
</section>
<section data-id="03fd5bb03aa5fb60c5d0a2d4da1952bd" class="">
<h1>React.js<br>
</h1>
</section>
<section data-id="02e9161793b6f2aa06e941606d701326" class="">
<h2>React.js</h2>
<p>
<br>
</p>
<ul>
<li>Library for creating UIs</li>
<li>Renders the DOM and responds to user events</li>
<li>Can be thought of as the V in MVC<br>
</li>
</ul>
<br>
</section>
<section data-id="752e63296672b5255309d3bb309812b1" class="">
<h2>Remember our utopic example a few slides back?<br>
</h2>
</section>
<section data-id="a9ec2af34b842e748fbb857504a97df0" class="">
<pre class="stretch"><code data-trim>
function tweetScore(tweet) {
return(tweet.favorites_count + tweet.retweets_count);
}
function compareTweetsByScore(a, b) {
return(tweetScore(b) - tweetScore(a));
}
function renderApplication(tweets) {
return(document.dom.ul(
{ class: 'tweets' },
tweets
.sort(compareTweetsByScore)
.slice(0, 5)
.map(function(tweet) {
return(document.dom.li({ class: 'tweet' }, tweet.text);
})
));
}
var tweets = fetchTweets({ username: 'mpereira' }, { limit: 20 });
document.dom.render(renderApplication(tweets), document.body);
</code></pre>
<br>
</section>
<section data-id="7b58f7d8417017e8643e66427ac2dcb3" class="">
<h2>It's actually valid React.js code<br>
</h2>
</section>
<section data-id="193c8b72a2ddbcb5d6bc70b014bd3859" class="">
<pre class="stretch"><code data-trim>
function tweetScore(tweet) {
return(tweet.favorites_count + tweet.retweets_count);
}
function compareTweetsByScore(a, b) {
return(tweetScore(b) - tweetScore(a));
}
function renderApplication(tweets) {
return(React.DOM.ul(
{ className: 'tweets' },
tweets
.sort(compareTweetsByScore)
.slice(0, 5)
.map(function(tweet) {
return(React.DOM.li({ className: 'tweet' }, tweet.text);
})
));
}
var tweets = fetchTweets({ username: 'mpereira' }, { limit: 20 });
React.renderComponent(renderApplication(tweets), document.body);
</code></pre>
<br>
</section>
<section data-id="c70790be90fc9f3ac984aa5936ae345e" class="">
<h2>React gives us a minimally leaky abstraction for a reactive JavaScript/DOM environment.<br>
</h2>
</section>
<section data-id="a10444c09066d32b7424449c6f487961" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="143px" height="333px" version="1.1">
<defs>
</defs>
<g transform="translate(0.5,0.5)">
<rect x="1" y="1" width="140" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="1" y="131" width="140" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="1" y="271" width="140" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="31" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="71" y="41">Data</text>
</g>
<rect x="31" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="71" y="171">Component</text>
</g>
<rect x="31" y="281" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="71" y="311">DOM</text>
</g>
<path d="M 71 61 L 71 125" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 71 130 L 68 123 L 71 125 L 75 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 71 191 L 71 265" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 71 270 L 68 263 L 71 265 L 75 263 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
</g>
</svg>
</section>
<section data-id="3e5a569eb35a90e67af8374db5bf524d" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="123px" height="323px" version="1.1">
<defs>
</defs>
<g transform="translate(0.5,0.5)">
<rect x="1" y="1" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="1" y="131" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="1" y="261" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="21" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="61" y="41">Model</text>
</g>
<rect x="21" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="61" y="171">View</text>
</g>
<rect x="21" y="271" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="61" y="301">DOM</text>
</g>
<path d="M 41 67 L 41 131" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 41 62 L 45 69 L 41 67 L 38 69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 41 197 L 41 261" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 41 192 L 45 199 L 41 197 L 38 199 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 81 255 L 81 191" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 81 260 L 78 253 L 81 255 L 85 253 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 81 125 L 81 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 81 130 L 78 123 L 81 125 L 85 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
</g>
</svg>
</section>
<section data-id="1c723d87e89cf6ffb43fc66c63e8eaed" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="443px" height="323px" version="1.1">
<defs>
</defs>
<g transform="translate(0.5,0.5)">
<rect x="191" y="1" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="191" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="161" y="261" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="181" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="221" y="41">M3</text>
</g>
<rect x="181" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="221" y="171">V2</text>
</g>
<rect x="181" y="271" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="221" y="301">DOM</text>
</g>
<path d="M 201 67 L 201 131" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 201 62 L 205 69 L 201 67 L 198 69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 201 197 L 201 261" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 201 192 L 205 199 L 201 197 L 198 199 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 241 255 L 241 191" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 241 260 L 238 253 L 241 255 L 245 253 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 241 125 L 241 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 241 130 L 238 123 L 241 125 L 245 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<rect x="101" y="1" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="91" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="131" y="41">M2</text>
</g>
<rect x="281" y="1" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="271" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="311" y="41">M4</text>
</g>
<rect x="371" y="1" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="361" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="401" y="41">M5</text>
</g>
<rect x="11" y="1" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="1" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="41" y="41">M1</text>
</g>
<rect x="101" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="91" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="131" y="171">V1</text>
</g>
<rect x="281" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="271" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="311" y="171">V3</text>
</g>
<path d="M 68 61 L 127 126" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 130 130 L 123 127 L 127 126 L 128 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 104 131 L 45 66" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 42 62 L 49 65 L 45 66 L 44 69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 131 67 L 131 131" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 131 62 L 135 69 L 131 67 L 128 69 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 146 125 L 146 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 146 130 L 143 123 L 146 125 L 150 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 151 127 L 236 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 147 130 L 150 123 L 151 127 L 155 129 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 331 127 L 416 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 327 130 L 330 123 L 331 127 L 335 129 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 296 131 L 381 65" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 385 62 L 382 69 L 381 65 L 377 63 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 241 127 L 326 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 237 130 L 240 123 L 241 127 L 245 129 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 290 128 L 146 61" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 295 131 L 287 131 L 290 128 L 290 124 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 121 195 L 191 261" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 117 192 L 124 194 L 121 195 L 120 199 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 146 191 L 216 257" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 220 260 L 213 258 L 216 257 L 217 253 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 291 195 L 221 261" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 295 192 L 292 199 L 291 195 L 288 194 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 321 195 L 251 261" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 325 192 L 322 199 L 321 195 L 318 194 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
</g>
</svg>
</section>
<section data-id="b545e5046c8f0de906e19c6a2d28e4c0" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="453px" height="333px" version="1.1">
<defs>
</defs>
<g transform="translate(0.5,0.5)">
<rect x="1" y="104" width="450" height="118" fill="#ffffff" stroke="#c4c4c4" stroke-dasharray="3 3" pointer-events="none">
</rect>
<rect x="161" y="1" width="140" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="201" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="161" y="271" width="140" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="191" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="231" y="41">Data</text>
</g>
<rect x="191" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="231" y="171">C3</text>
</g>
<rect x="191" y="281" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="231" y="311">DOM</text>
</g>
<path d="M 231 61 L 231 125" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 130 L 228 123 L 231 125 L 235 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 191 L 231 265" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 270 L 228 263 L 231 265 L 235 263 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<rect x="281" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="271" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="311" y="171">C4</text>
</g>
<rect x="121" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="111" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="151" y="171">C2</text>
</g>
<rect x="361" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="351" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="391" y="171">C5</text>
</g>
<rect x="41" y="131" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none">
</rect>
<rect x="31" y="141" width="80" height="40" fill="none" stroke="none" pointer-events="none">
</rect>
<g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="24px">
<text x="71" y="171">C1</text>
</g>
<path d="M 231 61 L 77 128" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 72 131 L 77 125 L 77 128 L 80 131 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 61 L 156 127" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 152 130 L 155 123 L 156 127 L 159 128 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 61 L 306 127" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 310 130 L 303 128 L 306 127 L 307 123 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 61 L 385 128" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 390 131 L 382 131 L 385 128 L 385 125 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 71 191 L 225 268" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 230 271 L 222 271 L 225 268 L 225 264 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 151 191 L 226 266" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 230 270 L 223 268 L 226 266 L 228 263 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 231 191 L 231 271" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 311 191 L 236 266" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 232 270 L 234 263 L 236 266 L 239 268 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 391 191 L 237 268" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
<path d="M 232 271 L 237 264 L 237 268 L 240 271 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none">
</path>
</g>
</svg>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="b02408cb63ffd598446e936bcedbc223" class="">
<h1>Components<br>
</h1>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="22ebc0db90c6dbc1fac20f4b64a7ba89" class="">
<h2>Components</h2>
<p>
<br>
</p>
<p>
<font style="font-size: 54px;">Idempotent functions that describe your UI at any point in time</font>.<br>
</p>
</section>
<section data-id="73e6923b7d85cd045e0f59cca362dd6e" class="">
<font style="font-size: 54px;">component(data) = VDOM</font>
<br>
</section>
<section data-id="817b092ae309e09adbe958d8887888b5" class="">
<h4>component(data_1) = VDOM_1</h4>
<br>
<p>*user input changes data from data_1 to data_2*</p>
<br>
<h4>component(data_2) = VDOM_2</h4>
<h4>diffVDOMs(VDOM_1, VDOM_2) = diff</h4>
<h4>DOMOperations(diff) = operations</h4>
<h4>applyDOMOperations(operations, document.body)</h4>
</section>
<section data-id="91c6d53e557c26355c03b2fdd3096214" class="">
<h2>Best part? You don't even have to worry about this. Just build components.<br>
</h2>
</section>
<section data-id="a275cbe8f8b512a8fc0b804ed85700be" class="">
<h2>Every place data is displayed is guaranteed to be up-to-date. <br>
</h2>
<h2>
<br>
</h2>
<h2>No need for KVO or marking HTML templates with framework directives.<br>
</h2>
</section>
<section data-id="20eea248791c06ab1cdf60c1cd001301" class="">
<h2>Frees the programmer from doing manual, explicit DOM operations.<br>
</h2>
</section>
<section data-id="215b2c5febebce2ff6fee53d1d66e150" class="">
<h2>But what about the performance?</h2>
<h2>
<br>
</h2>
<h2>Isn't diffing VDOMs slow?</h2>
<p>
<br>
</p>
<h2>Why have VDOMs if the browser already has a DOM?<br>
</h2>
</section>
<section data-background-color="rgba( 200, 50, 30, 0.6 )" data-id="35d89cf6c35b8c0af6f99f3eb8056f05" class="">
<h1>The DOM is slow.<br>
</h1>
</section>
<section data-id="a36ce73b7106553813a551e787051d5d" class="">
<h2>The DOM is slow</h2>
<p>
<br>
</p>
<ul>
<li>Querying may require tree traversal</li>
<li>Mutations trigger viewport reflows, relayouts, repaints (CSS engine, etc.)</li>
<li>Can also invalidate caches, requiring the entire DOM to be reconstructed on the viewport<br>
</li>
</ul>
</section>
<section data-id="95c82e0c34a28bf7a656a703d6576d7e" class="">
<h2>Having in-memory representations of the DOM allows React to have extremely fast UIs.<br>
</h2>
</section>
<section data-id="70957b05e4fa5a6a79ad48726bcdef37" class="">
<h2>Virtual DOM (VDOM)</h2>
<p>
<br>
</p>
<ul>
<li>Allows for components to have a declarative API</li>
<li>Performs the minimum amount of actual DOM operations through computing diffs</li>
<li>Handles DOM operations for you</li>
</ul>
</section>
<section data-id="291ca650278b0dc2c44f36ead4e3712a" class="">
<h2>"Performance isn't the [main] goal of the VDOM, but if you're worried with performance, most workloads are as fast or faster [than the MVC alternatives] out of the box."</h2>
<p>Pete Hunt<br>
</p>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="d389399c0e28ce37bfbad678ef5ac64a" class="">
<h1>Components<br>
</h1>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="2f0548eee43e6859191606376452c477" class="">
<h2>Components allow you to express your program in the language of your problem domain.</h2>
<p>
<br>
</p>
<h2>Rather than on the language of a particular framework.<br>
</h2>
</section>
<section data-id="1055cdfa054406718dc7e48759b92390" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="203px" height="403px" version="1.1"><defs/><g transform="translate(0.5,0.5)"><rect x="1" y="1" width="200" height="400" rx="25" ry="25" fill="#ffffff" stroke="#c0c0c0" pointer-events="none"/><rect x="14" y="61" width="175" height="280" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="14" y="61" width="175" height="280" fill="none" stroke="#c0c0c0" pointer-events="none"/><ellipse cx="101" cy="20" rx="2.5" ry="2.5" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="76" y="31" width="50" height="8" rx="4" ry="4" fill="none" stroke="#c0c0c0" pointer-events="none"/><ellipse cx="101" cy="371" rx="20" ry="20" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="93" y="363" width="17" height="18" rx="3" ry="3" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="31" y="106" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none"/><ellipse cx="61" cy="117" rx="6.25" ry="6.25" fill="#ffffff" stroke="#000000" pointer-events="none"/><path d="M 61 124 L 61 144 M 61 128 L 49 128 M 61 128 L 74 128 M 61 144 L 49 161 M 61 144 L 74 161" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="101" y="101" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="141" y="125">Bill O'Reilly</text></g><rect x="31" y="181" width="140" height="50" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,184)"><switch><foreignObject pointer-events="all" width="136" height="45" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Tide comes in, tide goes out. You can't explain that!</div></foreignObject><text x="68" y="29" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="61" y="61" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="14px"><text x="101" y="86">Top Tweets</text></g><rect x="31" y="231" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,239)"><switch><foreignObject pointer-events="all" width="136" height="15" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Just had #breakfast.</div></foreignObject><text x="68" y="14" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="261" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,261)"><switch><foreignObject pointer-events="all" width="136" height="30" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">@troll yes, definitely plan on that.</div></foreignObject><text x="68" y="21" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="291" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,291)"><switch><foreignObject pointer-events="all" width="136" height="30" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">pic.twitter.com/asd23 #selfie #instagram</div></foreignObject><text x="68" y="21" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="321" width="140" height="20" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,324)"><switch><foreignObject pointer-events="all" width="136" height="15" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Good# morning.</div></foreignObject><text x="68" y="14" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></g></svg>
</section>
<section data-id="d1b958c43d39993d467b855f0f700b5f" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="353px" height="433px" version="1.1"><defs/><g transform="translate(0.5,0.5)"><rect x="231" y="1" width="120" height="320" fill="#ffffff" stroke="#000000" pointer-events="none"/><rect x="1" y="31" width="200" height="400" rx="25" ry="25" fill="#ffffff" stroke="#c0c0c0" pointer-events="none"/><rect x="14" y="91" width="175" height="280" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="14" y="91" width="175" height="280" fill="none" stroke="#c0c0c0" pointer-events="none"/><ellipse cx="101" cy="50" rx="2.5" ry="2.5" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="76" y="61" width="50" height="8" rx="4" ry="4" fill="none" stroke="#c0c0c0" pointer-events="none"/><ellipse cx="101" cy="401" rx="20" ry="20" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="93" y="393" width="17" height="18" rx="3" ry="3" fill="none" stroke="#c0c0c0" pointer-events="none"/><rect x="21" y="131" width="160" height="70" rx="11" ry="11" fill="#ffffff" stroke="#786c74" stroke-dasharray="3 3" pointer-events="none"/><rect x="101" y="131" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="141" y="155">Bill O'Reilly</text></g><rect x="31" y="136" width="60" height="60" fill="#ffffff" stroke="#000000" pointer-events="none"/><ellipse cx="61" cy="147" rx="6.25" ry="6.25" fill="#ffffff" stroke="#000000" pointer-events="none"/><path d="M 61 154 L 61 174 M 61 158 L 49 158 M 61 158 L 74 158 M 61 174 L 49 191 M 61 174 L 74 191" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="21" y="96" width="160" height="30" rx="5" ry="5" fill="#ffffff" stroke="#786c74" stroke-dasharray="3 3" pointer-events="none"/><rect x="61" y="91" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="14px"><text x="101" y="116">Top Tweets</text></g><rect x="21" y="206" width="160" height="175" rx="24" ry="24" fill="#ffffff" stroke="#786c74" stroke-dasharray="3 3" pointer-events="none"/><rect x="31" y="211" width="140" height="50" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,214)"><switch><foreignObject pointer-events="all" width="136" height="45" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Tide comes in, tide goes out. You can't explain that! #tides</div></foreignObject><text x="68" y="29" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="261" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,269)"><switch><foreignObject pointer-events="all" width="136" height="15" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Just had #breakfast.</div></foreignObject><text x="68" y="14" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="291" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,291)"><switch><foreignObject pointer-events="all" width="136" height="30" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">@troll yes, definitely plan on that.</div></foreignObject><text x="68" y="21" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="321" width="140" height="30" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,321)"><switch><foreignObject pointer-events="all" width="136" height="30" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">pic.twitter.com/asd23 #selfie #instagram</div></foreignObject><text x="68" y="21" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="31" y="351" width="140" height="20" fill="#ffffff" stroke="#000000" pointer-events="none"/><g transform="translate(33,354)"><switch><foreignObject pointer-events="all" width="136" height="15" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 136px; white-space: normal; text-align: center;">Good# morning.</div></foreignObject><text x="68" y="14" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="241" y="86" width="100" height="45" fill="#ffffff" stroke="#000000" pointer-events="none"/><rect x="251" y="91" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="14px"><text x="291" y="116">Header</text></g><path d="M 181 111 L 249 111" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 243 115 L 250 111 L 243 108" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="241" y="144" width="100" height="45" fill="#ffffff" stroke="#000000" pointer-events="none"/><rect x="241" y="266" width="100" height="45" fill="#ffffff" stroke="#000000" pointer-events="none"/><rect x="251" y="146" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="14px"><text x="291" y="171">Profile</text></g><path d="M 181 166 L 249 166" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 243 170 L 250 166 L 243 163" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="251" y="271" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="14px"><text x="291" y="296">Tweets</text></g><path d="M 181 292 L 249 292" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 243 295 L 250 292 L 243 288" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="251" y="11" width="80" height="40" fill="none" stroke="none" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="291" y="35">Top Tweets</text></g></g></svg>
</section>
<section data-id="2d57b03ddf8663ad026d1fd661af98ac" class="">
<pre class="stretch"><code data-trim>
var Profile = React.createClass({
render: function() {
return(React.DOM.div(null, [
React.DOM.img(null, this.props.user.image),
React.DOM.p(null, this.props.user.name)
]);
}
});
var Tweets = React.createClass({
render: function() {
return(React.DOM.ul(null, this.props.tweets.map(function(tweet) {
return(React.DOM.li(null, tweet.text));
});
}
});
var TopTweets = React.createClass({
render: function() {
return(React.DOM.div(null, [
React.DOM.h1(null, 'Top Tweets'),
Profile({ user: this.props.user }),
Tweets({ tweets: this.props.user.tweets })
]);
}
});
React.renderComponent(TopTweets({ user: user }), document.body);
</code></pre>
<br>
</section>
<section data-id="265a7f9d3839d07f4995ce5b877fb6b8" class="">
<pre class="stretch"><code data-trim>
var Profile = React.createClass({
render: function() {
return(
<div>
<img href={this.props.user.image} />
<p>{this.props.user.name}</p>
</div>
);
}
});
var Tweets = React.createClass({
render: function() {
return(
<ul>
{this.props.tweets.map(function(tweet) {
return(<li>tweet.text</li>);
})};
</ul>
);
}
});
var TopTweets = React.createClass({
render: function() {
return(
<div>
<h1>Top Tweets</h1>
<Profile user={this.props.user} />
<Tweets tweets={this.props.user.tweets} />
</div>
);
}
});
React.renderComponent(TopTweets({ user: user }), document.body);
</code></pre>
<br>
</section>
<section data-id="1127009cee25585f1c40b98953c3a24c" class="">
<h4>TopTweets(data) = Header() + Profile(data_1) + Tweets(data_2)</h4>
</section>
<section data-id="ce2055cd0d8921d01c5714e7c895511c" class="">
<h2>Components are reusable and composable declarative representations of your UI.<br>
</h2>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="4880ed3859df370285cc4855c3ea82d8" class="">
<h1>Collateral Benefits<br>
</h1>
</section>
<section data-id="71e2974f0c6a12d9f3a8a2fbbe274c41" class="">
<h2>Collateral Benefits</h2>
<p>
<br>
</p>
<ul>
<li>Render the application on the server (node.js, Java 8's Nashhorn, etc.)</li>
<li>Run the entire application in a Web Worker</li>
<li>Render the VDOM to Canvas, SVG, etc.</li>
<li>UI testability for free</li>
<li>No templates!<br>
</li>
</ul>
</section>
<section data-background-color="rgba( 50, 200, 90, 0.4 )" data-id="8ddab5786f3eb5aa576041f26a4ce0c9" class="">
<h2>React.js takeaways</h2>
<ul>
<li>Declarative, fast UIs</li>
<li>Express your programs in the language of your problem domain<br>
</li>
</ul>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="cd5d4434b6a4fe659a851c2a17701571" class="">
<h1>ClojureScript<br>
</h1>
</section>
<section data-background-color="rgba( 200, 50, 30, 0.6 )" data-id="b59ae1ffc1cab7012a52db25e78ad76f" class="">
<h1>
<a target="_blank" href="http://www.haskell.org/haskellwiki/The_JavaScript_Problem">Problem</a>
</h1>
<p>
<br>
</p>
<p>
<br>
</p>
<p data-fragment-index="0" class="fragment">
<font style="font-size: 42px;">JavaScript sucks</font>
</p>
<p data-fragment-index="0" class="fragment">
<br>
</p>
<p data-fragment-index="1" class="fragment">
<font style="font-size: 42px;">We need JavaScript</font>
</p>
</section>
<section data-id="9f6b51eb7023cc20308c4547b95acb81" class="">
<h2>JavaScript sucks</h2>
<p>
<br>
</p>
<ul>
<li>No integers</li>
<li>No module system</li>
<li>Verbose syntax</li>
<li>Confusing, inconsistent equality operators</li>
<li>Confusing, inconsistent automatic operator conversions</li>
<li>Lack of block scope</li>
<li>Non-uniform iterators</li>
<li>Global variables by default</li>
<li>NaN</li>
<li>this</li>
<li>No macros (yet...)</li>
<li>etc.<br>
</li>
</ul>
</section>
<section data-id="6d6876f23f8d402519f36582431a76ba" class="">
<h2>We Need JavaScript</h2>
<p>
<br>
</p>
<ul>
<li>Runtime is everywhere</li>
<li>Runtime is improving (Web Sockets, geo-location, FS API, RAF, push notifications, WebRTC, WebGL, SVG, Canvas, Web Workers, IndexedDB, etc.)<br>
</li>
</ul>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="b6f47627d95b7d1b5badd1f504548c1b" class="">
<h2>Build better languages on top of JavaScript.<br>
</h2>
</section>
<section data-id="b347f31b80976d8c01a8437cad70d261" class="">
<h2>Compilers!</h2>
<p>
<br>
</p>
<ul>
<li>Lots of them already exist</li>
<li>Only a few bring significant improvements</li>
</ul>
<p>
<br>
</p>
<p>
<br>
</p>
<p>Popular ones</p>
<p>
<br>
</p>
<ul>
<li>CoffeeScript: mostly syntax sugar</li>
<li>TypeScript: typed superset of JavaScript. Brings type checking, compile time errors<br>
</li>
</ul>
</section>
<section data-background-color="rgba( 22, 152, 213, 0.6 )" data-id="e50bc1ac3728ef0fbd416cdef41b0c4a" class="">
<h1>ClojureScript<br>
</h1>
</section>
<section data-id="58cc508fa823a355c4be40b04c821325" class="">
<h2>ClojureScript is a Clojure compiler that targets JavaScript.<br>
</h2>
</section>
<section data-id="64bd5d7cc9b1e0094b9262b4a10a7ced" class="">
<h2>Why ClojureScript?</h2>
<h2>Why Clojure?</h2>
<h2>Why LISP?<br>
</h2>
</section>
<section data-id="63ec1a29cffd565e0c626a1745e02372" class="">
<h2>Clojure is just a better language.<br>
</h2>
</section>
<section data-id="d34dfe93a1a92e5c1ab0a05813338c02" class="">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="329px" height="369px" version="1.1">
<defs>
</defs>
<g transform="translate(0.5,0.5)">
<path d="M -43 163 L 280 163" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" transform="rotate(90,119,163)" pointer-events="none">
</path>
<path d="M 121 325 L 326 325" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none">
</path>
<rect x="151" y="322" width="40" height="3" fill="#c3ff00" stroke="#000000" pointer-events="none">