Loupe is a little visualisation to help you understand how JavaScript's call stack/event loop/callback queue interact with each other.
- Loupe runs entirely in your browser.
- It takes your code.
- Runs it through esprima, a JS parser.
- Instruments it a bunch so that loupe knows where function calls, timeouts, dom events, etc happen.
- Adds a whole bunch of while loops everywhere to slow down the code as it runs.
- This modified code is then turned back into JavaScript and sent to a webworker (in your browser) which runs it.
- As it runs, the instrumentation sends messages to the visualisation about what is going on so it can animate things at the right time.
- It also has some extra magic to make dom events, and timers work properly.
Your new post is loading...