Slide 1

Slide 1 text

⚡ When Virtual DOM Diffing Is a Little Too Clever by Diana MacDonald

Slide 2

Slide 2 text

- Designer - Team Lead - Design Systems - Author - Coder Diana MacDonald @DiDoesDigital

Slide 3

Slide 3 text

- Designer - Team Lead - Design Systems - Author - Coder Diana MacDonald @DiDoesDigital

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Today - Virtual DOM diffing - Screen readers - ARIA live regions - aria-atomic - Double announcer regions - Web Speech API

Slide 9

Slide 9 text

Virtual DOM

Slide 10

Slide 10 text

Virtual DOM

Slide 11

Slide 11 text

Change Detection

Slide 12

Slide 12 text

Incremental DOM

Slide 13

Slide 13 text

Actual DOM: Elements

Slide 14

Slide 14 text

Actual DOM: Console

Slide 15

Slide 15 text

Virtual DOM div p div #text #comment

Slide 16

Slide 16 text

img #text Virtual DOM: diffing

Slide 17

Slide 17 text

Virtual DOM: final state img div p div #comment

Slide 18

Slide 18 text

Screen readers

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

ARIA live regions

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

{message}

Slide 26

Slide 26 text

{message}

Slide 27

Slide 27 text

{message}

Slide 28

Slide 28 text

Announcing dynamic changes

Slide 29

Slide 29 text

{this.state.message}
{this.state.value} Rendering ARIA live (this could work) #

Slide 30

Slide 30 text

Rendering ARIA live (this won't work!) {newMessage ?
{this.state.message}
: null} $

Slide 31

Slide 31 text

aria-atomic="true"

Slide 32

Slide 32 text

{message}

Slide 33

Slide 33 text

{message}

Slide 34

Slide 34 text

The estimated time of arrival is 2.30pm.

Slide 35

Slide 35 text

The estimated time of arrival is 2.40pm.

Slide 36

Slide 36 text

The estimated time of arrival is 2.40pm. There's been a delay.

Slide 37

Slide 37 text

The estimated time of arrival is 2.40pm. There's been a delay.

Slide 38

Slide 38 text

Virtual DOM + aria-atomic

Slide 39

Slide 39 text

The estimated time of arrival is {time}. {delayMessage}

Slide 40

Slide 40 text

The estimated time of arrival is {time}. {delayMessage}

Slide 41

Slide 41 text

The estimated time of arrival is 2.40pm. There's been a delay.

Slide 42

Slide 42 text

Double announcers

Slide 43

Slide 43 text

{message1}

Slide 44

Slide 44 text

{message1}
{message2}

Slide 45

Slide 45 text

Slide 46

Slide 46 text

The estimated time of arrival is 2.30pm.

Slide 47

Slide 47 text

The estimated time of arrival is 2.40pm. There's been a delay.

Slide 48

Slide 48 text

Cancelled. Find alternative transport.

Slide 49

Slide 49 text

https://github.com/dequelabs/ngA11y https://github.com/AlmeroSteyn/react-aria-live https://github.com/Jinjiang/vue-a11y-utils Double announcer packages

Slide 50

Slide 50 text

Test

Slide 51

Slide 51 text

DIVs for everything
$

Slide 52

Slide 52 text

Semantic markup #

Slide 53

Slide 53 text

CSS animations (written without React) .my-node-enter { opacity: 1; transition: opacity 200ms; } .my-node-exit { opacity: 0; transition: opacity 200ms; } $

Slide 54

Slide 54 text

.my-node-enter { opacity: 0; } .my-node-enter-active { opacity: 1; transition: opacity 200ms; } .my-node-exit { opacity: 1; } .my-node-exit-active { opacity: 0; transition: opacity 200ms; } CSS animations (written for React) #

Slide 55

Slide 55 text

{message}

Slide 56

Slide 56 text

{showNotification ? {message} : null } $

Slide 57

Slide 57 text

Web Speech API: speech synthesis

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

let synth = window.speechSynthesis; if (window.SpeechSynthesisUtterance) { let utterThis = new SpeechSynthesisUtterance("notevole"); synth.speak(utterThis); }

Slide 61

Slide 61 text

let synth = window.speechSynthesis; if (window.SpeechSynthesisUtterance) { let utterThis = new SpeechSynthesisUtterance("notevole"); synth.speak(utterThis); }

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Constraints and creativity

Slide 64

Slide 64 text

Questions? Diana MacDonald | @DiDoesDigital HK Grotesk™ is an open source sans serif typeface by Hanken Design Co.
 Iosevka is an open source monospace typeface by Belleve Invis See DiDoesDigital.com for the slides and the book