Войти
  • 35Просмотров
  • 2 недели назадОпубликованоBengsfort

Making IPC Suck Less With Typescript

Revisit of my talk that I gave at the November 2025 HelsinkiJS on making IPC safer by using Typescript. Slides: Repo including examples: In this talk I go through the ins and outs of inter-process communication in JavaScript. What is it? Why would you need to split your logic into multiple process anyway? What sort of issues do you typically face when working with IPC? I also go through a pattern I’ve used throughout 5 shipped apps that make working with IPC ergonomic, fast, and safe. Although I’m a bit sick and did not get to dedicate as much time as I would have liked to towards the talk, I wanted to get it recorded while it’s still somewhat fresh in my mind so it can hopefully help others as well! Timestamps ——————— 0:00 Intro 2:22 What is IPC? 5:40 Simple example (Node/Browser) 11:43 The problems with IPC 17:18 Fixing event handling 19:42 Implementing a basic event emitter 24:30 Hooking up the event emitter 27:23 Core Typescript concepts we will use 32:02 Adding types to our event system 40:00 Result of type safe event system 41:39 Groundwork for type safe IPC calls 47:17 Type safe IPC calls API 49:37 Implement IPC requests 55:13 Implement IPC request handling 58:38 IPC API cleanup 59:26 The final result