Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2_welcome intent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3_Entity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/4-webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/4_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/4_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/4_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/5_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/5_add context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/6_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/6_Integrations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/bvaughn-tearing-1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/bvaughn-tearing-2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/component-lifecycle.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/dan-demo-blocking.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/dan-demo-concurrent.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/deferred-setstate.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/hooks-api-timing.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/hooks-api.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/interrupt-rendering.svg
100644 → 100755
Empty file modified assets/interrupted-lifecycle.svg
100644 → 100755
Empty file modified assets/observing-lifecycle-events.svg
100644 → 100755
Empty file modified assets/scheduler-priorities.svg
100644 → 100755
485 changes: 320 additions & 165 deletions decks/food.mdx
100644 → 100755

Large diffs are not rendered by default.

377 changes: 2 additions & 375 deletions decks/index.mdx
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,379 +1,6 @@
import { CodeSurfer as Surfer } from "code-surfer";
import { CodeSurferColumns, Step } from "code-surfer";
import { Appear, Background } from "gatsby-theme-mdx-deck";
import * as L from "../src/layout";
import customTheme from "../src/theme";
import GreetingLoader from "./src/greeting-loader";

export const theme = customTheme;

<L.Column>

# Concurrent Mode

</L.Column>

---
<CodeSurferColumns sizes={[1, 2]}>

<Step subtitle="Here is a simple React component">

<GreetingLoader />

```jsx file=./src/greeting.1.1.js
```

</Step>

<Step subtitle="we want to make the 'name' editable">

<GreetingLoader />

```jsx 7 file=./src/greeting.1.1.js
```

</Step>

<Step subtitle="so we turn the component into a class">

<GreetingLoader version="class.1.1" />

```jsx file=./src/greeting.class.1.1.js
```

</Step>

<Step subtitle="add some state">

<GreetingLoader version="class.1.2" />

```jsx file=./src/greeting.class.1.2.js
```

</Step>

<Step subtitle="and add a change handler that calls setState">

<GreetingLoader version="class.1.3" />

```jsx 10:12,15:17,25 file=./src/greeting.class.1.3.js
```

</Step>

<Step subtitle="we can now edit the name and it should work">

<GreetingLoader version="class.1.3" />

```jsx 1:31 file=./src/greeting.class.1.3.js
```

</Step>

</CodeSurferColumns>

---
<Background />
<L.Column sx={{ minHeight: '0' }}>

## Disclaimer

### Information in this talk may not be accurate or may change in the future

</L.Column>

---

<L.Row>

## Time Slicing

### "Chunking slow rendering on subtree into little blocks of work by interrupting the work loop."

</L.Row>

---

import DanDemoBlocking from '../assets/dan-demo-blocking.png';

<img src={DanDemoBlocking} />

---

import DanDemoConcurrent from '../assets/dan-demo-concurrent.png';

<img src={DanDemoConcurrent} />

---

<Background />

### "Wait a minute... I already know about this! What is this talk really about?"

---

<L.Column>

# Concurrent Mode

## A chain of unfortunate consequences

</L.Column>

---

<Background />

### How does React "delay" rendering?

---

<L.Column>

## Sources of Slowdown

- Slow component render functions
- Slow state setter or reducer updater functions
- Slow effect functions

</L.Column>

---

import DeferredSetState from '../assets/deferred-setstate.svg';

<L.Row>

## Deferred setState.

### Any state setter or dispatch can be delayed.

</L.Row>

<DeferredSetState />

---

import InterruptRendering from '../assets/interrupt-rendering.svg';

<L.Row>

## Interrupt Rendering.

### Any rendering can be interrupted and can be completed later before committing.

</L.Row>

<InterruptRendering />
# Hello

---

<L.Row>

## Oops #1

### Delaying rendering is only safe when no effects are pending on a subtree.

</L.Row>

---

import HooksAPI from '../assets/hooks-api.svg';

<L.Row>

## The Hooks API.

### This restriction is reflected in the hooks API with encapsulation of effects.

</L.Row>

<HooksAPI />

---

import HooksAPITiming from '../assets/hooks-api-timing.svg';

<L.Row>

## Hooks Timings.

### With each hook we observe a part of the lifecycle and can react.

</L.Row>

<HooksAPITiming />

---

import ComponentLifecycle from '../assets/component-lifecycle.svg';

<L.Row>

## The Lifecycle.

### The lifecycle we observe has three phases repeating.

</L.Row>

<ComponentLifecycle />

---

import ObservingLifecycleEvents from '../assets/observing-lifecycle-events.svg';

<L.Row>

## Observing the Lifecycle.

### Overlapping the lifecycle with hooks, we see a phase that we can't observe...

</L.Row>

<ObservingLifecycleEvents />

---

import InterruptedLifecycle from '../assets/interrupted-lifecycle.svg';

<L.Row>

## Interrupting the Lifecycle.

### Unfortunately this phase becomes very relevant in Strict and Concurrent Mode.

</L.Row>

<InterruptedLifecycle />

---

<L.Row>

## Oops #2

### It's not possible to have a subscription or effect track the component lifecycle.

</L.Row>

---

<L.Row>

## Workaround

### Resort to useSubscription

</L.Row>

---

import SchedulerPriorities from '../assets/scheduler-priorities.svg';

<L.Row>

## Scheduler Priorities.

### In Concurrent Mode the time budgets are switched on for time slicing.

</L.Row>

<SchedulerPriorities />

---

<L.Row>

## Oops #3

### Seems like React isn't all that predictable anymore.

</L.Row>

---

<L.Row>

## Workaround

### Synchronous Subscriber and scheduled teardown

</L.Row>

https://github.com/facebook/react/issues/15317#issuecomment-573337558

---

<Background />

### "We didn't yet get to what happens when an effect is slow, right?"

---

<L.Row>

## Tearing

### "When a subtree's renderered state falls behind while another subtree has committed updates already."

</L.Row>

---

import Tearing1 from '../assets/bvaughn-tearing-1.png';
import Tearing2 from '../assets/bvaughn-tearing-2.png';

<L.Row>
<img src={Tearing2} />
<img src={Tearing1} />
</L.Row>

---

<L.Column>

## React's solution?

- When an effect slows down, React can't safely interrupt or delay updates.
- Instead it batches all updates and switches back to blocking mode
- This is called a _deopt_.

</L.Column>

---

<L.Row>

## Oops #4

### React Concurrent's deopt can be slower than Blocking was before.

</L.Row>

---

<L.Column>

## However

- This may still cause _tearing_ when another update is scheduled during this blocking batch.

</L.Column>

---

<L.Row>

## Oops #5

### A new `useMutableSource` hook is necessary to fix this tearing-during-deopt issue.

</L.Row>

---

<L.Column>

# Concurrent Mode: Oops

</L.Column>
This is built with gatsby-theme-mdx-deck
Empty file modified decks/src/context.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting-loader.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.1.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.1.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.1.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.1.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.2.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.3.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.3.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.3.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.4.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.5.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.5.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.5.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.class.5.4.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.1.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.1.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.1.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.1.4.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.2.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.3.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.3.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.3.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.4.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.4.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.5.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.5.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.5.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.6.1.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.6.2.js
100644 → 100755
Empty file.
Empty file modified decks/src/greeting.hooks.6.3.js
100644 → 100755
Empty file.
Empty file modified decks/src/row.js
100644 → 100755
Empty file.
Empty file modified decks/src/styles.css
100644 → 100755
Empty file.
Empty file modified gatsby-config.js
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions misc/feedback/feedback-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Presentation Feedback

### Positives
_What were some aspects of the presentation that the developers excelled at?_

*

### Improvements
_Describe some improvements they can make with their presentation._

*

### Goals for Next Time
_What can they do to improve next time?_

*
Loading