Overview
Jank is the enemy. Our humble browsers, for historical reasons, put their primary JavaScript execution and UI rendering on the same thread. This is the cause of much sadness. Enter Web Workers, the oft-ignored, well-supported threading solution for client-side JavaScript! I will cover the basics of Web Workers, and go on to show how to use existing programming patterns to ease communication between the main thread and the Web Worker environment.
Objective
Introduce the oft-overlooked Web Workers and get people excited about using them!
Assumed Knowledge
Client-side JavaScript, asynchronous programming, Promises a plus.
Five Things You’ll Learn
- Web Workers
- Message Passing
- The Structured Clone Algorithm
- Basic Threading
- Remote Procedure Calls