Hi everyone, I'm Shubham. I'm a senior software engineer at Headout. I work on DeX Studio, which is an internal tool for creating audio doors. So, creators use it to script, edit, and publish doors. And recently, we started building something much more ambitious inside it, which is a door-style template editor. So, think of multi-track playbacks, scrubbing, feeds, a 60fps canvas playhead. So, basically, all the things that you would expect from a desktop audio editor, except this one runs inside a React app in the browser.
And while building it, I spent a lot of time running into this one very specific problem, which is what happens when React meets real-time systems? And that's also what this talk is about, which is what happens when you ask a reconciliation engine to behave like a clock, and more importantly, how to architect your way around that fight. So, over the next 15 to 20 minutes, I'm going to walk through four things. First, the exact Fourier mode that we had. Second, the architectural shift that fixed it. Third, the patterns that actually fall out of that model. And finally, we'll discuss the trade-offs, because this architecture absolutely works, but it comes with real costs.
So, now, here's where this story actually started for me. I want you to imagine three audio tracks, a red playhead moving smoothly across the screen. It's supposed to glide at 60 frames per second, but it just doesn't. It's jittering, the audio between the tracks is drifting, and every scrub is actually introducing a new lag. And the weird part was, this wasn't a hardware issue. This wasn't a bundler-on-a-network issue either. This was React 19 running on a fast machine, and here, the framework was fighting us at the architectural level. In hindsight, the mistake was obvious. We're asking React to be a real-time clock, and it isn't one. It was never designed to be one. And today, I want to show you what to do instead. So, let's dive in. If we talk about React, React's render cycle is eventually consistent by design. And honestly, that's actually a feature, not a flaw. So, if you think about things like concurrent rendering, time slicing, transitions, suspense, and even the new activity boundary, they all make the same trade. React gives itself freedom to decide when the work happens. It's the framework which chooses the exact moment.
Comments