Slide 1

Slide 1 text

@ChrisFerdinandi GoMakeThings.com A simpler, faster world-wide web THE LEAN WEB

Slide 2

Slide 2 text

MESS The web is a

Slide 3

Slide 3 text

fix it How to

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Chris Ferdinandi GoMakeThings.com

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

https://vanillajsguides.com

Slide 8

Slide 8 text

Vanilla JS Academy https://vanillajsacademy.com

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Started from the bottom, now we here

Slide 12

Slide 12 text

HTML CSS WordPress

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

=>

Slide 15

Slide 15 text

powerful native features ease of use the sweet spot

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

“My biggest challenge is keeping up.

Slide 19

Slide 19 text

A push for simplicity

Slide 20

Slide 20 text

Is there a conference for web developers that specifically caters to “lean web” (don’t use JS if not necessary etc.)? — Thomas Fuchs https://twitter.com/thomasfuchs/status/925341886944038914

Slide 21

Slide 21 text

Start End 1 Modern best practices (and why they’re bad) New best practices 3 How we got here 2

Slide 22

Slide 22 text

Modern Best Practices (and why they’re bad) 1

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Modern Best Practice JavaScript Frameworks

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

var data = { todos: [ { item: 'Adopt a puppy', completed: true }, { item: 'Buy dog food and a dog bed', completed: false } ], username: 'Chris' };

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

if (data.todos.length > 0) { // create list items } else { return 'You don\'t have any todos yet. Please add one.' }

Slide 31

Slide 31 text

Fewer Bugs

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Modern Web Problem Performance

Slide 34

Slide 34 text

JavaScript at Scale

Slide 35

Slide 35 text

Fewer Bugs

Slide 36

Slide 36 text

Loading…

Slide 37

Slide 37 text

https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4

Slide 38

Slide 38 text

JavaScript blocks rendering

Slide 39

Slide 39 text

Which has a better 
 First Meaningful Paint time? ① a raw 8.5MB HTML file with the full text of every single one of my 27,506 tweets ② a client rendered React site with exactly one tweet on it https://twitter.com/zachleat/status/1169998370041208832

Slide 40

Slide 40 text

https://twitter.com/zachleat/status/1169998370041208832 (Spoiler: @____lighthouse reports 8.5MB of HTML wins by about 200ms) — Zach Leatherman

Slide 41

Slide 41 text

Frameworks are really bad for performance

Slide 42

Slide 42 text

https://css-tricks.com/radeventlistener-a-tale-of-client-side-framework-performance/

Slide 43

Slide 43 text

Modern Best Practice Package Managers & Module Bundlers

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Dependency Management

Slide 46

Slide 46 text

Tree Shaking

Slide 47

Slide 47 text

Modern Web Problem High Setup & Maintenance Cost

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

npm install | npm run

Slide 51

Slide 51 text

https://twitter.com/sodevious/status/1126300690530357253 ah webpack, javascript –– turning a 1 hour project setup into an 8 hour affair — Nicole Dominguez

Slide 52

Slide 52 text

Modern Best Practice Everything-in-JS

Slide 53

Slide 53 text

JSS Team-Based Code

Slide 54

Slide 54 text

.callout { background-color: slategray; font-size: 2em; };
Hi there!

Slide 55

Slide 55 text

var callout = { backgroundColor: 'slategray', fontSize: '2em' };
Hi there!

Slide 56

Slide 56 text

Hi there!

Slide 57

Slide 57 text

import React, { Component } from 'react'; import Button from ‘./Button'; class DangerButton extends Component { render() { return ; } } export default DangerButton;

Slide 58

Slide 58 text

Click Me

Slide 59

Slide 59 text

Modern Web Problem Gatekeeping

Slide 60

Slide 60 text

Here’s a straw-man composite from several recent conversations: These tools let us move faster. Because we can iterate faster we’re delivering better experiences. — Alex Russell https://infrequently.org/2018/09/the-developer-experience-bait-and-switch/

Slide 61

Slide 61 text

Complex tools create barriers to entry

Slide 62

Slide 62 text

https://rianrietveld.com/2018/10/09/i-have-resigned-the-wordpress-accessibility-team/

Slide 63

Slide 63 text

329 page accessibility audit https://wpcampus.org/2019/05/gutenberg-audit-results/

Slide 64

Slide 64 text

91 accessibility-related bugs https://wpcampus.org/2019/05/gutenberg-audit-results/

Slide 65

Slide 65 text

Here’s a straw-man composite from several recent conversations: These tools let us move faster. Because we can iterate faster we’re delivering better experiences. — Alex Russell https://infrequently.org/2018/09/the-developer-experience-bait-and-switch/

Slide 66

Slide 66 text

Modern Best Practice Single Page Apps (SPAs)

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

A Vicious Circle

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

Modern Web Problem Fragility

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

People don’t (usually) browse the web with JS disabled

Slide 74

Slide 74 text

https://www.inc.com/jason-aten/cloudflare-outage-takes-down-internet-for-second-time-in-a-week-heres-how-companys-ceo-responded.html

Slide 75

Slide 75 text

Firewalls & Ad Blockers

Slide 76

Slide 76 text

Files Timeout

Slide 77

Slide 77 text

13 million requests for JavaScript timeout on Buzzfeed per month Ian Feather via https://twitter.com/philhawksworth/status/990890920672456707

Slide 78

Slide 78 text

Lost Connectivity

Slide 79

Slide 79 text

Bugs

Slide 80

Slide 80 text

Slide 81

Slide 81 text

.hero { bg-color: #f7f7f7; width: 100%; }

Slide 82

Slide 82 text

var doubleIt = function (num) { return nmu * 2; };

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

How did we get here? 2

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

The Web Platform

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

===

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

“I build apps, not websites.

Slide 94

Slide 94 text

“Vanilla JS doesn’t scale.

Slide 95

Slide 95 text

“CSS isn’t a real programming language.

Slide 96

Slide 96 text

!==

Slide 97

Slide 97 text

Source: www.lukew.com

Slide 98

Slide 98 text

=*(

Slide 99

Slide 99 text

Lean Web Principles 3

Slide 100

Slide 100 text

Become a developer dinosaur

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

Lean Web Principle Embrace the Platform

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

// jQuery $('#app').addClass('awesome'); // Vanilla JS document.querySelector('#app') .classList.add('awesome');

Slide 105

Slide 105 text

// JSX var name = 'Josh Perez'; var element =

Hello, {name}

; ReactDOM.render( element, document.getElementById('root') );

Slide 106

Slide 106 text

// Vanilla JS var name = 'Josh Perez'; var element = `

Hello, ${name}

`; document.getElementById('root') .innerHTML = element;

Slide 107

Slide 107 text

HTML > JavaScript

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

CSS > JavaScript

Slide 111

Slide 111 text

https://daneden.github.io/animate.css/

Slide 112

Slide 112 text

https://github.com/cferdinandi/smooth-scroll

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

Homepage Login Dashboard Account

Slide 116

Slide 116 text

You still render HTML with JavaScript (but just the dynamic parts)

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

The JAM Stack JavaScript, APIs, & prerender Markup

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

No content

Slide 123

Slide 123 text

What about subsequent page loads?

Slide 124

Slide 124 text

Service Workers

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

Lean Web Principle Small & Modular

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

https://api.jqueryui.com/tabs/

Slide 130

Slide 130 text

https://github.com/cferdinandi/tabby

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

https://viperhtml.js.org/hyperhtml/documentation/

Slide 133

Slide 133 text

https://preactjs.com/

Slide 134

Slide 134 text

https://svelte.dev/

Slide 135

Slide 135 text

var callout = { backgroundColor: 'slategray', fontSize: '2em' };
Hi there!

Slide 136

Slide 136 text

Hi there!

Slide 137

Slide 137 text

Object-Oriented CSS Legos for front end developers

Slide 138

Slide 138 text

.bg-gray { background-color: slategray; }; .text-large { font-size: 2em; }
Hi there!

Slide 139

Slide 139 text

https://www.slideshare.net/stubbornella/object-oriented-css

Slide 140

Slide 140 text

Lean Web Principle The Web is for Everyone

Slide 141

Slide 141 text

The modern web is doesn’t work for everyone.

Slide 142

Slide 142 text

No content

Slide 143

Slide 143 text

Polyfills

Slide 144

Slide 144 text

if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; }

Slide 145

Slide 145 text

if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; }

Slide 146

Slide 146 text

if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; }

Slide 147

Slide 147 text

https://polyfill.io

Slide 148

Slide 148 text

Build in layers (Progressive Enhancement)

Slide 149

Slide 149 text

My Latest Projects on GitHub • Smooth Scroll • Reef • AtomicJS • Bouncer

Slide 150

Slide 150 text

View my projects on GitHub

Slide 151

Slide 151 text

My Latest Projects on GitHub • Smooth Scroll • Reef • AtomicJS • Bouncer

Slide 152

Slide 152 text

View my projects on GitHub

Slide 153

Slide 153 text

No content

Slide 154

Slide 154 text

The web is inclusive out-of-the-box

Slide 155

Slide 155 text

https://webaim.org/projects/million/

Slide 156

Slide 156 text

https://a11yproject.com/

Slide 157

Slide 157 text

Do any companies actually use Lean Web principles? (yes they do!)

Slide 158

Slide 158 text

GitHub https://githubengineering.com/removing-jquery-from-github-frontend/

Slide 159

Slide 159 text

Build websites like its 2005. — Keith Cirkel

Slide 160

Slide 160 text

Netflix https://medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9

Slide 161

Slide 161 text

Basecamp & Hey https://twitter.com/sstephenson/status/1272608117604397063

Slide 162

Slide 162 text

Wrapping Up 4

Slide 163

Slide 163 text

1. Embrace the Platform 2. Small & Modular 3. The Web is for Everyone Lean Web Principles

Slide 164

Slide 164 text

Become a developer dinosaur

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

No content