Adventures in Browser tooling

A presentation at JavaScript Remote Conf in May 2020 in by Chris Heilmann

Slide 1

Slide 1

Adventures in Browser tooling 5/14/20 Chris Heilmann - codepo8 1

Slide 2

Slide 2

$ whoami 5/14/20 § Chris Heilmann @codepo8 – he/him/his § Principal Program Manager Microsoft Developer Experience (VSCode, Devtools…) § W3C Member § 20 years web developer § eToys, Agilisys, Yahoo, Mozilla… § Wrote 3 books, contributed to 10(?)… § Blogged since 2004, loud on Twitter Chris Heilmann - codepo8 2

Slide 3

Slide 3

Minding the gap… 5/14/20 Chris Heilmann - codepo8 3

Slide 4

Slide 4

A demands gap… 🦄 Useful, effective and pretty amazing things in devtools What we demand of the web… What we use day to day… 5/14/20 Chris Heilmann - codepo8 4

Slide 5

Slide 5

An assumptions gap… Build it! 5/14/20 Ship it! Great success! Chris Heilmann - codepo8 5

Slide 6

Slide 6

Our products should: § work independent of device and operating system The web isn’t a native platform § still cater to users of older devices and environments § not make any assumptions § be customizable by our users § have a longer lifetime than the current state of technology 5/14/20 Chris Heilmann - codepo8 6

Slide 7

Slide 7

Realities of great software projects… Research 5/14/20 Design Develop Deploy Monitor Chris Heilmann - codepo8 7

Slide 8

Slide 8

My audience: developers 5/14/20 Chris Heilmann - codepo8 8

Slide 9

Slide 9

Different developers, different needs 5/14/20 Chris Heilmann - codepo8 9

Slide 10

Slide 10

“This is a job” developer I work for a company that defines our tools and computer setup. I know there are probably better things out there, but as I don’t get to use them at work, why bother learning them? 5/14/20 Chris Heilmann - codepo8 10

Slide 11

Slide 11

The “switched on” developer It is frustrating that there are still people out there with old computers and outdated browsers. With a library I can support them as I’d rather learn and try out new things. 5/14/20 Chris Heilmann - codepo8 11

Slide 12

Slide 12

The “I am here to deliver” developer My clients don’t pay extra for fancy new technology. They need to get something that works on their machines. It needs to be legally compliant, you know, accessible so they can’t be sued. That’s why I use a framework. 5/14/20 Chris Heilmann - codepo8 12

Slide 13

Slide 13

The “the web is broken” developer I’ve always worked with higher programming languages and rich UI environments. The web seems like a mess and I don’t want to spend time trying to guess what the outcome of my code is. 5/14/20 Chris Heilmann - codepo8 13

Slide 14

Slide 14

The “I’m here to learn” developer I just started as a web developer and wherever I look, I am confused. There is so much information and often people give contradicting advice. I just want to learn the right thing… 5/14/20 Chris Heilmann - codepo8 14

Slide 15

Slide 15

§ The caring developer is a tiny fraction of the market § For many, this is a job to make a living Somehow bitter pills to swallow… 5/14/20 § New developers don’t find an empathic, open world, but an avalanche of choice and opinions § Satisfying developer needs has no direct correlation to creating better user products Chris Heilmann - codepo8 15

Slide 16

Slide 16

§ Constant change in the developer space is a double-edged sword Tech innovation isn’t the answer 5/14/20 § We empower a small group of highly motivated people at the cost of overwhelming others § We don’t find out about real problems as we don’t ask people outside our bubble Chris Heilmann - codepo8 16

Slide 17

Slide 17

§ Security § Privacy § Performance Why are things “slow”? 5/14/20 § Maintainability § Ownership § Backwards compatibility Chris Heilmann - codepo8 17

Slide 18

Slide 18

Browsers for developers § Consumption and creation platform § App platform (Progressive Web Apps, Electron…) § Test platform (Automation with Puppeteer / Playwright) § Preview of technology of the web to come (Beta, Canary, Developer builds, flags, origin trials) 5/14/20 Chris Heilmann - codepo8 18

Slide 19

Slide 19

Why do we need web standards? § Predictability of code outcome § Prevention of monopolies § Quality control – if your code validates the issue must be somewhere else § Maintainability, backwards compatibility and future readiness. 5/14/20 Chris Heilmann - codepo8 19

Slide 20

Slide 20

Web standards are an agreement § They used to be pretty academic § Nowadays they are informed by use and needs of developers and users collected by browser makers and developers § Discussions happen in the open and you are welcome to join 5/14/20 Chris Heilmann - codepo8 20

Slide 21

Slide 21

Usage gap Useful, effective and pretty amazing things in devtools What we use day to day… 5/14/20 Chris Heilmann - codepo8 21

Slide 22

Slide 22

Editor in the browser… 5/14/20 Chris Heilmann - codepo8 22

Slide 23

Slide 23

Editor in the browser… 5/14/20 Chris Heilmann - codepo8 23

Slide 24

Slide 24

Upgrading your dev experience… 5/14/20 Chris Heilmann - codepo8 24

Slide 25

Slide 25

§ You can set breakpoints in the editor in the browser Breakpoints > console.log() 5/14/20 § You can also set breakpoints in your text editor (f.e. Visual Studio Code) § They are more work upfront than a console.log() - but worth it. Chris Heilmann - codepo8 25

Slide 26

Slide 26

§ Your code execution is paused – errors can’t slip though Breakpoints > console.log() 5/14/20 § You get an end-to-end picture of what is happening § You are not likely to litter the web with yet another console message that end users should never see Chris Heilmann - codepo8 26

Slide 27

Slide 27

DOM breakpoints! 5/14/20 Chris Heilmann - codepo8 27

Slide 28

Slide 28

DOM breakpoints? 5/14/20 Chris Heilmann - codepo8 28

Slide 29

Slide 29

Breakpoints > console.log() 5/14/20 Chris Heilmann - codepo8 29

Slide 30

Slide 30

DOM breakpoints! 5/14/20 Chris Heilmann - codepo8 30

Slide 31

Slide 31

DOM breakpoints! 5/14/20 Chris Heilmann - codepo8 31

Slide 32

Slide 32

DOM breakpoints! 5/14/20 Chris Heilmann - codepo8 32

Slide 33

Slide 33

Breakpoints > console.log() 5/14/20 Chris Heilmann - codepo8 33

Slide 34

Slide 34

No need for a mouse! 5/14/20 Chris Heilmann - codepo8 34

Slide 35

Slide 35

More visual tooling? 5/14/20 Chris Heilmann - codepo8 35

Slide 36

Slide 36

Animation Editor 5/14/20 Chris Heilmann - codepo8 36

Slide 37

Slide 37

3D View 5/14/20 Chris Heilmann - codepo8 37

Slide 38

Slide 38

Easy to miss extra features… 5/14/20 Chris Heilmann - codepo8 38

Slide 39

Slide 39

Colour Picker 5/14/20 Chris Heilmann - codepo8 39

Slide 40

Slide 40

Shadow Editor 5/14/20 Chris Heilmann - codepo8 40

Slide 41

Slide 41

§ CSS Grid tooling § Font tooling Currently in production: 5/14/20 § Service Worker lifecycle visualization § ??? (you decide) Chris Heilmann - codepo8 41

Slide 42

Slide 42

Emulation 5/14/20 Chris Heilmann - codepo8 42

Slide 43

Slide 43

Device Mode 5/14/20 Chris Heilmann - codepo8 43

Slide 44

Slide 44

Device Mode 5/14/20 Chris Heilmann - codepo8 44

Slide 45

Slide 45

More features of Device Emulation 5/14/20 Chris Heilmann - codepo8 45

Slide 46

Slide 46

Media Queries 5/14/20 Chris Heilmann - codepo8 46

Slide 47

Slide 47

Screen Ruler 5/14/20 Chris Heilmann - codepo8 47

Slide 48

Slide 48

Interaction emulation 5/14/20 Chris Heilmann - codepo8 48

Slide 49

Slide 49

Breakpoints > console.log() 5/14/20 Chris Heilmann - codepo8 49

Slide 50

Slide 50

Rendering menu 5/14/20 Chris Heilmann - codepo8 50

Slide 51

Slide 51

Rendering menu 5/14/20 Chris Heilmann - codepo8 51

Slide 52

Slide 52

5/14/20 Chris Heilmann - codepo8 52

Slide 53

Slide 53

Accessibility concerns 5/14/20 Chris Heilmann - codepo8 53

Slide 54

Slide 54

5/14/20 Chris Heilmann - codepo8 54

Slide 55

Slide 55

5/14/20 Chris Heilmann - codepo8 55

Slide 56

Slide 56

5/14/20 Chris Heilmann - codepo8 56

Slide 57

Slide 57

Pro tip: CMD+SHIFT+P 5/14/20 Chris Heilmann - codepo8 57

Slide 58

Slide 58

§ Developer tools are keyboard and screenreader accessible Already shipped: 5/14/20 § Developer tools work in high contrast mode Chris Heilmann - codepo8 58

Slide 59

Slide 59

§ High Contrast simulation § Simpler accessible interfaces Currently in production: 5/14/20 § Accessibility error reporting in context § Dual Screen Emulation Chris Heilmann - codepo8 59

Slide 60

Slide 60

Need for speed? 5/14/20 Chris Heilmann - codepo8 60

Slide 61

Slide 61

5/14/20 Chris Heilmann - codepo8 61

Slide 62

Slide 62

Browser task manager! 5/14/20 Chris Heilmann - codepo8 62

Slide 63

Slide 63

Where did my resources go? 5/14/20 Chris Heilmann - codepo8 63

Slide 64

Slide 64

Hat tip: also in Firefox! 5/14/20 Chris Heilmann - codepo8 64

Slide 65

Slide 65

How the sausage is made… 5/14/20 Chris Heilmann - codepo8 65

Slide 66

Slide 66

Innovation in the open… https://github.com/MicrosoftEdge/MSEdgeExplainers 5/14/20 Chris Heilmann - codepo8 66

Slide 67

Slide 67

Detailed developer tools explainers https://github.com/MicrosoftEdge/MSEdgeExplainers 5/14/20 Chris Heilmann - codepo8 67

Slide 68

Slide 68

Discussion amongst browser makers 5/14/20 Chris Heilmann - codepo8 68

Slide 69

Slide 69

Others join, too! https://github.com/WebKit/explainers 5/14/20 Chris Heilmann - codepo8 69

Slide 70

Slide 70

Popping the hood… 5/14/20 Chris Heilmann - codepo8 70

Slide 71

Slide 71

What are developer tools made of? 5/14/20 Chris Heilmann - codepo8 71

Slide 72

Slide 72

Open Developer Tools (CMD+SHIFT+I on Mac or F12/CTRL+SHIFT+I on Windows) 5/14/20 Chris Heilmann - codepo8 72

Slide 73

Slide 73

Activate the … menu and Select “Undock into separate window” 5/14/20 Chris Heilmann - codepo8 73

Slide 74

Slide 74

Developer Tools Are now “fullscreen” Open Developer Tools again… (CMD+SHIFT+I on Mac or F12/CTRL+SHIFT+I on Windows) 5/14/20 Chris Heilmann - codepo8 74

Slide 75

Slide 75

You now can debug the developer tools with developer tools (I changed to light mode to make it obvious which are which) while(🐢){go(deeper)} 5/14/20 Chris Heilmann - codepo8 75

Slide 76

Slide 76

Lots of fun bits to discover (and report if you find a problem) 5/14/20 Chris Heilmann - codepo8 76

Slide 77

Slide 77

§ Web Content? § Extensions? In-built reporting tool… 5/14/20 § Memory Leaks? § Long running processes? Chris Heilmann - codepo8 77

Slide 78

Slide 78

What makes me happy? 5/14/20 Chris Heilmann - codepo8 78

Slide 79

Slide 79

§ I like that we use web technology to build developer tools § This makes them embeddable into other software (VS Code is an Electron shell with Monaco inside) What are developer tools made of? 5/14/20 § It also allows us to build for the web on the web (CodePen, JSBin, Code Sandbox, Workspaces for GitHub) § It is fun to work in them as you have a predictable environment – we can test upcoming web tech there. Chris Heilmann - codepo8 79

Slide 80

Slide 80

Little touches that go a long way… 5/14/20 Chris Heilmann - codepo8 80

Slide 81

Slide 81

Little touches that go a long way… 5/14/20 Chris Heilmann - codepo8 81

Slide 82

Slide 82

§ Testing tool to check web projects for: § Accessibility issues § Performance problems § App readiness § Compatibility with standards Webhint: testing and best practices § Common pitfalls to avoid § Security issues § Online service (webhint.io) or node package to integrate in other tools § Highly customisable 5/14/20 Chris Heilmann - codepo8 82

Slide 83

Slide 83

§ Testing tool to check web projects for: § Accessibility issues § Performance problems § App readiness § Compatibility with standards Webhint in VS Code § Common pitfalls to avoid § Security issues § Online service (webhint.io) or node package to integrate in other tools § Highly customisable 5/14/20 Chris Heilmann - codepo8 83

Slide 84

Slide 84

§ Testing tool to check web projects for: § Accessibility issues § Performance problems § App readiness § Compatibility with standards Webhint: testing and best practices § Common pitfalls to avoid § Security issues § Online service (webhint.io) or node package to integrate in other tools § Highly customisable 5/14/20 Chris Heilmann - codepo8 84

Slide 85

Slide 85

§ VS Code is not only an editor, it also includes version control and a terminal Merging of tools 5/14/20 § This means I don’t have to jump from one context to another to debug § However… wouldn’t it me cool to have Devtools in VS Code? Chris Heilmann - codepo8 85

Slide 86

Slide 86

§ Edge/Chromium developer tools inside VS Code Devtools for Code § No need to switch to the browser to try a few things out § No need to replicate the same functionality in both places aka.ms/elements4code 5/14/20 Chris Heilmann - codepo8 86

Slide 87

Slide 87

§ Edge/Chromium developer tools inside VS Code Devtools for Code § No need to switch to the browser to try a few things out § No need to replicate the same functionality in both places aka.ms/elements4code 5/14/20 Chris Heilmann - codepo8 87

Slide 88

Slide 88

Thanks – your voice matters! Chris Heilmann @codepo8 @EdgeDevTools christianheilmann.com Click the feedback in Edge developer tools! 5/14/20 Chris Heilmann - codepo8 88