1 of 27

Why all the Suspense?

Docs and information available at www.solidjs.com

2 of 27

Who am I?

3 of 27

Why Suspense?

4 of 27

5 of 27

Phantom Notifications

6 of 27

React: 0 0 0

Vue 3: 1 2 0

Svelte: 1 0 0

Solid: 1 2 2

7 of 27

Tearing

8 of 27

9 of 27

  1. Show Placeholder
  2. Stay in the Past
  3. Show the Future

Async Consistency

10 of 27

What is Suspense?

11 of 27

What Suspense is Not

12 of 27

Reads are Key

const [data, { refetch }] = createResource(

() => fetchUser(`/api/users`)

);

return <Suspense fallback={<div>Loading...</div>}>

{JSON.stringify(data())}

</Suspense>

13 of 27

  1. Showing Placeholders

14 of 27

More than Data Fetching

15 of 27

Handling Errors

16 of 27

Out of Order Streaming

17 of 27

18 of 27

2. Staying in the Past

19 of 27

Introducing Transitions

20 of 27

How Transitions Work

21 of 27

22 of 27

3. Showing the Future

23 of 27

Mutation

24 of 27

Time Slicing?

25 of 27

Scheduled Queuing

Event

Pure Computation

Render Effects

User Effects

setState(value)

VDOM = fn(state)

Diff and Patch

useEffect(fn)

setSignal(value)

createMemo(fn)

createRenderEffect(fn)

createEffect(fn)

26 of 27

Async Consistency

27 of 27

@RyanCarniato