JAVASCRIPT/WEB TOOLING NOW AND TOMORROW Chris Heilmann (@codepo8) February 2021 aka.ms/js-web-tooling
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
Evergreen browsers
WE’RE IN GOOD SHAPE THOUGH
Good Platform adoption
Open, extensible editors
Hosting with version control/hooks
Framework-a-minute
Slide 4
WAIT… WHAT IS ALL THIS???
Slide 5
DISAPPOINTING CONSIDERING OUR STATE OF TOOLING AND DOCUMENTATION
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
CONFUSING FOR BEGINNERS…
Slide 8
THE TRINITY OF WEB DEVELOPMENT
Editor/IDE
Development
Browser
Testing and Tweaking
Terminal
CI/CD, Version Contol, Build scripts
Slide 9
Editor/IDE
AN OPPORTUNITY TO GET BOGGED DOWN IN CUSTOMISATION
Browser
Terminal
Web Product
Slide 10
Editor/IDE
AN ENDLESS CYCLE OF CONTEXT SWITCHING
Browser
Terminal
Web Product
Slide 11
Editor/IDE Browser
AND THE FORGOTTEN PART…
Terminal
Learning
(documentation, examples, best practices)
Web Product
Slide 12
DEVELOPER TOOLS SHOULDN’T REQUIRE EXPERT KNOWLEDGE. USING THEM SHOULD MAKE YOU AN EXPERT OVER TIME.
Slide 13
BEST PRACTICES AND DOCUMENTATION SHOULD BE PART OF THE TOOL, NOT SOMETHING YOU NEED TO FIND ELSEWHERE.
Slide 14
LET’S GET ONTO THE JOURNEY…
Slide 15
NOISE REDUCTION
Slide 16
CONSOLE FILTERING
Slide 17
ISSUE REPORTING
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
https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/issues/
ISSUES BY TYPE, OPTION TO EXCLUDE 3RD PARTY ISSUES
Slide 20
IN-CONTEXT DOCUMENTATION WITH “LEARN MORE” LINKS…
Slide 21
MISTAKE PREVENTION
Slide 22
WEBHINT IN VISUAL STUDIO CODE PANEL
Slide 23
LIVE LINTING IN CODE
Slide 24
LITTLE TOUCHES THAT GO A LONG WAY…
Slide 25
LITTLE TOUCHES THAT GO A LONG WAY…
Slide 26
VISUAL TOOLS AND WORKFLOWS
Slide 27
VISUAL GUIDES AND SOURCE INDICATORS (CSS GRID)
Slide 28
VISUAL GUIDES AND SOURCE INDICATORS (CSS FLEXBOX)
Slide 29
VISUAL GUIDES AND SOURCE INDICATORS (CSS FLEXBOX)
Slide 30
VISUAL GUIDES AND SOURCE INDICATORS (WEB TYPOGRAPHY)
Slide 31
MAKING IT EASIER TO GO DEEPER
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
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
DOM BREAKPOINTS
Slide 35
DOM BREAKPOINTS
Slide 36
DOM BREAKPOINTS
Slide 37
DOM BREAKPOINTS
Slide 38
DOM BREAKPOINTS
Slide 39
DOM BREAKPOINTS
Slide 40
AVOIDING CONTEXT SWITCHING
Slide 41
2/24/21
CHRIS HEILMANN - CODEPO8
41
Slide 42
2/24/21
CHRIS HEILMANN - CODEPO8
42
Slide 43
2/24/21
CHRIS HEILMANN - CODEPO8
43
Slide 44
BROWSERS CAN BE AUTOMATED… developer.microsoft.com/enus/microsoft-edge/tools/webdriver/
Slide 45
BROWSERS CAN BE EMBEDDED… docs.microsoft.com/en-us/microsoftedge/webview2/
Slide 46
VISUAL STUDIO CODE ALLOWS FOR EXTENSIONS… code.visualstudio.com/api
Slide 47
SO, WHY DON’T WE MERGE THE TWO?
Slide 48
MICROSOFT EDGE TOOLS FOR VS CODE aka.ms/devtools-for-code
Slide 49
aka.ms/devtools-for-code
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
ANOTHER CONTEXT?
Slide 52
NETWORK INSPECTION NOT ENOUGH? aka.ms/networkconsole
Slide 53
Slide 54
WANT TO LOOK UNDER THE HOOD?
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
Activate the … menu and Select “Undock into separate window” 2/24/21
CHRIS HEILMANN - CODEPO8
56
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
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
Lots of fun bits to discover (and report if you find a problem)
2/24/21
CHRIS HEILMANN - CODEPO8
59
Slide 60
WHAT’S NEXT? YOU TELL US!
github.com/microsoft/vscode-edge-devtools