chantastic.fm

32: Steal the Platform with Vincent Riemer

Episode 32 · December 12, 2018 · 00:38:35

Hosted by chantastic · With Vincent Riemer

Download MP3 · Jump to transcript

Vincent Riemer is the creator of io808.com and react-native-dom. He loves working on projects that challenge assumptions and inspire play. Chantastic asks him about his shoes, the inspiration behind and execution of io808.com and his mad scientist adventures with react-native-dom. They discuss the importance of exploration, the worthlessness of linters, and how to steal the platform.

Featuring

Links

Transcript

[00:00:00] Michael Chan: This is React Podcast. I'm Chantastic. Today we get to sit with Vincent Riemer, creator of io-808 and React Native DOM. Now, if a project with the name React Native DOM sounds totally bizarre to you, don't worry, we absolutely dive into that in the episode. We talk about his creative process, how he chooses projects to work on, and how those projects have got him into speaking internationally. If you've seen io88, I think you'll really enjoy hearing the backstory of how it came to be and the amazing care that he put into reproducing it as best as he possibly could. There's a huge amount of love for that device in this show. We'll dive in right after this. This episode of React Podcast is brought to you by React Training. They provide hands-on, in-person training for development teams, taught by community leaders and experts. On a personal note, I've been able to go to 2 of these and uh they were absolutely fantastic. To find a course in your area, visit reacttraining.com. So Vincent, it's good to sit with you.

[00:01:26] Vincent Riemer: Good to sit with you. Yeah, I'm a little break from the conf and the madness.

[00:01:31] Michael Chan: It's madness out there. We're at React Conf 2018. We're recording here. I was glad to be able to see that— I was glad that you were here, and uh it's it's fun to sit down with you. I want to talk about the madness that's going on in your life, in your head. But first, tell me about your shoes.

[00:01:48] Vincent Riemer: Oh, I got a a pair of uh Roland TR-808 uh shoes, a collaboration with Puma. Uh, yeah, it was just, it was, was it, they did a limited release on 808 Day and I had to pick 'em up just 'cause I had my drum machine project.

[00:02:07] Michael Chan: So I didn't know that 808 Day was a thing.

[00:02:09] Vincent Riemer: Yeah, it's uh August 8th. 8-0-8.

[00:02:13] Michael Chan: Oh, shit. That's amazing.

[00:02:17] Vincent Riemer: That's when I released my drum machine.

[00:02:19] Michael Chan: Is it?

[00:02:20] Vincent Riemer: It was on August 8th. Well, it was like an excuse for a deadline because if I didn't have a deadline, I would've never have finished it. So like that was like, an external deadline that I could not push back.

[00:02:30] Michael Chan: Yeah. So has the 808 always been a part of your life, or did you adopt this at some point?

[00:02:35] Vincent Riemer: Well, it- I've been sort of producing electronic music for a little while, and it's one of the most iconic synthesizers out there. And I was building a drum machine, a web drum machine, and sort of experimenting with recreating the sounds of the 808 because I found, uh, was it the block diagram model of the 808 and started like recreating that in the Web Audio API and it sort of just blew up into this whole recreating the UI as well and all that.

[00:03:14] Michael Chan: So, so tell me about this uh this 808 project.

[00:03:17] Vincent Riemer: Yeah. So, it started probably back when I was a senior in college. Uh, it was towards the end when I was about to graduate. Uh, I had just learned about the Web Audio API. And at the same time, I was reading these articles, uh, called uh, "Synth Secrets" by Sound on Sound.

[00:03:41] Michael Chan: Okay.

[00:03:41] Vincent Riemer: Which are just this insanely long series of articles about like the primitives of synthesizing stuff and Interesting. Each article was like a different primitive sound, like a bass drum and a snare.

[00:03:54] Michael Chan: Wow.

[00:03:55] Vincent Riemer: And they'd go over stuff like, oh, this is how the 808 did it. And they would put up a simplified block diagram, the analog block diagram. And I'm kind of- I was reading about the Web Audio API, and some of the primitives they give you on the web are similar to those block diagram primitives. It's like filter, oscillator, all that. So I'm like, I'll just try to recreate them in the Web Audio API. Uh, so that was just a toy. It was like I had a bunch of buttons that would just execute the sound.

[00:04:28] Michael Chan: Sure, okay.

[00:04:28] Vincent Riemer: Um, and then-

[00:04:30] Michael Chan: so step one was just getting the sounds right.

[00:04:31] Vincent Riemer: Yeah. And then I sort of forgot about it for like a year, um, or two. And then for whatever reason, Uh, I I was starting to get into React at that point, and I wanted a project to like actually release something. And like thinking about it more and more, it was sort of, I have these sounds, how hard could it be to just build the UI? Famous last words. Yeah. Oh my God. Uh, that was quite- like the state management of that is sort of absurd.

[00:05:08] Michael Chan: Yeah. Oh, I believe it. Like how many how many dials and knobs and whatnot are you able to control in the 808?

[00:05:15] Vincent Riemer: Uh, I don't know the count. It's, it's a lot. And that's like not even the hardest part. It's the sequencing.

[00:05:23] Michael Chan: Oh, okay.

[00:05:25] Vincent Riemer: Because you have a sequence that you can play and you can like program while it's running and uh you can store multiple unique sequences.

[00:05:35] Michael Chan: Okay, so you can layer them on top of each other in the device.

[00:05:39] Vincent Riemer: Yeah.

[00:05:39] Michael Chan: Okay.

[00:05:40] Vincent Riemer: And it's like sort of each instrument has its own 16-step loop.

[00:05:46] Michael Chan: Oh, wow.

[00:05:47] Vincent Riemer: When it's basic- at least I modeled it as an array of Booleans where it's on or off at each step.

[00:05:53] Michael Chan: Okay.

[00:05:53] Vincent Riemer: And so each instrument has their own 16-step storage there. Uh, each of those steps, there can be 2 variations of them.

[00:06:03] Michael Chan: Wow.

[00:06:03] Vincent Riemer: And then Each of those two variations have two parts. And then you can store up to like 16 different sequences. So it's like that multiply on top. It ends up being around like 12,000 Boolean values in the store.

[00:06:22] Michael Chan: That's insane.

[00:06:23] Vincent Riemer: That you need to track. I ended up like flattening it all out because right when you describe it like that, it's like, oh, it could be like a tree like that. But I just ended up writing like a simple sort of key hash function.

[00:06:38] Michael Chan: Yeah.

[00:06:38] Vincent Riemer: So it was flattened out. And so I could be like, get it with this key, but construct it by which pattern, which uh variation and all that. And it would just stringify to this thing that's a stable key.

[00:06:50] Michael Chan: Nice. So you went into it thinking, how hard can it be? What were some of the things that were- that proved to be difficult or more difficult than you thought?

[00:06:59] Vincent Riemer: Um, the- I think a lot of it was needing to figure out how the 808 actually worked. Because my goal was to actually do a true homage, like, or like one-to-one recreation as opposed to- because people had made web-based 808 clones before, but they were all vastly simplified. Because the 808 is not actually easy to use.

[00:07:28] Michael Chan: Okay. It's just sounds that people love.

[00:07:31] Vincent Riemer: Yeah, exactly. Uh, or at least it's not especially easy to use. Um, and so when anybody seemingly went to attack that problem, it it seemed like, oh, that this is hard to understand, I'm gonna simplify it to make it easier.

[00:07:47] Michael Chan: Sure. And I imagine with with a lot of things that are difficult to use, people develop a workflow that is very customized to them.

[00:07:55] Vincent Riemer: Yeah, exactly.

[00:07:56] Michael Chan: I imagine you got a lot of feedback from people who are like, oh no, that doesn't work like this, like you got that wrong, like this is supposed to work like this, this is how my whole workflow around the 808 works.

[00:08:05] Vincent Riemer: I actually got zero feedback. I didn't like show it to anybody while I was developing it because nobody I know actually owns a real 808.

[00:08:13] Michael Chan: Okay,

[00:08:13] Vincent Riemer: like,

[00:08:14] Michael Chan: I mean, what would one of those cost these days?

[00:08:15] Vincent Riemer: Uh, around 4 grand.

[00:08:17] Michael Chan: Oh gee.

[00:08:19] Vincent Riemer: And like back in, what, the '80s or '70s when it came out, it was like 1,200. Well, it was like such a limited run. It only was like manufactured for a few years. Yeah, and then got immediately discontinued. And now it's just one of the most sought-after things.

[00:08:34] Michael Chan: Is it simulated in a lot of software? Like, are there like Pro Tools, like effects racks and whatnot that uh simulate this for you?

[00:08:41] Vincent Riemer: Yeah, there are a lot of like plugins and stuff, but generally it's more going after the sound.

[00:08:46] Michael Chan: Yeah.

[00:08:47] Vincent Riemer: And it's not about the sort of day-to-day, like, oh, this is how it actually worked.

[00:08:52] Michael Chan: Yeah.

[00:08:53] Vincent Riemer: Uh, and it was sort of more of like for historical and education purposes, like people know of the 808, but like not everybody is gonna want to drop $4,000 to actually see how it works.

[00:09:06] Michael Chan: Yeah, something that like a studio would own.

[00:09:08] Vincent Riemer: Right.

[00:09:09] Michael Chan: Yeah.

[00:09:09] Vincent Riemer: So the real issue was Like, I got the sort of user manual, like somebody had scanned it, so I got that, and I was just gonna be like, oh, that'll give me the description of how everything works, because it's like every little micro-interaction I was trying to get.

[00:09:25] Michael Chan: Yeah,

[00:09:26] Vincent Riemer: right. But it really did not describe anything.

[00:09:29] Michael Chan: So often those manuals are terrible.

[00:09:32] Vincent Riemer: Oh yeah. Uh, I maybe got better use out of the, the repair manual. And that's where I got the block diagrams, because the block diagrams were in the manual, in the repair manual. But for the actual behavior, like when certain lights are flashing and like what is the rate of that light flashing, and if you press this button while this thing is happening, what's the resulting behavior of that? And my strategy ended up sort of devolving to watching YouTube videos of people using the 808 and like pausing and rewinding.

[00:10:08] Michael Chan: Nice.

[00:10:09] Vincent Riemer: Trying to figure out, okay, so the light blinks in this way when it's running but not when it's not running. Like, really weird shit like that. Just looking online for little tidbits that people mention.

[00:10:22] Michael Chan: Yeah.

[00:10:23] Vincent Riemer: Like, if you're in play mode, you can sort of schedule the next pattern that you want to play, like once your current pattern is done.

[00:10:32] Michael Chan: Yeah, yeah, yeah.

[00:10:33] Vincent Riemer: So you'd press that button before it ends Once it ended, it would switch to the new pattern.

[00:10:38] Michael Chan: Oh, it would fuse it up.

[00:10:39] Vincent Riemer: Yeah, exactly.

[00:10:40] Michael Chan: OK, cool.

[00:10:40] Vincent Riemer: But there was a little tidbit that if you actually did the scheduling in the first 4 beats-

[00:10:48] Michael Chan: Of the 16?

[00:10:49] Vincent Riemer: Yeah, of the 16, it would actually switch immediately in case you were behind.

[00:10:56] Michael Chan: Yeah, like in case you were slow.

[00:10:57] Vincent Riemer: Exactly.

[00:10:58] Michael Chan: Oh my gosh.

[00:10:59] Vincent Riemer: And so having to figure that out and like adding that in. It's like those little- trying to find those little- Little nuances. Yeah, exactly.

[00:11:08] Michael Chan: That's awesome.

[00:11:09] Vincent Riemer: Trying to model those in Redux.

[00:11:11] Michael Chan: So how do you feel about- how do you feel about the result?

[00:11:15] Vincent Riemer: Oh, um, like that was my first real JavaScript project.

[00:11:20] Michael Chan: Okay.

[00:11:21] Vincent Riemer: Uh, and I couldn't have been happier with the response. It was like articles being written about it and stuff like that. So it was kind of like all at once. This wave. And then Reacttoamsterdam invited me out to speak about it, and that's what got me started with speaking.

[00:11:40] Michael Chan: Yeah.

[00:11:41] Vincent Riemer: And so it was kind of the start of everything.

[00:11:43] Michael Chan: I love these stories where people had something in their mind that they wanted to see, they made it, and that gave them a- that opened a door for them to the community, to speaking, to getting to know people. And it's so- I love seeing that.

[00:12:04] Vincent Riemer: Yeah.

[00:12:04] Michael Chan: Right? It's so much more organic than trying to get in or trying to get in through like what you assume other people want, you know, whatever the facade of a React developer or a JavaScript developer is, like trying to put that on yourself.

[00:12:20] Vincent Riemer: Yeah.

[00:12:20] Michael Chan: And just being like, you know what, there's this thing that I love, I want to see it out in the world. Let's let's make it and then have that kind of bring people to you.

[00:12:29] Vincent Riemer: Yeah.

[00:12:30] Michael Chan: How has time since then been in like speaking and uh developing other projects?

[00:12:36] Vincent Riemer: So, I mean, it's primarily been focused on React Native DOM. It was sort of- I started working on that maybe like a month after React Amsterdam.

[00:12:46] Michael Chan: Okay.

[00:12:47] Vincent Riemer: Primarily because I was like, oh, talking was a lot of fun and I want to talk again. But I need something else cool to talk about.

[00:12:59] Michael Chan: Yeah, yeah.

[00:13:00] Vincent Riemer: Maybe that was like the initial reason why I came up with it. Or at least I needed a new project.

[00:13:07] Michael Chan: Yeah, yeah.

[00:13:08] Vincent Riemer: And so I ended up, you know, brainstorming for like a month about like what what could I do. Uh, the 808, the io808 project was very sort of user-facing.

[00:13:22] Michael Chan: Yeah.

[00:13:22] Vincent Riemer: Um, and partially one of my goals was, okay, I want to maybe try to do something a little bit more developer-facing. And so with that restriction, just started brainstorming ideas, uh, coming up with little prototypes of stuff to see, okay, is this even remotely feasible?

[00:13:44] Michael Chan: Yeah, yeah.

[00:13:45] Vincent Riemer: And then just ended up deciding It's like, I think this could work.

[00:13:51] Michael Chan: So I watched your uh your React Europe talk where you talk about conceiving this idea, and you mentioned that it kind of went back to this moment where you saw a talk or read something on putting React into service workers or-

[00:14:07] Vincent Riemer: Into a web worker.

[00:14:08] Michael Chan: Web worker. Yeah. Sorry.

[00:14:10] Vincent Riemer: Um,

[00:14:10] Michael Chan: what's the, what's the idea behind that strategy?

[00:14:13] Vincent Riemer: Uh, so I guess maybe the root motivation is that like if we're animating something on the web, something I've found is it is rarely actually the animation code that'll cause jank.

[00:14:29] Michael Chan: Okay.

[00:14:30] Vincent Riemer: Um, it's all your other code, your business logic.

[00:14:33] Michael Chan: Wow. Okay.

[00:14:33] Vincent Riemer: Because you're all running on the same thread.

[00:14:35] Michael Chan: Yeah.

[00:14:36] Vincent Riemer: So if your business logic is processing an incoming request, and doing that, like, that has to be taken into account on the frame time budget.

[00:14:45] Michael Chan: Sure.

[00:14:46] Vincent Riemer: So it's like, oh yeah, my animation code runs in 2 milliseconds, it should be smooth forever. It's like, no, if you end up having to take in a network request and like normalize the data and all that, yeah, like that all happens in a single tick and will jank up your animation.

[00:15:03] Michael Chan: Yeah, and people usually test animations in isolation.

[00:15:07] Vincent Riemer: Exactly.

[00:15:08] Michael Chan: Not in the like use case of the application. And so then it kind of feels like a surprise when it happens. Like, no, I looked at it, it was awesome, it was like 60 frames a second, amazing.

[00:15:17] Vincent Riemer: Yeah. And then like, you know, people showing off like animation benchmarks where you're animating a ton of stuff on screen and like, look how performant it is. It's like, that's never the bottleneck.

[00:15:29] Michael Chan: Yeah, interesting.

[00:15:30] Vincent Riemer: The animation framework is never the bottleneck. It's your other code.

[00:15:34] Michael Chan: Okay.

[00:15:34] Vincent Riemer: That is the bottleneck.

[00:15:36] Michael Chan: So the idea is to take the other code and put that into a web worker.

[00:15:41] Vincent Riemer: Yeah. So it's just- it will not block sort of rendering code.

[00:15:46] Michael Chan: Interesting. So what uh what was your experience in attempting that? Was it positive? Were there some caveats?

[00:15:54] Vincent Riemer: It's it's interesting. Like uh because I think probably at this point, It's like a net loss in performance.

[00:16:06] Michael Chan: Oh, okay.

[00:16:07] Vincent Riemer: Primarily because I was trying to avoid doing any sort of pre-optimization and stuff like that. I start with that question of like, will this actually work in any form?

[00:16:17] Michael Chan: Yeah.

[00:16:18] Vincent Riemer: And trying to figure that out first. There are some things- like animations do run pretty smooth in React Native DOM, at least in more simple applications. It can break down. After a certain point, but it's due to other browser issues, actually not necessarily due to JS jank. It's like actual actual rendering jank.

[00:16:40] Michael Chan: Yeah, things that you have absolutely no control over.

[00:16:43] Vincent Riemer: Yeah, at least to a certain extent.

[00:16:45] Michael Chan: Sure, sure.

[00:16:46] Vincent Riemer: Still investigations that need to be done. But yeah, the whole running everything in a web worker, it's kind of a facet of React Native DOM. It's not the only thing that it provides. Like, one of the reasons I was thinking of putting all that app logic in a web worker was when I was working with React Native Web, there were moments where I don't- it was too tempting to just use a DOM API. And because everything was on the main thread, I had access to window. So in my React Native code, I was doing document.appendChild or something like that, which is like then- and it's really, it's sort of my fault because I wasn't like strict enough with myself.

[00:17:37] Michael Chan: Yeah.

[00:17:37] Vincent Riemer: But I was thinking about like, how could I restrict somebody from using any DOM APIs?

[00:17:46] Michael Chan: Yeah.

[00:17:47] Vincent Riemer: And the obvious solution was the web worker doesn't have access to any of the DOM APIs.

[00:17:52] Michael Chan: Interesting.

[00:17:53] Vincent Riemer: So if you run your code there, Like if you tried to do a DOM operation, it would also fail just like it would fail in any other React Native platform.

[00:18:01] Michael Chan: Yeah. So you you were able to put some walls up around your developer experience so that you couldn't reach over and just do the easy thing.

[00:18:08] Vincent Riemer: I don't need a linter to enforce some rules.

[00:18:12] Michael Chan: I like that. I feel like you're pandering right now.

[00:18:23] Vincent Riemer: Yeah, I like, I personally like very rarely use a linter.

[00:18:26] Michael Chan: Yeah, same.

[00:18:27] Vincent Riemer: So saying that, that, that's a- I don't know.

[00:18:32] Michael Chan: I know, like now, now my editor tells me when I have unused variable, which is really the only thing that I cared about. And between that and Prettier, I don't need it anymore.

[00:18:43] Vincent Riemer: Yeah, I think technically like a type system- I, I use Flow a lot.

[00:18:48] Michael Chan: Yeah.

[00:18:49] Vincent Riemer: And so that's technically a form of linting. Yeah.

[00:18:52] Michael Chan: For for some of our shared components, um I use TypeScript and I I love it. It feels way better. It just feels more integrated, right, than a linter. Like it's actually part of your code as opposed to this thing that is

[00:19:06] Vincent Riemer: just

[00:19:06] Michael Chan: yelling at you.

[00:19:07] Vincent Riemer: Yeah, I just feel like a linter is just yelling at me. It's that's the job.

[00:19:11] Michael Chan: It's like someone hanging over your shoulder like, hey, hey, you remember this? You remember this? Don't forget this.

[00:19:17] Vincent Riemer: You can't do that.

[00:19:19] Michael Chan: This isn't cool anymore.

[00:19:20] Vincent Riemer: Right. Airbnb's rules being shoved down my throat.

[00:19:27] Michael Chan: So you mentioned um you mentioned React Native DOM and uh React Native Web. Um those project names, like they sound insane. So could you tell me at a high level what the like what the idea of React Native Star is? What that means to take React Native and apply that to the web.

[00:19:49] Vincent Riemer: It is sort of going against a bit the sort of mantra of React Native.

[00:19:56] Michael Chan: Yeah.

[00:19:56] Vincent Riemer: Which was that whole like learn once, use everywhere.

[00:20:00] Michael Chan: Sure.

[00:20:01] Vincent Riemer: It wasn't about having code that ran on every platform.

[00:20:05] Michael Chan: Yeah.

[00:20:06] Vincent Riemer: Uh, but at least when I was looking at it, I didn't see any reason why it couldn't, at least for like certain primitives.

[00:20:18] Michael Chan: Yeah,

[00:20:18] Vincent Riemer: like they're so primitive that, yeah, these can exist on every platform, uh, sort of the React Native core. And then it also facilitated the benefit of splitting out platform-specific stuff.

[00:20:30] Michael Chan: Yeah, yeah.

[00:20:31] Vincent Riemer: I just found that in my little brainstorming after React Amsterdam, I started fooling around with React Native because I had just never done it.

[00:20:39] Michael Chan: Yeah.

[00:20:39] Vincent Riemer: And I was expecting it to be like, oh, I'm gonna be like building a React app, but it's gonna be on- it's gonna create a native app instead of a web app.

[00:20:48] Michael Chan: Yeah.

[00:20:48] Vincent Riemer: And that wasn't actually exactly the case. It was different.

[00:20:53] Michael Chan: Yeah.

[00:20:54] Vincent Riemer: It felt different.

[00:20:55] Michael Chan: Surprisingly different.

[00:20:57] Vincent Riemer: Yeah, and it felt a lot better, which was like very surprising. Like I was able to create these like far more luxurious experiences and like sort of immersive animations and what have you. And it was kind of like, well, wait a minute, this is React. Why is it that it's better? Like, to me, on the surface, it didn't look like anything should have been better or worse.

[00:21:26] Michael Chan: Yeah.

[00:21:26] Vincent Riemer: And so it was sort of trying to delve into why that was. And being like, can I get this experience on the web? And I fooled around with React Native Web a bit, uh and it's it's really good. I mean, it's like both projects are workarounds.

[00:21:48] Michael Chan: Sure.

[00:21:49] Vincent Riemer: And like we took very different approaches, but and both have it's their respective downsides.

[00:21:58] Michael Chan: Yeah, yeah.

[00:22:00] Vincent Riemer: But there were some things that I'm like, ah, like this API is missing. How how would I do that?

[00:22:06] Michael Chan: Yeah.

[00:22:06] Vincent Riemer: And sort of how it was built, at least at the time, uh, I didn't see any avenue for implementing some of these APIs, like the layout animations API. It was so close to the DOM that you couldn't like sort of abstract away a way to do layout animations. So I'm kind of like, okay, how high of an abstraction do I need to build in order to facilitate that? And then there was the idea of, at least with React Native DOM, I wanted to figure out how can I give myself the least amount of work to do.

[00:22:51] Michael Chan: Yeah.

[00:22:52] Vincent Riemer: And it was sort of saying like, oh, React Native is half native code and half JavaScript code. Can I skip building that JavaScript side and actually just use that on the web and just be focused on building the native implementation?

[00:23:08] Michael Chan: Yeah.

[00:23:08] Vincent Riemer: I think that was the final thing that really made me think, okay, if I can skip doing all of that, then this might be actually worth pursuing and it won't take too long.

[00:23:18] Michael Chan: Yeah. So how has it- how has it been? Um, how long you've been working on it now?

[00:23:22] Vincent Riemer: Uh, probably a year and a half at this point. When I announced it in May, that was sort of the 1-year anniversary.

[00:23:30] Michael Chan: Okay, cool.

[00:23:31] Vincent Riemer: Uh, of working on it.

[00:23:33] Michael Chan: Are you using it in places?

[00:23:35] Vincent Riemer: No, it's really-

[00:23:36] Michael Chan: It's like a thought experiment.

[00:23:37] Vincent Riemer: Yeah, it's a sandbox for like fooling around with things that make no sense.

[00:23:41] Michael Chan: Yeah, yeah, yeah.

[00:23:43] Vincent Riemer: I, I I'm pretty sure I mentioned in my talk that it was like, I wanted to build a library where I finally could just kick best practices completely out the window. Like I was tired of not being able to do some things because, ooh, that's not a good practice. Like, oh, that's gonna raise the bundle size a bunch. I I'm like, I can't do that.

[00:24:08] Michael Chan: Yeah, yeah, yeah.

[00:24:10] Vincent Riemer: Or "That's not gonna perform very well. You can't do that." Uh, that's- I mean, though it's like still in my mind and it is important to me, like sort of just initially in the sandbox mode, like, "Oh, there's no accessibility story for that." And like, while that is still like very important, this project isn't meant to be really used, at least at this point.

[00:24:36] Michael Chan: Yeah.

[00:24:37] Vincent Riemer: And I really wanted to just have a space where I could just build and like not actually care about other people using it. Yeah. And like-

[00:24:47] Michael Chan: It's funny, I think that we don't give ourselves that space enough. I'm sad sometimes when I feel like people don't take the opportunity to explore. I think that a lot of people feel like when they sit down to write the code, that their job is to apply answers.

[00:25:06] Vincent Riemer: Yeah.

[00:25:06] Michael Chan: And in the early phases, it's, it's really not. The way I feel about it is that you should sit down and ask yourself questions. And until you've, like, found all of the questions that you have to ask, like, you're not really done doing the work. Like, you don't know enough about the problem to apply a solution.

[00:25:24] Vincent Riemer: Yeah.

[00:25:24] Michael Chan: And I think that's- I mean, back to the, the linters and whatnot. I think this is where so many people get into trouble, like assuming that these these pre-baked solutions are going to apply in every case. And so many times they do.

[00:25:38] Vincent Riemer: Yeah.

[00:25:39] Michael Chan: But there's there's a value to what you're doing, which is like, I want to I want to try something that is just different, and I want to open my mind to the possibility that there may be things out there that I need to think differently about, think differently than like the conventional wisdom. I like that.

[00:25:59] Vincent Riemer: Yeah. I mean, like, who honestly thinks it's a good idea to compile yoga to WebAssembly for layout on a platform that has flexbox?

[00:26:09] Michael Chan: Right, right.

[00:26:10] Vincent Riemer: Like, that doesn't make any sense. But I found that it actually gave me a lot. Like, I can do some really cool things because I am the one running the layout.

[00:26:23] Michael Chan: Yeah.

[00:26:23] Vincent Riemer: It's not the browser in this black box that I can't like sort of peek into.

[00:26:28] Michael Chan: Yeah.

[00:26:28] Vincent Riemer: Stuff like layout animations where like I can have access to the next layout values and not apply them immediately.

[00:26:36] Michael Chan: Yeah.

[00:26:37] Vincent Riemer: And say, oh, no, animate to that value instead of just applying it immediately.

[00:26:43] Michael Chan: That's crazy. So what have you- I mean, with that, what lessons have you learned about controlling the layout, like top to bottom?

[00:26:53] Vincent Riemer: Some of this is assumptions of the web platform. Because the web platform, CSS, and its layout just has so much baggage.

[00:27:04] Michael Chan: Yeah.

[00:27:04] Vincent Riemer: There's a lot of stuff that like sort of optimization steps that they just can't do. And with Yoga, it's focused on just flexbox.

[00:27:15] Michael Chan: Yeah.

[00:27:15] Vincent Riemer: Like that's like there are no floats. Or anything like that. Uh, and so, there are optimizations that can be done there. And when you have a sort of reasonably limited configuration of any view, like you know, oh, these are layout props that affect visual aspects and these are the ones that don't.

[00:27:37] Michael Chan: Yeah.

[00:27:38] Vincent Riemer: And so, if you see a view that only has props attached, configured to it that just affect non-visible layout props, you can just not bother to render that view at all.

[00:27:52] Michael Chan: Yeah.

[00:27:53] Vincent Riemer: How many times have you built that sort of widget where you have the image on the side and then two like text elements vertically positioned? So you have the flexbox direction row, right? Then you have a nested view that's just for having the text be vertical.

[00:28:09] Michael Chan: Yes, yeah, yeah.

[00:28:10] Vincent Riemer: That's the most common thing. But with this optimization, it's like they're all in the same view. And there isn't- that wrapper view doesn't exist. But they're positioned as if it was there.

[00:28:22] Michael Chan: Wild.

[00:28:23] Vincent Riemer: Yeah. And so, like, I still think that it could be possible for the browser to just do that by default. But for all I know, there's some legacy stuff that just can't-

[00:28:32] Michael Chan: There's a lot of history there.

[00:28:34] Vincent Riemer: Yeah. And I can't know.

[00:28:36] Michael Chan: Yeah, yeah.

[00:28:37] Vincent Riemer: I'm not about to- clone WebKit or Blink and like dig through.

[00:28:41] Michael Chan: Now, I know that some of the work that React is doing right now, one of the goals is to be able to do a better job of anticipating the layout of something before uh before it's rendered.

[00:28:58] Vincent Riemer: Yeah.

[00:28:58] Michael Chan: So you can make those calculations and insert it or animate to something in a way that is pleasant to look at and without a lot of additional work. Um, are you aware of what those are?

[00:29:09] Vincent Riemer: Uh, to a certain extent.

[00:29:11] Michael Chan: Okay.

[00:29:11] Vincent Riemer: Um, I don't think the whole concurrent- React Concurrent is going to facilitate specifically animation benefits like that. Okay. Because again, it's like, because we're in the browser, like we just don't have access to the layout information.

[00:29:29] Michael Chan: Sure, sure.

[00:29:30] Vincent Riemer: Unless you actually render to the DOM. Like you can't just say, oh, I have all these elements that haven't been mounted yet. What would be the layout of them? Like there's no API for that.

[00:29:42] Michael Chan: I see.

[00:29:42] Vincent Riemer: So they need to be- when they say like rendered and like laid out, they mean just sort of React's virtual DOM. They've rendered that virtual tree and they need to flush it to the DOM. At least that's my understanding. I definitely think the concurrent rendering is going to help with that like animation case where I say the biggest bottleneck to your animations are your other like the other code that's running. Sure. And with React being able to actually say, oh, an animation is running, which is like the highest priority in React Fiber's sort of scheduler, like all your code will- other code will yield to it to ensure that the animation stays running smoothly. So they're doing, uh, I forget what word they call it, cooperative scheduling or yeah, cooperative concurrency, whatever. It's-

[00:30:39] Michael Chan: But in a very practical sense, animation is a very high priority. And so kind of what we started the started the conversation with is is that your work will interrupt the animation.

[00:30:50] Vincent Riemer: Yeah.

[00:30:50] Michael Chan: But with this new concurrent mode that we're we're seeing, the animation will be allowed to hold a higher priority and feed resources to the the other work um as the animation doesn't need them.

[00:31:05] Vincent Riemer: Yeah. Uh basically, at least my understanding is that React's work is the whole time slicing they mentioned. Like the work to do a reconciliation and stuff is split into little chunks of work. And React will know how much time is left in the frame, like once animations have run. So if there is enough time to insert a little bit of work, they'll do it. But it won't like be so much work that it's going to cause a janky frame. So they get to sneak it in.

[00:31:40] Michael Chan: That's so crazy. I mean, I've never thought about React doing that much behind the scenes. I think it's gonna be wild to start like seeing that. And it might be invisible, right? It might just be like, okay, these these animations are awesome now and they kind of sucked before.

[00:31:55] Vincent Riemer: I think we're we've already seen some of that. I think he made he made Prettier, Justin Long.

[00:32:00] Michael Chan: Oh, just uh James Long.

[00:32:01] Vincent Riemer: James Long. Yeah. He recently tweeted about something where he just turned on concurrent mode.

[00:32:07] Michael Chan: Yeah.

[00:32:07] Vincent Riemer: And the animations just got a whole lot smoother.

[00:32:10] Michael Chan: Yeah.

[00:32:11] Vincent Riemer: Uh with really no configuration.

[00:32:14] Michael Chan: It's amazing.

[00:32:15] Vincent Riemer: Yeah, it is exciting. It'd be nice to see that level of performance without like the amount of stuff that I had to do to like work around it.

[00:32:24] Michael Chan: Right, right. That is one thing that's really fun about using a tool like React is getting some of that work for free. And I know that that's come at like a really big cost to the team. I mean, they spent a year and a half, 2 years just rolling out the Fiber architecture.

[00:32:43] Vincent Riemer: Yeah, with no API changes.

[00:32:45] Michael Chan: With no API changes. And but but now I think we're starting to see the benefits of that. Now that like concurrent mode is like starting to be able to be put into apps, like you can see all of the benefits of that work.

[00:32:58] Vincent Riemer: Yeah.

[00:32:58] Michael Chan: Um, and I'm I I'm really excited.

[00:33:02] Vincent Riemer: Oh, me too. It's funny, though, like I may be a little bit more excited about the whole Suspense stuff with the data fetching.

[00:33:08] Michael Chan: Yeah.

[00:33:09] Vincent Riemer: Actually, because that's like just something that- I don't know, I've never been able to model anything that way.

[00:33:15] Michael Chan: Yeah.

[00:33:16] Vincent Riemer: And that's really exciting. Yes. Like being able to manage state in that way and the sort of asynchronous data flow.

[00:33:24] Michael Chan: Mm-hmm.

[00:33:24] Vincent Riemer: Uh, that is exciting. I don't know about like debuggability though with all of this.

[00:33:31] Michael Chan: Yeah.

[00:33:32] Vincent Riemer: It's sort of starting to remind me a little bit of Angular. At least when you go down into the real stack trace of any error, it's like incomprehensible because everything is like split into things and what have you. But

[00:33:44] Michael Chan: it does seem like they have they have prioritized adding tools to make those things comprehensible.

[00:33:50] Vincent Riemer: Yeah, definitely. But it's just funny to see every single framework like going down this path of essentially trying to overcome the browser's limitations and, you know, building a whole scheduler. In user land. It's just, why is this necessary?

[00:34:07] Michael Chan: It's hard. It's amazing all the stuff that we shove into a document reader.

[00:34:13] Vincent Riemer: Yeah.

[00:34:13] Michael Chan: Right? But it's fun.

[00:34:15] Vincent Riemer: It's it's a challenge.

[00:34:16] Michael Chan: It's a challenge.

[00:34:17] Vincent Riemer: And we get to take things from other industries that don't have these problems and sort of pass them off as our own. That's the key, you know. Find the problems that are being solved in like platforms that have their shit together and being like, oh, I bring this to the web. And I feel like that's a lot of what I do is just find it, like, you know, watch, watch talks from like an Android conference or-

[00:34:45] Michael Chan: Yeah.

[00:34:46] Vincent Riemer: Uh, the iOS conference, all those tech talks and like applying a technique they mention, but to the web.

[00:34:54] Michael Chan: Yeah.

[00:34:54] Vincent Riemer: And it's like, ooh, look at this new thing, but it's not really new.

[00:34:58] Michael Chan: So what are some of the things- what are some of those things that you think would be, I guess, low-hanging fruit for people who want to explore the new async APIs and, you know, animation or some of those cool things that are being done on other platforms? Do you feel like there's, there's a bunch of ways that people could contribute and explore in that conversation?

[00:35:21] Vincent Riemer: At least, uh, I think for the web development community, and like, I've been sort of guilty of this in the past and I'm trying to get better, which is like, get out of the web a little bit more.

[00:35:35] Michael Chan: Interesting.

[00:35:35] Vincent Riemer: Like, go to other platforms and just, you don't even need to build anything real.

[00:35:40] Michael Chan: Yeah.

[00:35:40] Vincent Riemer: Just build some toys and like real native iOS code and real native Android code, like fool around with those APIs and be like, oh, that's kind of cool that they can do that.

[00:35:51] Michael Chan: Yeah.

[00:35:52] Vincent Riemer: Why can't we do that? And then start to think about, oh, how could I implement that?

[00:35:57] Michael Chan: Yeah.

[00:35:58] Vincent Riemer: In the web, sort of in user land.

[00:36:00] Michael Chan: Yes.

[00:36:01] Vincent Riemer: Uh, and that's at least sort of my flow. When I encounter a solution to a problem that I didn't know I had, that's usually a good like spark moment where it's like, okay, there's there's something I could build.

[00:36:16] Michael Chan: Yeah. That's one thing I really enjoy about being in the React community and about React itself is that it feels like they think about React and JavaScript and the web like that. You know, like even from the very beginning, the virtual DOM being borrowed from uh game engines,

[00:36:39] Vincent Riemer: right?

[00:36:39] Michael Chan: And thinking about what can we steal from other people who are doing this better than we are on the web and apply it to the web and try to change the story in these things that have sucked for a long time.

[00:36:50] Vincent Riemer: Yeah, uh I think maybe the web has continually suffered that like not built here syndrome.

[00:36:57] Michael Chan: Yeah.

[00:36:59] Vincent Riemer: And we gotta take advantage because code in general, like not even not just the web, but code everywhere is just so open and everybody's sharing what they've done and it would be uh a mistake not to take from that.

[00:37:14] Michael Chan: Awesome. I like it. Steal from other platforms.

[00:37:17] Vincent Riemer: Yes. It's not use the platform, it's steal the platform.

[00:37:21] Michael Chan: Steal the platform. Well, hey, thanks so much for your time. I I really appreciate, again, you sitting with me and talking with us about your your workflow and the way you think about um platform theft. This has been fun.

[00:37:36] Vincent Riemer: Yeah, thanks for having me. This was great.

[00:37:39] Promo: This has been React Podcast, episode 32. For show notes and links, visit reactpodcast.com/32. To show your support for the show, visit reactpodcast.com/partner and uh choose a plan that helps us with these in-person interviews, which I think come out a lot better and assist in the production

[00:38:04] Michael Chan: costs of this weekly show. That's all I have for you this week, but do not miss next week. I have a very special episode with Lory Voss of npm. We got to sit down after his talk at JSConf in back in August, and I'm finally able to share it with you. So, I think you'll really like that one. We'll be in your ears again next week talking about npm and the future of JavaScript.