JavaScript/Web tooling now and tomorrow

A presentation at JSWorld Conference in February 2021 in Amsterdam, Netherlands by Chris Heilmann

Slide 1

Slide 1

JAVASCRIPT/WEB TOOLING NOW AND TOMORROW Chris Heilmann (@codepo8) February 2021 aka.ms/js-web-tooling

Slide 2

Slide 2

THE WEB DEBUGGING JOURNEY HAS BEEN ROUGH… alert() document.write() Windows script debugger/Microsoft Script Editor (Douglas Crockford only) Firebug Developer Tools in browsers

Slide 3

Slide 3

Evergreen browsers WE’RE IN GOOD SHAPE THOUGH Good Platform adoption Open, extensible editors Hosting with version control/hooks Framework-a-minute

Slide 4

Slide 4

WAIT… WHAT IS ALL THIS???

Slide 5

Slide 5

DISAPPOINTING CONSIDERING OUR STATE OF TOOLING AND DOCUMENTATION

Slide 6

Slide 6

LOTS OF REASONS… Forgiving browsers Forgiving languages Full Stackoverflow Development Third party interference (ad packages, tracking) Platform-by-committee Focus on high-impact audience Developer tools are overwhelming

Slide 7

Slide 7

CONFUSING FOR BEGINNERS…

Slide 8

Slide 8

THE TRINITY OF WEB DEVELOPMENT Editor/IDE Development Browser Testing and Tweaking Terminal CI/CD, Version Contol, Build scripts

Slide 9

Slide 9

Editor/IDE AN OPPORTUNITY TO GET BOGGED DOWN IN CUSTOMISATION Browser Terminal Web Product

Slide 10

Slide 10

Editor/IDE AN ENDLESS CYCLE OF CONTEXT SWITCHING Browser Terminal Web Product

Slide 11

Slide 11

Editor/IDE Browser AND THE FORGOTTEN PART… Terminal Learning (documentation, examples, best practices) Web Product

Slide 12

Slide 12

DEVELOPER TOOLS SHOULDN’T REQUIRE EXPERT KNOWLEDGE. USING THEM SHOULD MAKE YOU AN EXPERT OVER TIME.

Slide 13

Slide 13

BEST PRACTICES AND DOCUMENTATION SHOULD BE PART OF THE TOOL, NOT SOMETHING YOU NEED TO FIND ELSEWHERE.

Slide 14

Slide 14

LET’S GET ONTO THE JOURNEY…

Slide 15

Slide 15

NOISE REDUCTION

Slide 16

Slide 16

CONSOLE FILTERING

Slide 17

Slide 17

ISSUE REPORTING

Slide 18

Slide 18

WEBHINT: TESTING AND BEST PRACTICES Testing tool to check web projects for: § Accessibility issues § Performance problems § App readiness § Compatibility with standards § Common pitfalls to avoid § Security issues Online service (webhint.io) or NPM package to integrate in other tools Highly customisable

Slide 19

Slide 19

https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/issues/ ISSUES BY TYPE, OPTION TO EXCLUDE 3RD PARTY ISSUES

Slide 20

Slide 20

IN-CONTEXT DOCUMENTATION WITH “LEARN MORE” LINKS…

Slide 21

Slide 21

MISTAKE PREVENTION

Slide 22

Slide 22

WEBHINT IN VISUAL STUDIO CODE PANEL

Slide 23

Slide 23

LIVE LINTING IN CODE

Slide 24

Slide 24

LITTLE TOUCHES THAT GO A LONG WAY…

Slide 25

Slide 25

LITTLE TOUCHES THAT GO A LONG WAY…

Slide 26

Slide 26

VISUAL TOOLS AND WORKFLOWS

Slide 27

Slide 27

VISUAL GUIDES AND SOURCE INDICATORS (CSS GRID)

Slide 28

Slide 28

VISUAL GUIDES AND SOURCE INDICATORS (CSS FLEXBOX)

Slide 29

Slide 29

VISUAL GUIDES AND SOURCE INDICATORS (CSS FLEXBOX)

Slide 30

Slide 30

VISUAL GUIDES AND SOURCE INDICATORS (WEB TYPOGRAPHY)

Slide 31

Slide 31

MAKING IT EASIER TO GO DEEPER

Slide 32

Slide 32

You can set breakpoints in the editor in the browser BREAKPOINTS > CONSOLE.LOG() 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.

Slide 33

Slide 33

BREAKPOINTS > CONSOLE.LOG() • Your code execution is paused – errors can’t slip though • 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

Slide 34

Slide 34

DOM BREAKPOINTS

Slide 35

Slide 35

DOM BREAKPOINTS

Slide 36

Slide 36

DOM BREAKPOINTS

Slide 37

Slide 37

DOM BREAKPOINTS

Slide 38

Slide 38

DOM BREAKPOINTS

Slide 39

Slide 39

DOM BREAKPOINTS

Slide 40

Slide 40

AVOIDING CONTEXT SWITCHING

Slide 41

Slide 41

2/24/21 CHRIS HEILMANN - CODEPO8 41

Slide 42

Slide 42

2/24/21 CHRIS HEILMANN - CODEPO8 42

Slide 43

Slide 43

2/24/21 CHRIS HEILMANN - CODEPO8 43

Slide 44

Slide 44

BROWSERS CAN BE AUTOMATED… developer.microsoft.com/enus/microsoft-edge/tools/webdriver/

Slide 45

Slide 45

BROWSERS CAN BE EMBEDDED… docs.microsoft.com/en-us/microsoftedge/webview2/

Slide 46

Slide 46

VISUAL STUDIO CODE ALLOWS FOR EXTENSIONS… code.visualstudio.com/api

Slide 47

Slide 47

SO, WHY DON’T WE MERGE THE TWO?

Slide 48

Slide 48

MICROSOFT EDGE TOOLS FOR VS CODE aka.ms/devtools-for-code

Slide 49

Slide 49

aka.ms/devtools-for-code

Slide 50

Slide 50

WHAT YOU CAN DO NOW… • Inspect, edit and tweak the DOM structure of the product you build using the tools • Inspect Network requests • Interact with the browser inside VS Code • Sync changes with your code (setting up Sourcemaps/Watchers) • Choose the version of Edge you want to have in the tool • Choose an own browser window or a headless version (embedded in the extension)

Slide 51

Slide 51

ANOTHER CONTEXT?

Slide 52

Slide 52

NETWORK INSPECTION NOT ENOUGH? aka.ms/networkconsole

Slide 53

Slide 53

Slide 54

Slide 54

WANT TO LOOK UNDER THE HOOD?

Slide 55

Slide 55

Open Developer Tools (CMD+SHIFT+I on Mac or F12/CTRL+SHIFT+I on Windows) 2/24/21 CHRIS HEILMANN - CODEPO8 55

Slide 56

Slide 56

Activate the … menu and Select “Undock into separate window” 2/24/21 CHRIS HEILMANN - CODEPO8 56

Slide 57

Slide 57

Developer Tools Are now “fullscreen” Open Developer Tools again… (CMD+SHIFT+I on Mac or F12/CTRL+SHIFT+I on Windows) 2/24/21 CHRIS HEILMANN - CODEPO8 57

Slide 58

Slide 58

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)} 2/24/21 CHRIS HEILMANN - CODEPO8 58

Slide 59

Slide 59

Lots of fun bits to discover (and report if you find a problem) 2/24/21 CHRIS HEILMANN - CODEPO8 59

Slide 60

Slide 60

WHAT’S NEXT? YOU TELL US! github.com/microsoft/vscode-edge-devtools

Slide 61

Slide 61

DETAILED DEVELOPER TOOLS EXPLAINERS github.com/MicrosoftEdge/MSEdgeExplainers

Slide 62

Slide 62

THANKS! Zoher Ghadyali @ZGhadyali DEVELOPER TOOLS EDGE PM TEAM @EDGEDEVTOOLS Chris Heilmann @codepo8 Erica Draud @hiamerica Rachel Weil @partytimeHXLNT Brendyn Alexander @webrendyn