Jake Archibald on the web browser event loop, setTimeout, micro tasks, requestAnimationFrame, ...
Why Hacker News recommends it
HN treats it as the best primer on the event loop, praising its entertaining, easy-to-grasp visual explanations.
What it is
Jake Archibald's JSConf.Asia 2018 talk "In the Loop" explains the browser event loop, covering tasks, microtasks, requestAnimationFrame, and how rendering interleaves with JavaScript. It uses visual walkthroughs to show why code runs in surprising orders and why setTimeout fixes are unreliable.
Recommended by 7 HN commenters across 6 different months, 2018 to 2023.
What Hacker News said
Strong rec wattengard · 2018-10 · on “Ask HN: What are some of the best technical talks you've heard?”
Jake Archibald talking about the javascript event loop and actually making it both entertaining and easily grokable! [this video]
Strong rec olavgg · 2018-10 · on “Ask HN: What are some of the best technical talks you've heard?”
Jake Archibald's "In the Loop", Visual explanation of how the javascript event loop works! Awesome video for every javascript developer. [this video]
Strong rec phist_mcgee · 2020-11 · on “How does the event loop work in JavaScript? [video]”
The best primer for the event loop I have found is here: [this video] The speaker (Jake Archibald) has that rare ability to be both likeable and relatable, while also being incredibly knowledgeable and enthusiastic. I wish a lot more talks were like this!
Recommends mxschumacher · 2018-07 · on “Ask HN: What you wish you'd known before getting into JavaScript?”
Be sure to understand the event loop. Javascript as an asynchronous language often comes back to bite beginners. Here are two great talks to help you: [this video] [LINK] Your life will be easier if you learn to use Chrome Dev tools (or the Firefox equivalent) early. In the beginning, you don't have to worry about browser compatibility - embrace modern JS (ES6+)!
Recommends luuuzeta · 2022-11 · on “Ask HN: Do you recall any book or course that made a topic finally click?”
I've been struggling with wrapping my head around asynchronous programming with callbacks, promises and async/await in JS, however I think it's finally clicking after watching these YouTube videos and creating a document where I explain these concepts as if I'm teaching them to someone else: * Philip Roberts's What the heck is the event loop anyway? - [LINK] * The Story of Asynchronous JavaScript - [LINK] * JavaScript Callbacks, Promises, and Async / Await Explained - [LINK] * Async Javascript Tutorial For Beginners (Callbacks, Promises, Async Await). - [LINK] * Jake Archibald: In The Loop - setTimeout, micro tasks, requestAnimationFrame, requestIdleCallback, - [this video] Edit... I've been rewa
Recommends cassepipe · 2023-07 · on “How to think about `async`/`await` in Rust”
Coming from C and having used thread and being totally ignorant to javascript, this article really helped me grasp async in js by clearing away implicit misconceptions I held : [LINK] And also that talk on the event loop : [this video]
Recommends mananaysiempre · 2023-10 · on “Populating the page: how browsers work”
> It basically flickers between tasks very rapidly to simulate concurrency. That’s usually used a description of preemptive multitasking, like what you get running a modern OS on a single core (on multiple cores it’s also this but on each core). Every once in a small while, the current task is made to inhale chloroform, another task is chosen to wake and takes its place. Pro: you can’t hang any given task from a single thread; con: shared memory is very difficult to impossible, as you never know when you’ll be interrupted. Browser JavaScript and UI interactions instead use cooperative multitasking, which you’ll also find in classic Mac OS, 16-bit Windows, basically every embedded system ever
Cites memco · 2019-05 · on “Release Notes for Safari Technology Preview 81”
Just rewatched this talk on Monday from last year where Safari was called out for the rAF behavior that was fixed here. Cool to see this change. [this video]