Skip to content

Commit 3629794

Browse files
committed
Many more slides
1 parent b9472d3 commit 3629794

File tree

3 files changed

+348
-97
lines changed

3 files changed

+348
-97
lines changed

css/custom.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,19 @@ body {
174174
/*}*/
175175

176176
.reveal .xxxl {
177-
font-size: 1.4em;
177+
font-size: 1.2em;
178178
}
179179

180180
.reveal .xxl {
181-
font-size: 1.3em;
181+
font-size: 1.15em;
182182
}
183183

184184
.reveal .xl {
185-
font-size: 1.2em;
185+
font-size: 1.1em;
186186
}
187187

188188
.reveal .l {
189-
font-size: 1.1em;
189+
font-size: 1.05em;
190190
}
191191

192192
.reveal .m {
@@ -252,7 +252,7 @@ body {
252252
}
253253

254254
.reveal code mark {
255-
background-color: #045393;
255+
background-color: #2d3c6c;
256256
padding-left: 0;
257257
padding-right: 0;
258258
}

index.html

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,28 @@ <h3>AngularJS</h3>
7575
<li class='red'>
7676
Many concepts make training difficult
7777
<div class='subtle'>
78-
(scope inheritance, isolation, dependency injection, digest cycle...)
78+
(scope inheritance, isolation, dependency injection, dot rule, digest cycle...)
7979
</div>
8080
</li>
8181
<li class='red'>Angular 1 is EOL, leaving us in an awkward situation.</li>
8282
<li class='red'>We don't know how we're going to build SPAs in 2016+.</li>
8383
</ul>
8484
</section>
85+
<section>
86+
<div class='s'>
87+
<pre><code class='javascript'>angular.module('app', []).directive('myPane', ['$http', function($http) {&#x000A; return {&#x000A; require: ['^^myTabs', 'ngModel'],&#x000A; restrict: 'AEC',&#x000A; transclude: true,&#x000A; scope: {&#x000A; title: '@',&#x000A; info: '='&#x000A; },&#x000A; link: function(scope, element, attrs, controllers) {&#x000A; ...&#x000A; },&#x000A; };&#x000A;});&#x000A;&#x000A;</code></pre>
88+
</div>
89+
</section>
8590
<section>
8691
<h3>Half-assed AngularJS</h3>
8792
<ul>
8893
<li>AMC frontend, REALCUBE</li>
8994
<li>
90-
Uses Angular directives to run JS on matching HTML elements
91-
<div class='subtle'>
92-
(like an <code>$.unobtrusive</code> replacement):
93-
</div>
95+
Uses Angular directives to run JS on matching HTML elements:
9496
<pre class='xs'><code class='javascript' data-noescape>app.directive('foo', function() {&#x000A; return {&#x000A; link: function(scope, $element) {&#x000A; // do something with an $element that has class "foo"&#x000A; };&#x000A; }&#x000A;});&#x000A;</code></pre>
9597
</li>
9698
<li>
97-
Use local scopes to toggle UI states:
99+
Uses local scopes to toggle UI states:
98100
<pre class='xs'><code class='html' data-noescape>&lt;div ng-init="more = false"&gt;&#x000A; &lt;span ng-click="more = true"&gt;Show more&lt;/a&gt;&#x000A; &lt;div ng-if="more"&gt;More information&lt;/div&gt;&#x000A;&lt;/div&gt;&#x000A;</code></pre>
99101
</li>
100102
</ul>
@@ -108,7 +110,7 @@ <h3>
108110
Issues
109111
</div>
110112
</h3>
111-
<ul>
113+
<ul class='red'>
112114
<li>Crawlable content must always be rendered on the server,<br />so we can't really use this for important state changes</li>
113115
<li>No routing, so no real URLs for changed state</li>
114116
<li>Compile time is an issue on large pages</li>
@@ -125,7 +127,7 @@ <h3>Random.js</h3>
125127
<ul>
126128
<li>Copy &amp; paste of untested (and flawed!) code snippets from cards and old projects</li>
127129
<li>Anything non-trivial is implemented with a wall of jQuery</li>
128-
<li>Initialized randomly (on load, <code>$.unobtrusive</code>, <code>&lt;script&gt;</code> tags...)</li>
130+
<li>Initialized randomly (on load, <code>$.unobtrusive</code>, <code>&lt;script&gt;</code> tags, by library internals...)</li>
129131
</ul>
130132
</li>
131133
<li class='red'>
@@ -187,6 +189,9 @@ <h3>A shitty decision for our clients</h3>
187189
</table>
188190
</section>
189191
<section>
192+
<p>
193+
We just spent three years learning how Javascript works.
194+
</p>
190195
<p>
191196
Can we bring learnings from AngularJS into the server-side paradigm?
192197
</p>
@@ -230,6 +235,7 @@ <h3>
230235
</ol>
231236
</section>
232237
<section>
238+
<h2>Unpoly</h2>
233239
<table>
234240
<tr>
235241
<th></th>
@@ -325,14 +331,14 @@ <h2>
325331
</section>
326332
<section>
327333
<p>
328-
Gleicher serverseitiger Code:
334+
Same code on the server:
329335
</p>
330336
<ul>
331337
<li>
332-
<a href='http://demo.upjs.io/sessions/CSARbQ/cards/6463?up_enabled=false'>ohne Unpoly</a>
338+
<a href='http://demo.upjs.io/sessions/CSARbQ/cards/6463?up_enabled=false'>No Unpoly</a>
333339
</li>
334340
<li>
335-
<a href='http://demo.upjs.io/sessions/CSARbQ/cards/6463?up_enabled=true'>mit Unpoly</a>
341+
<a href='http://demo.upjs.io/sessions/CSARbQ/cards/6463?up_enabled=true'>With Unpoly</a>
336342
</li>
337343
</ul>
338344
</section>
@@ -605,7 +611,7 @@ <h3>
605611
</ul>
606612
</section>
607613
<section>
608-
<h3>Freeing our time budget</h3>
614+
<h3>Freeing up time budget</h3>
609615
<div class='s'>
610616
<ul>
611617
<li>
@@ -712,18 +718,18 @@ <h3>
712718
<div class='line'>Invent your own UJS syntax</div>
713719
</h3>
714720
<h4 class='subtle'>HTML</h4>
715-
<pre><code class='html' data-noescape>&lt;a class="menu-link" href="/details"&gt;Show more&lt;/span&gt;&#x000A;</code></pre>
721+
<pre class='l'><code class='html' data-noescape>&lt;a class="menu-link" href="/details"&gt;Show more&lt;/span&gt;&#x000A;</code></pre>
716722
<h4 class='subtle'>Javascript</h4>
717-
<pre><code class='javascript'>up.compiler('.menu-link', function($link) {&#x000A; up.popup.attach($link, {&#x000A; target: '.menu',&#x000A; position: 'bottom-left',&#x000A; animation: 'roll-down'&#x000A; });&#x000A;});&#x000A;</code></pre>
723+
<pre class='l'><code class='javascript'>up.compiler('.menu-link', function($link) {&#x000A; $link.on('click', function(event) {&#x000A; event.preventDefault();&#x000A; up.popup.attach($link, {&#x000A; target: '.menu',&#x000A; position: 'bottom-left',&#x000A; animation: 'roll-down'&#x000A; });&#x000A; });&#x000A;});&#x000A;</code></pre>
718724
</section>
719725
<section>
720726
<h3>
721-
<div class='line'>Invent your own UJS syntax</div>
727+
<div class='line'>Repurpose existing UJS syntax</div>
722728
</h3>
723729
<h4 class='subtle'>HTML</h4>
724-
<pre><code class='html' data-noescape>&lt;a class="menu-link" href="/details"&gt;Show more&lt;/span&gt;&#x000A;</code></pre>
730+
<pre class='l'><code class='html' data-noescape>&lt;a class="menu-link" href="/details"&gt;Show more&lt;/span&gt;&#x000A;</code></pre>
725731
<h4 class='subtle'>Javascript</h4>
726-
<pre><code class='javascript'>up.macro('.menu-link', function($link) {&#x000A; $link.attr(&#x000A; 'up-target': '.menu',&#x000A; 'up-position': 'bottom-left',&#x000A; 'up-animation': 'roll-down'&#x000A; });&#x000A;});&#x000A;</code></pre>
732+
<pre class='l'><code class='javascript'>up.macro('.menu-link', function($link) {&#x000A; $link.attr(&#x000A; 'up-target': '.menu',&#x000A; 'up-position': 'bottom-left',&#x000A; 'up-animation': 'roll-down'&#x000A; });&#x000A;});&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
727733
</section>
728734
<section>
729735
<h3>
@@ -763,6 +769,20 @@ <h3>Bootstrap integration</h3>
763769
</li>
764770
</ul>
765771
</section>
772+
<section>
773+
<h3>Rails integration</h3>
774+
<p>
775+
Include <a href="http://www.rubydoc.info/gems/unpoly-rails/">unpoly-rails</a> In your <code>Gemfile</code>:
776+
</p>
777+
<pre class='xs'><code class='ruby'>gem 'unpoly-rails'&#x000A;</code></pre>
778+
<p>
779+
In your controllers, views and helpers:
780+
</p>
781+
<pre class='xs'><code class='ruby'>up? # request.headers['X-Up-Target'].present?&#x000A;up.target # request.headers['X-Up-Target']&#x000A;up.title = 'Title from server' # response.headers['X-Up-Title'] = 'Title ...'&#x000A;up.validate? # request.headers['X-Up-Validate'].present?&#x000A;</code></pre>
782+
<p>
783+
The gem also provides the JS and CSS assets for the latest Unpoly.
784+
</p>
785+
</section>
766786
<section>
767787
<h3>Legacy browsers</h3>
768788
<p>
@@ -790,20 +810,6 @@ <h3>Legacy browsers</h3>
790810
</tr>
791811
</table>
792812
</section>
793-
<section>
794-
<h3>Rails integration</h3>
795-
<p>
796-
Include <a href="http://www.rubydoc.info/gems/unpoly-rails/">unpoly-rails</a> In your <code>Gemfile</code>:
797-
</p>
798-
<pre class='xs'><code class='ruby'>gem 'unpoly-rails'&#x000A;</code></pre>
799-
<p>
800-
In your controllers, views and helpers:
801-
</p>
802-
<pre class='xs'><code class='ruby'>up? # request.headers['X-Up-Target'].present?&#x000A;up.target # request.headers['X-Up-Target']&#x000A;up.title = 'Title from server' # response.headers['X-Up-Title'] = 'Title ...'&#x000A;up.validate? # request.headers['X-Up-Validate'].present?&#x000A;</code></pre>
803-
<p>
804-
The gem also provides the JS and CSS assets for the latest Unpoly.
805-
</p>
806-
</section>
807813
<section>
808814
<h2>Forms</h2>
809815
<p>
@@ -857,8 +863,44 @@ <h3>Updating dependent fields</h3>
857863
<pre class='xs'><code class='html' data-noescape>&lt;form action="/contracts"&gt;&#x000A; &lt;select name="department" <mark>up-validate="[name=employee]"</mark>&gt;...&lt;/select&gt;&#x000A; &lt;select name="employee"&gt;...&lt;/select&gt;&#x000A;&lt;/form&gt;&#x000A;</code></pre>
858864
</section>
859865
<section>
860-
<h3>Keep elements</h3>
861-
<pre><code class='html' data-noescape>&lt;div class="story"&gt;&#x000A;&#x000A; &lt;video <mark>up-keep</mark> src="movie.mp4"&gt;&lt;/video&gt;&#x000A;&#x000A; &lt;p&gt;Story summary&lt;/p&gt;&#x000A;&#x000A; &lt;a href="full.html" up-target=".story"&gt;&#x000A; Read full story&#x000A; &lt;/a&gt;&#x000A;&#x000A;&lt;/div&gt;&#x000A;</code></pre>
866+
<h3>Persisting elements</h3>
867+
<pre class='l'><code class='html' data-noescape>&lt;div class="story"&gt;&#x000A;&#x000A; &lt;video <mark>up-keep</mark> src="movie.mp4"&gt;&lt;/video&gt;&#x000A;&#x000A; &lt;p&gt;Story summary&lt;/p&gt;&#x000A;&#x000A; &lt;a href="full.html" up-target=".story"&gt;&#x000A; Read full story&#x000A; &lt;/a&gt;&#x000A;&#x000A;&lt;/div&gt;&#x000A;&#x000A;</code></pre>
868+
</section>
869+
<section>
870+
<pre><code class='html' data-noescape>&lt;div class="map" up-data="[&#x000A; { lat: 48.36, lng: 10.99 },&#x000A; { lat: 48.75, lng: 11.45 }&#x000A;]"&gt;&lt;/div&gt;&#x000A;&#x000A;&lt;form method="post" action="/pins"&gt;&#x000A; Lat: &lt;input name="lat"&gt;&#x000A; Lng: &lt;input name="lng"&gt;&#x000A; &lt;button&gt;Add pin&lt;/button&gt;&#x000A;&lt;/form&gt;&#x000A;</code></pre>
871+
<pre><code class='javascript' data-noescape>up.compiler('.map', function($element, pins) {&#x000A; var map = new google.maps.Map($element);&#x000A; pins.forEach(function(pin) {&#x000A; var position = new google.maps.LatLng(pin.lat, pin.lng);&#x000A; new google.maps.Marker({&#x000A; position: position,&#x000A; map: map&#x000A; });&#x000A;});&#x000A;</code></pre>
872+
</section>
873+
<section>
874+
<pre><code class='html' data-noescape>&lt;div class="map" up-data="&lt;%= @pins.to_json %&gt;"&gt;&lt;/div&gt;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
875+
<pre><code class='javascript' data-noescape>up.compiler('.map', function($element, pins) {&#x000A; var map = new google.maps.Map($element);&#x000A; pins.forEach(function(pin) {&#x000A; var position = new google.maps.LatLng(pin.lat, pin.lng);&#x000A; new google.maps.Marker({&#x000A; position: position,&#x000A; map: map&#x000A; });&#x000A;});&#x000A;</code></pre>
876+
</section>
877+
<section>
878+
<pre><code class='html' data-noescape>&lt;div class="map" up-data="&lt;%= @pins.to_json %&gt;"&gt;&lt;/div&gt;&#x000A;&#x000A;&lt;%= form_for Pin.new do |form| %&gt;&#x000A; Lat: &lt;%= form.text_field :lat %&gt;&#x000A; Lng: &lt;%= form.text_field :lng %&gt;&#x000A; &lt;%= form.submit 'Add pin' %&gt;&#x000A;&lt;/form&gt;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
879+
<pre><code class='javascript' data-noescape>up.compiler('.map', function($element, pins) {&#x000A; var map = new google.maps.Map($element);&#x000A; pins.forEach(function(pin) {&#x000A; var position = new google.maps.LatLng(pin.lat, pin.lng);&#x000A; new google.maps.Marker({&#x000A; position: position,&#x000A; map: map&#x000A; });&#x000A;});&#x000A;</code></pre>
880+
</section>
881+
<section>
882+
<pre><code class='html' data-noescape>&lt;div class="map" up-data="&lt;%= @pins.to_json %&gt;"&gt;&lt;/div&gt;&#x000A;&#x000A;&lt;%= form_for Pin.new do |form| %&gt;&#x000A; Lat: &lt;%= form.text_field :lat %&gt;&#x000A; Lng: &lt;%= form.text_field :lng %&gt;&#x000A; &lt;%= form.submit 'Add pin' %&gt;&#x000A;&lt;/form&gt;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
883+
<pre><code class='javascript' data-noescape>up.compiler('.map', function($element, initialPins) {&#x000A; var map = new google.maps.Map($element);&#x000A; function renderPins(pins) { ... }&#x000A; renderPins(initialPins);&#x000A;});&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
884+
</section>
885+
<section>
886+
<pre><code class='html' data-noescape>&lt;div class="map" up-data="&lt;%= @pins.to_json %&gt;" <mark>up-keep</mark>&gt;&lt;/div&gt;&#x000A;&#x000A;&lt;%= form_for Pin.new do |form| %&gt;&#x000A; Lat: &lt;%= form.text_field :lat %&gt;&#x000A; Lng: &lt;%= form.text_field :lng %&gt;&#x000A; &lt;%= form.submit 'Add pin' %&gt;&#x000A;&lt;/form&gt;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;&nbsp;&#x000A;</code></pre>
887+
<pre><code class='javascript' data-noescape>up.compiler('.map', function($element, initialPins) {&#x000A; var map = new google.maps.Map($element);&#x000A; function renderPins(pins) { ... }&#x000A; renderPins(initialPins);&#x000A; <mark>$element.on('up:fragment:keep', function(event) {</mark>&#x000A; <mark> renderPins(event.newData); </mark>&#x000A; <mark>}); </mark>&#x000A;});&#x000A;&nbsp;&#x000A;</code></pre>
888+
</section>
889+
<section>
890+
<h3>Find-as-you-type search</h3>
891+
<pre><code class='html' data-noescape>&lt;form action="/users" up-target=".list" <mark>up-observe="up.submit(this)"</mark>&gt;&#x000A; &lt;input type="search" name="query" /&gt;&#x000A;&lt;/form&gt;&#x000A;&#x000A;&lt;div class="list"&gt;&#x000A; &lt;% @users.each do |user| %&gt;&#x000A; = link_to user.email, user&#x000A; &lt;% end %&gt;&#x000A;&lt;/div&gt;&#x000A;</code></pre>
892+
<p>
893+
<code>up-observe</code> reacts faster than our vintage <code>observeField</code> helper
894+
and has no concurrency issues.
895+
</p>
896+
</section>
897+
<section>
898+
<h3>Find-as-you-type search</h3>
899+
<pre><code class='html' data-noescape>&lt;form action="/users" up-target=".list" <mark>up-autosubmit</mark>&gt;&#x000A; &lt;input type="search" name="query" /&gt;&#x000A;&lt;/form&gt;&#x000A;&#x000A;&lt;div class="list"&gt;&#x000A; &lt;% @users.each do |user| %&gt;&#x000A; = link_to user.email, user&#x000A; &lt;% end %&gt;&#x000A;&lt;/div&gt;&#x000A;</code></pre>
900+
<p>
901+
<code>up-observe</code> reacts faster than our vintage <code>observeField</code> helper
902+
and has no concurrency issues.
903+
</p>
862904
</section>
863905
<section>
864906
<h3>Getting started</h3>
@@ -905,19 +947,16 @@ <h3>Easier integration testing</h3>
905947
</p>
906948
</section>
907949
<section>
908-
<h2>Project state</h2>
950+
<h2>Should I use this for my project?</h2>
909951
<ul>
910952
<li>In development since October 2014</li>
911-
<li>Has seen some real world pain</li>
912953
<li>~ 500 specs</li>
954+
<li>Has seen some real world pain, but we're still learning new things</li>
955+
<li><a href="http://unpoly.com/changelog">Changelog</a> lists breaking changes and compatible changes separately</li>
913956
<li>
914-
Release policy
915-
<ul>
916-
<li><a href="http://unpoly.com/changelog">Changelog</a> lists breaking changes and compatible changes separately</li>
917-
<li><a href="http://unpoly.com/search/">API</a> marks features as either <i>stable</i> or <i>experimental</i></li>
918-
<li>There will be breaking changes, but always a simple upgrade path</li>
919-
</ul>
957+
<a href="http://unpoly.com/search/">API</a> marks features as either <i>stable</i> or <i>experimental</i>.
920958
</li>
959+
<li>There will be breaking changes, but always a simple upgrade path</li>
921960
</ul>
922961
</section>
923962
<section>

0 commit comments

Comments
 (0)