Vanilla JavaScript: Web Workers

Vanilla JavaScript: Web Workers

English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 1h 17m | 193 MB

Web Workers is one of the most underrated APIs on the web. It brings multithreading—the ability to execute multiple tasks simultaneously—to JavaScript. Multithreading with web workers can enhance the performance of complex apps with resource-intense code. This course show how to run parallel tasks with web workers and communicate those threads back to the main UI thread. Instructor Maximiliano Firtman explores the APIs for dedicated web workers and shared web workers, which allow you to share threads between browser tabs. The majority of the lessons use Vanilla JavaScript, which allows you to explore the full potential of the technology, but in the final chapter, Maximiliano also introduces some libraries and frameworks specifically designed for developing with web workers.

Topics include:

  • How threading works in JavaScript and web browsers
  • Creating dedicated workers
  • Creating shared workers
  • Creating basic workers
  • Sending messages to web workers
  • Optimizing app performance with web workers
  • Handling web worker errors
  • Using JavaScript libraries and frameworks for web workers
Table of Contents

Introduction
1 Increase web performance with web workers
2 What you should know

Threading in JavaScript
3 The problem with JavaScript and threads
4 Execute CPU-intense operations
5 How the browser works with threads
6 The workers family

Working with Web Workers
7 Create a dedicated worker
8 Life cycle of a dedicated worker
9 Create a shared worker
10 Life cycle of a shared worker
11 Creating subworkers
12 Import external scripts
13 Create basic workers
14 Debug with browser dev tools

Communication and Security
15 Send messages to dedicated workers
16 Improve the performance of our app
17 Update progress and import scripts
18 Send messages to shared workers
19 Copy vs. transferable objects
20 Handle worker errors

Libraries Frameworks and Ideas
21 Libraries for web workers
22 Decoding images
23 WorkerDOM project
24 OffscreenCanvas

Conclusion
25 Next steps