Skip to content

Commit 7b77794

Browse files
committed
Changes before stream
1 parent 1c21739 commit 7b77794

File tree

3 files changed

+86
-46
lines changed

3 files changed

+86
-46
lines changed

Diff for: intro/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
}
8484
.loader:after {
8585
background: white;
86-
width: 70%;
87-
height: 70%;
86+
width: 80%;
87+
height: 80%;
8888
border-radius: 50%;
8989
content: '';
9090
margin: auto;
@@ -116,7 +116,7 @@
116116
<script type="text/javascript">
117117
window.addEventListener('load', function() {
118118
let audio = document.querySelector('audio')
119-
audio.volume = 0.5;
119+
audio.volume = 0.4;
120120

121121
})
122122
</script>

Diff for: marp-theme.css

+5
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ h1:before {
8989
padding-top: 10px;
9090
}
9191

92+
.title--author a[href] {
93+
color: var(--textColor);
94+
text-decoration: none;
95+
}
96+
9297

9398
section.topic h1 {
9499
font-size: 3em;

Diff for: slides.md

+78-43
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ theme: unpoly2-slides
99
<div class="title">
1010
<img src="./images/unpoly2.svg" alt="Unpoly 2" class="title--logo">
1111
<div class="title--author">
12-
Henning Koch&nbsp; @triskweline
12+
Henning Koch&nbsp; <a href="https://twitter.com/triskweline">@triskweline</a>
1313
</div>
1414
</div>
1515

@@ -41,7 +41,9 @@ There will be two major Unpoly releases in **December 2020 / January 2021**:
4141
Unpoly 2?
4242
=========
4343

44-
Unpoly 2 is a long-term project resulting from many discussions with my colleagues at makandra,\
44+
Unpoly 2 is the end of a long-term project.
45+
46+
It resulted from many discussions with my colleagues at makandra,
4547
and the limits they ran into when using Unpoly for non-trivial interactions.
4648

4749
I also looked through a lot of code on our Gitlab to see how Unpoly was used in the wild.
@@ -365,7 +367,7 @@ Unpoly 2 lets you mark elements as default targets using the `[up-main]` attribu
365367

366368
---
367369

368-
## Look ma, no target!
370+
## Links work without target
369371

370372
Once a main target is configured, you no longer need `[up-target]` in a link.\
371373
Use `[up-follow]` and the `[up-main]` element will be replaced:
@@ -485,12 +487,11 @@ up.fragment.config.badTargetClasses.push(
485487
This is all of `unpoly-bootstrap4.scss`:
486488

487489
```css
488-
/* If a Boostrap container is shown in an overlay,
489-
don't add to the existing padding of the overlay box. */
490490
up-modal, up-drawer, up-popup {
491491
.container, .container-fluid {
492-
padding-left: 0;
493-
padding-right: 0;
492+
padding-left: 0; /* The overlay box already has padding */
493+
padding-right: 0; /* The overlay box already has padding */
494+
max-width: none; /* The overlay box already has max-width */
494495
}
495496
}
496497
```
@@ -590,13 +591,6 @@ Example from a real application:
590591
🎥 *Show demo*
591592

592593

593-
---
594-
595-
As we stack layers, multiple copies of your app may run concurrently.
596-
597-
598-
This requires some changes.
599-
600594
---
601595

602596
Layers are fully isolated
@@ -615,7 +609,7 @@ If you want to do *anything* in another layer, use an `[up-layer]` attribute:
615609
```html
616610
<a href="/path" up-target=".foo" up-layer="parent"> <!-- will only match in parent layer -->
617611
<a href="/path" up-target=".foo" up-layer="root"> <!-- will only match in root layer -->
618-
<a href="/path" up-target=".foo" up-layer="new"> <!-- opens a new modal overlay -->
612+
<a href="/path" up-target=".foo" up-layer="modal"> <!-- opens a new modal overlay -->
619613
```
620614

621615
You can always look at `[up-layer]` to know what layer is going to be updated.\
@@ -707,6 +701,8 @@ Events resulting from user navigation (like `up:link:follow`, `up:request:load`)
707701
---
708702

709703

704+
## Listening to your layer
705+
710706
Unpoly 2 provides convenience functions `up.layer.on()` and `up.layer.emit()`\
711707
to listen / emit on the current layer:
712708

@@ -715,6 +711,11 @@ up.layer.on('up:request:load', callback) // only listen to events from the curre
715711
up.layer.emit('my:event') // emit my:event on the current layer's element
716712
```
717713

714+
The current layer is the layer in which you are compiling or navigating.
715+
716+
717+
## Listening to everything
718+
718719
Layer events will still bubble up to the `document`,\
719720
so you can still register
720721
a listener for events from any layer:
@@ -760,6 +761,8 @@ up.fail_layer.root? # true
760761
Why we need sub-interactions
761762
============================
762763

764+
🎥 *Show scenario in the demo app*
765+
763766
This story is the base use case for a sub-interaction:
764767

765768
- User starts filling out the form for a new project
@@ -769,8 +772,6 @@ This story is the base use case for a sub-interaction:
769772
- When the company was created in the overlay, the overlay should close.\
770773
The project form should now have the newly created company selected.
771774

772-
🎥 *Show scenario in the demo*
773-
774775
----
775776

776777
<!-- _class: no-watermark no-padding -->
@@ -878,7 +879,7 @@ Another common callback reloads `<select>` options and selects the new foreign k
878879

879880
---
880881

881-
## Why I think this is useful
882+
## Why this is useful
882883

883884
- You already have a CRUD interaction for companies
884885
- You can now embed the existing company form into your project form
@@ -974,7 +975,9 @@ The link's layer will be closed when the link is clicked:
974975

975976
The JSON value of the `[up-accept]` attribute becomes the overlay's acceptance value.
976977

977-
The link will only be followed if the link is on the root layer (where there is no overlay to accept).
978+
The link's `[href]` is just a fallback here. It will only be followed if the link is on the root layer (where there is no overlay to accept). You can also omit the `[href]` attribute.
979+
980+
<br>
978981

979982
**I'm not a huge fan of this** because it couples the overlay interaction to its parent layer.\
980983
But some of you asked for it, and I guess sometimes the overlay cannot be decoupled
@@ -1087,7 +1090,7 @@ the lifetime of a layer:
10871090
| Local storage | Domain | Permanentish | String | Yes | &ndash; |
10881091
| Cookies | Domain | Configurable | String | Configurable | Yes |
10891092
| Session storage | Tab | Session | String | Yes | &ndash; |
1090-
| Layer context 🆕 | Layer | Session | JSON | Yes | Yes |
1093+
| Layer context 🆕 | Layer | Session | Object | Yes | Yes |
10911094

10921095

10931096
---
@@ -1221,7 +1224,8 @@ dismissCurrentIn(10) //
12211224
New overlay HTML structure
12221225
===========================
12231226

1224-
Unpoly 2 uses different HTML markup for its overlays. If you have customized your modals and popup with CSS, this is a breaking change for you.
1227+
Unpoly 2 uses a more compact HTML markup for its overlays.\
1228+
If you have customized your modals and popup with CSS, this is a breaking change for you.
12251229

12261230
Luckily the new HTML structure is very similiar:
12271231

@@ -1421,7 +1425,7 @@ Customizing overlay HTML
14211425

14221426
The HTML markup for a given overlay mode is now static. There is no `up.modal.config.template` anymore.
14231427

1424-
Many former use cases for `up.modal.config.template` are covered by assigning a class, size.
1428+
Many former use cases for `up.modal.config.template` are covered by assigning a class or size.
14251429

14261430
If you absolutely, positively need to customize the overlay HTML, you may use the `up:layer:opened` event to modify the layer as it becomes visible. The event is emitted
14271431
before the opening animation starts.
@@ -1489,7 +1493,7 @@ Switching screens vs. updating boxes
14891493

14901494
**💡 Not all fragment updates are user navigation.**
14911495

1492-
When Unpoly 1 updates fragment, it applies many opinionated defaults:
1496+
When Unpoly 1 updates a fragment, it applies many opinionated defaults:
14931497

14941498
- Update the browser location
14951499
- Scroll to reveal the new fragment
@@ -1517,6 +1521,8 @@ up.replace('.message-count', '/inbox', {
15171521
Unpoly 2 defaults are opt-in, not opt-out
15181522
=========================================
15191523

1524+
Unpoly 2 replaces `up.replace()`, `up.extract()` with a unified function `up.render()`.
1525+
15201526
When updating a fragment in Unpoly 2 with `up.render()`, you will get **very few defaults**:
15211527

15221528
```js
@@ -1541,6 +1547,12 @@ You can opt into defaults for user navigation with `{ navigate: true }`:
15411547
// Will update history, will scroll, etc.
15421548
up.render('.content', { url: '/users/5', navigate: true })
15431549
```
1550+
Instead of `up.render({ navigate: true })` you may also use `up.navigate()`:
1551+
1552+
```js
1553+
// Will update history, will scroll, etc.
1554+
up.navigate('.content', { url: '/inbox' })
1555+
```
15441556

15451557

15461558
---
@@ -1569,18 +1581,11 @@ You can configure your navigation defaults with `up.fragment.config.navigateOpti
15691581

15701582
You can opt out with the `[up-navigate=false]` attribute.
15711583

1572-
---
1573-
<!-- _class: pro -->
1574-
1575-
Navigation shorthand
1576-
--------------------
1584+
### Deprecated render functions are still considered navigation
15771585

1578-
Instead of `up.render({ navigate: true })` you may also use `up.navigate()`:
1586+
Deprecated functions like `up.replace()` and `up.extract()` navigate by default.\
1587+
That's was the behavior in Unpoly 1, and we don't want to break your apps.
15791588

1580-
```js
1581-
// Will update history, will scroll, etc.
1582-
up.navigate('.message-count', { url: '/inbox' })
1583-
```
15841589

15851590

15861591

@@ -1850,7 +1855,20 @@ Assign the `[up-poll]` attribute to any element to reload it every 30 seconds:
18501855
</div>
18511856
```
18521857

1853-
The fragment is reloaded from the URL that originally brought it into the DOM.
1858+
---
1859+
1860+
## Configuring the reload URL
1861+
1862+
The polling fragment is reloaded from the URL that originally brought it into the DOM.
1863+
1864+
You may set an optional `[up-source]` attribute to reload from a different source:
1865+
1866+
```html
1867+
<div class="unread-messages" up-poll up-source="/inbox/unread">
1868+
You have 2 unread messages
1869+
</div>
1870+
```
1871+
18541872

18551873
---
18561874

@@ -1872,7 +1890,6 @@ You can also configure the interval default globally with `up.fragment.config.po
18721890

18731891
---
18741892

1875-
18761893
### Polling pauses while the browser tab is invisible
18771894

18781895
This prevents unnecessary server load when another tab is in the foreground,\
@@ -1889,8 +1906,8 @@ It resumes when the layer is unveiled.
18891906

18901907
---
18911908

1892-
Making poll requests cheap
1893-
==========================
1909+
Cheap polling responses
1910+
-----------------------
18941911

18951912
**💡️ Naive polling implementation will often cause unchanged content to be re-rendered.**
18961913

@@ -1957,8 +1974,8 @@ You can use any new features by manually setting a response header as documented
19571974

19581975
## What we've seen so far:
19591976

1960-
- The server can emit events on the frontend
1961-
- The server can close overlays
1977+
- The server can emit events on the frontend (`X-Up-Events` header)
1978+
- The server can close overlays (`X-Up-Accept-Layer` and `X-Up-Dismiss-Layer`)
19621979

19631980

19641981
---
@@ -2066,7 +2083,7 @@ The cache in Unpoly 1 follows two rules:
20662083

20672084
These were generally good defaults, but sometimes we would cache too much or clear too much.
20682085

2069-
**In Unpoly 2 the server can send hints to better manage the frontend cache.**
2086+
**In Unpoly 2 the server can send an `X-Up-Cache` header to better manage the frontend cache.**
20702087

20712088
---
20722089

@@ -2334,9 +2351,12 @@ up.render({ target: '.foo', content: 'New inner HTML' }
23342351
```
23352352
23362353
---
2354+
<!-- _class: pro -->
23372355
23382356
Event handlers may change render options
2339-
==========================================
2357+
========================================
2358+
2359+
**💡 In Unpoly 1 had many events. But listeners were limited in what they could do.**
23402360
23412361
When the user interacts with links or forms, Unpoly will emit these events:
23422362
@@ -2347,9 +2367,10 @@ When the user interacts with links or forms, Unpoly will emit these events:
23472367
23482368
Event handlers may prevent these events to cancel the fragment update.
23492369
2350-
**Unpoly 2 also lets event listeners manipulate render options for the coming fragment update.**
2370+
**Unpoly 2 also lets event listeners read and change render options for the coming fragment update.**
23512371
23522372
---
2373+
<!-- _class: pro -->
23532374
23542375
## Basic example
23552376
@@ -2364,6 +2385,7 @@ up.on('up:form:submit', function(event) {
23642385
If you have compilers that only set default attributes, consider using a single event listener that manipulates `event.renderOptions` instead. It's much leaner than a compiler, which needs to be called for every new fragment.
23652386
23662387
---
2388+
<!-- _class: pro -->
23672389
23682390
Advanced example
23692391
----------------
@@ -2787,13 +2809,26 @@ Extensive rework of almost all APIs.
27872809
</div>
27882810
</div>
27892811
2812+
2813+
---
2814+
2815+
2816+
Roadmap
2817+
=======
2818+
2819+
There will be two major Unpoly releases in **December 2020 / January 2021**:
2820+
2821+
- The current version 0.62 will be published as **Unpoly 1.0**.
2822+
- **Unpoly 2.0** will be released as a major upgrade.
2823+
2824+
27902825
---
27912826
27922827
<!-- _class: no-watermark -->
27932828
27942829
<div class="title">
27952830
<img src="./images/unpoly2.svg" alt="Unpoly 2" class="title--logo">
27962831
<div class="title--author">
2797-
Henning Koch&nbsp; @triskweline
2832+
Henning Koch&nbsp; <a href="https://twitter.com/triskweline">@triskweline</a>
27982833
</div>
27992834
</div>

0 commit comments

Comments
 (0)