chantastic.fm

4: Babel and open source sustainability with Henry Zhu

Episode 4 · March 30, 2018 · 00:45:55

Hosted by Michael Jackson · With Henry Zhu

Download MP3 · Jump to transcript

In this episode Michael Jackson talks with Henry Zhu, maintainer of the hugely popular Babel project, about open source sustainability and what's coming next for the Babel project.

Featuring

Links

Transcript

[00:00:06] Michael Jackson: This episode of the React Podcast is brought to you by ReactTraining.com. In-person, hands-on training for development teams from React community leaders and experts. Visit ReactTraining.com to learn more. Hello, everybody, and welcome to Welcome to the React Podcast. I am your host, Michael Jackson, and I am joined today by a very special guest, Mr. Henry Xu.

[00:00:35] Henry Zhu: Hello.

[00:00:36] Michael Jackson: How's it going, Henry?

[00:00:37] Henry Zhu: Pretty good.

[00:00:37] Michael Jackson: So Henry is the current maintainer of Babel.js. He's also working now just recently on Babel.js full-time. So I wanted to first of all just say congratulations. That's super awesome.

[00:00:52] Henry Zhu: Thank you. Thank you.

[00:00:54] Michael Jackson: I mean, I know a ton of the people listening to the podcast are probably thinking like, what? How, how, how do you, how do you do open source full-time? You know, I mean, that's not a very common thing. That's a super rare thing. And you and I actually had many conversations about it, it seems like, before, uh, before you actually made the leap, about like, oh, should I do this or should I not? Or am I gonna make the leap? And then you eventually eventually did it. So, that was cool. So, I be- before we dived into that, I just wanted to say congratulations and and how's it going so far?

[00:01:24] Henry Zhu: Um, I think uh overall, I I feel pretty good about it for sure. Um, yeah, there's definitely lots of unknowns and things I have to work out, whether it's just like personally or logistically, all that stuff. But I'm definitely excited for what's in store.

[00:01:40] Michael Jackson: Yeah, I think a lot of people in the community are excited to see you you going for it. It looks like you've got about $3,000 raised on on Patreon, or Patreon, I'm not sure how they pronounce it, which is awesome. So hopefully that just keeps continuing to go. If you haven't contributed to Henry's Patreon yet, please become a patron. He is doing- I guarantee if you're listening to this podcast, you've used his work. Guarantee, 100%, no chance you have not benefited from this man's work. All right, so anyway, we got we got we got into the pitch a little bit quickly. Why don't why don't you back up a little bit and and just tell us kind of, you know, a little bit more about who you are. You don't just work on Babbel, you know, you live in you live in New York City. Tell us a little bit about kind of you know about your backstory and maybe a little bit about how you came to Babbel and and some of your past work experience.

[00:02:29] Henry Zhu: Yeah, um, I think I've shared a few times, but I'm sure most people don't know. Um, I actually remember giving a talk um at a conference and telling people I didn't work at Facebook. And someone, I think someone after was like, "Hey, do you work at Facebook?" I was like, "I said that in the talk, I didn't." Yeah,

[00:02:49] Michael Jackson: I I have to do the same thing. People are like, "Oh yeah, you know, when you and you're sitting around with your coworkers at Facebook." I'm like, "I don't work at Facebook."

[00:02:56] Henry Zhu: Yeah. So, yeah, I'm actually originally from Georgia, like Atlanta area. Um, and I was basically just, you know, after college I was working there and I, one of my coworkers was um this guy Jonathan Neal, um, and he kind of inspired me to get into open source in the first place. I think just like a lot of people, I I knew about it, you know, I I've went to like GitHub before and I've the way I use open source was like, you know, uploading like like one commit of like all your previous projects and you don't ever like look at it ever again. Um, but then I was like, oh, there's this, it feels like there's this, you know, community and people are working on things, it'd be cool to contribute to something. And I actually got started by looking at Angular uh when it was first coming out and It was really hard to like look into the issues and what I did was I found an issue that had to do with styling, like code style.

[00:03:49] Michael Jackson: Okay.

[00:03:49] Henry Zhu: And so, I basically manually fixed a bunch of stuff and that's how I found about a project called JSCS, which is a code styling project. And I basically ended up making like, I don't know, like 30 commits and changing like thousands of lines of code manually and I even got like a t-shirt from one of the Angular team members gave me a t-shirt.

[00:04:13] Michael Jackson: So now on on basically all of the Angular source code, the git blame says Henry.

[00:04:18] Henry Zhu: Um, I don't think it's everywhere, but like this is Angular 1.2. Uh, but I'm definitely-

[00:04:23] Michael Jackson: There's a lot of code in here, wow.

[00:04:25] Henry Zhu: I know, I felt weird. I'm like, why am I like number 30 on the list and I didn't do anything? Um, so basically that was all I did in Angular and I realized like I didn't know enough to contribute to that and I The project I was using to uh find out all the issues was JSCS. And I've through that project, I basically got more involved because I realized it was it seemed pretty easy to contribute to. It was like a file for each rule, a file for each test, and a file for each doc. And just it made sense like um in terms of like the organization and I didn't have to know about the core. And so, I you know I made a table of contents as my first PR and I you know, fix some bugs. Eventually I did more, you know, docs work and then I I started integrating like, you know, we started thinking more about auto-fixing. That that's why I was so into like linters because I didn't want to make the changes myself. Um, I was like, oh, what if we could do it automatically? And that led me to finally find out about Babel in the first place. Like I didn't even know it existed. I don't think I knew about it before it was changed to Babel.

[00:05:28] Michael Jackson: Yeah. So so this is super interesting so far because uh I think what you've said up to this point is not obvious to a lot of people, which is that, hey, even if you don't know a lot about the sort of meat of a project or what the project is for, there's still a lot, a lot of work to do. There's, you know, all sorts of issues about documentation. In your case, you know, you're helping out with a consistent styling across the codebase. There's evangelism. I remember when I first started talking to Sean Larkin, Um, he wasn't, you know, one of the core Webpack developers. He was, he was just stepping in because Webpack needed, uh, needed somebody like, needed a Sean Larkin basically to step in there and say, okay, you know, let's redo the website, let's redo some of these docs, let's, you know, talk about this and have somebody who can answer questions. And, and I remember whenever I said anything about, you know, Webpack online, it was like Sean would just show up, right? He just pops out of nowhere like, Let me help. Let me answer your webpack question. So so anyway, lots, lots more that you can do for open source. Just just if you're listening and you're like, oh man, these guys work on open source and I don't know how to do open- you don't have to know anything about React or Angular or whatever it is to actually start making real contributions.

[00:06:47] Henry Zhu: Yeah, I think um a lot of people, they like wanna be a maintainer or they wanna be a contributor, but they try to like emulate what other people are doing. And I think it's Our job as a maintainer is not to like tell you what to do but really like guide you to figure out what you're good at and what you like. And I think what Sean did was he was already, you know, good at talking with people and he found a place where he could do Twitter, which is to answer people's questions. And I think everyone can figure out what that is for each individual person, like whether it is revamping the docs. Like if you find something wrong or could be better, then you could suggest that and you can start working on it. And it's something that people don't maybe they don't care about it as much or they have different priorities. And I think you could be the best person to work on it.

[00:07:33] Michael Jackson: Yeah, I think that's a great- I think that's a great- like, that's a great way to put it. So so you were working on, you know, you said you were working on JSCS, which eventually you said you you said that was the that kind of led you to Babel. That was the first time you heard about Babel.

[00:07:49] Henry Zhu: Right. Um, and specifically, uh, Sebastian made After he made Babel, he he started thinking about, well, you know, once we start introducing syntax, this is like an overall thing where like, just because we added new syntax, how does that affect the ecosystem? This is something I've been thinking a lot about, but in this specific case, when you add new syntax, it has to change other tools too. And so, one of the tools that gets affected by this is linting. And so, if we start using ES6, all of the um linters didn't support ES6 at the time and we still called it like ESNext. And so he made this project called Babel-EsLint and that's when I found about ESLint and I started contributing to that even though I was working on JSCS, which in some sense it was like a competitor in a sense, but um I thought it was important to— um because I I thought it was relevant that we needed to um have a linter that supported ES6. And I made my own fork of it basically um called Babel-JSCS. And I became a maintainer on that, not intentionally. Like I I did think it was super complicated at first, but you know, I was consistent in like looking at the codebase and no one else was doing it. Um eventually, Sebastian even made an issue like, I need a maintainer because I'm trying to work on Babel core, and I basically volunteered to to do it. Um I got really involved and became a maintainer, started releasing things.

[00:09:12] Michael Jackson: On Babel ESLint or on Babel JS? Yeah, okay.

[00:09:15] Henry Zhu: Yeah, both, both actually. Um, and so I do like simultaneous like changes for both. And eventually I um I learned about ES6, all that. Um, I became more of a maintainer on the JSC side and and that's actually how I even got my job at Behance where I was working where I was working just until like 2 weeks ago. Um, so I kind of got into Behance through open source and I kind of like left to do open source, you know, again, right? So, I think it was fitting that that's the reason why I left. Um, and and then when I moved there, yeah, so basically Joel, he he was working at Behance at the time, he emailed me and he just reached out and he's like, "Hey, we know that you're doing good work," because two of those people, Joel and Mike, they both work at Behance and they they were the maintainers on the project, so they're like, "Hey, let's um let's see if we can hire Henry. And at the time, you know, I was in Georgia, I didn't really think about moving or going anywhere, but you know, I I took the interview and I decided to to go.

[00:10:19] Michael Jackson: So, you never thought you'd end up in in the heart of New York City?

[00:10:23] Henry Zhu: Yeah, that was literally the last place I was thinking of going. I had no idea, yeah.

[00:10:29] Michael Jackson: It's awesome though. How do you how do you like living in New York?

[00:10:31] Henry Zhu: Um, yeah, now I I really like it. Um, I think it's fitting for me 'cause I don't like driving that much anyway.

[00:10:38] Michael Jackson: Yeah.

[00:10:38] Henry Zhu: Um, and so it's probably one of the few places where it's like I could just walk anywhere or or take the subway if I have to.

[00:10:44] Michael Jackson: I mean, just today, just today, you had lunch with Ken Wheeler, Jed Watson, uh, I'm forgetting, uh-

[00:10:52] Henry Zhu: Kurt.

[00:10:53] Michael Jackson: Kurt, yeah, that's right. And uh, and and you guys, I mean, just just because New York is this huge melting pot, you know? I mean, I mean, wasn't the first time I met you in New York? Didn't we go to-

[00:11:06] Henry Zhu: Was it the Shake Shack, or- I'm not sure.

[00:11:09] Michael Jackson: I can't even remember. But yeah, I mean, that's actually a really good point. Last time you and I went out to dinner, it was me, you, and then, uh, who showed up? Chuck.

[00:11:19] Henry Zhu: Yeah.

[00:11:20] Michael Jackson: And, uh, and oh, and, uh, golly, why is my brain failing me? Natter!

[00:11:28] Henry Zhu: Natter, yeah.

[00:11:28] Michael Jackson: Natter Abbott was there. And it was just like, people are just always there, right? Like wherever you go, it's it's people are always flying through New York, always, even, you know, people from all around the world. So it's really cool as, you know, as the as the, you know, just kind of a melting pot of people and you always get to see lots of different people from all over.

[00:11:48] Henry Zhu: Yeah. Especially um just New York specifically. I I just feel like there's so many JavaScript people here.

[00:11:54] Michael Jackson: Oh, for sure.

[00:11:55] Henry Zhu: Um, like John Resig and just like all these people. It's like-

[00:11:58] Michael Jackson: Oh, for sure. I'm gonna be there this week doing a React training workshop. Hey, um, speaking of of New York, do they ever hold TC39 meetings in New York? Because you're you participate in TC39 as well, right?

[00:12:10] Henry Zhu: Um, do they hold meetings in New York? Yes. And uh, the first one I went to was because it was in New York and I just like walked over.

[00:12:19] Michael Jackson: Okay.

[00:12:20] Henry Zhu: Um, it was at Google. Um, so, right now they're planning on doing 2 a year on the East Coast and I think they're both in New York. So, the one in May Uh, the next one is gonna be in New York. The one- there's one this week, like tomorrow, um, it's in London.

[00:12:34] Michael Jackson: Okay.

[00:12:34] Henry Zhu: Um, and yeah, and I've been to 2 of them, um, in person as a guest. Um, but now that I don't work at a company, I think it should be easier to go logistically. But uh, in terms of like funding, I- that's another way to like someone to support me, or not just me obviously, but like anyone on the Babel team. It's like If people were like confused, like, oh, what are you spending the money on? Well, obviously for me, I want to spend it to just live, but people could, I mean, we could make a GitHub issue that's just like, hey, do you want to sponsor a Babel team member to go to TC39? You could pay for the hotel and the flight or something like that.

[00:13:13] Michael Jackson: Yeah, that'd be a great way to sponsor. So, tell me a little bit about, tell me a little bit about TC39. What's it like to go there and and what role does Babel play in the whole kind of ecosystem, I guess, future of JavaScript at this point? Because it seems like, golly, it seems like in in such a short time it's taken up such a huge sort of role. Would you agree?

[00:13:37] Henry Zhu: Yeah, yeah, for sure. Definitely like more recently rather than before. Yeah. I mean, I've only been to a few meetings, so I might not be the best person to talk to in terms of like historical things.

[00:13:50] Michael Jackson: I've been to zero meetings, so you've been to more than I have.

[00:13:54] Henry Zhu: Yeah, it's it's it's actually pretty cool. Um, I mean, if you want to be- in some sense, it's just a group of people that get in a room and they argue about like JavaScript and syntax, but um what it really is is like um companies that— uh it doesn't have to be a company, it could be a nonprofit— um that they they choose um members to send um to the committee and it's uh it's also um every 2 months, um and one of the companies hosts it. And um they have like a schedule of what they're— it's very like formal. And so there's a there's a schedule, you can go to this repo called TC39/agendas and it has every month like what they're gonna talk about. There's like um they even have like a kind of like a timer system where like they have to— um like there's like 15 minutes for this topic or 60 minutes for this topic. Um and there's like a—

[00:14:48] Michael Jackson: What happens if the timer runs out? Is there like a big gong and they just bang it and you have to-

[00:14:53] Henry Zhu: No. Um, so we someone, wait, we have tools for that now too. There's like a whole like web app that tells you like what the time, how many time is left. Someone has to check that. And there's a chair that like tries to manage everything.

[00:15:05] Michael Jackson: Did they build it in React?

[00:15:07] Henry Zhu: I I don't know. Maybe. Okay. I forgot.

[00:15:13] Michael Jackson: So what role uh what role does Babel play in the in the whole TC39 thing? Like conversations? Like you said recently, it's taken a much bigger role. What did you mean by that?

[00:15:24] Henry Zhu: I mean, maybe it was always there, but like I I mean I didn't know about it or like it kind of felt like to me was like we were like we were part of the conversation, but we weren't really being represented on the conversation. Like nobody on the team was like going. So, like I mean, there are plenty of people that are there that care about Babel or like think it's important, but I don't really know what it was like until I you know, started going, or I asked other people to, to go.

[00:15:53] Michael Jackson: That must have been a very awkward time to be involved in TC39 because so much of the community, like, so much of what they do is driven by, you know, what, what people are shipping, right? What people are, what people are already doing. They look at big companies in the industry. And so, you know, all of the companies there pretty much, I'd imagine, were, were taking advantage of Babel in some way or leveraging it, you know, especially Facebook, obviously. Adopted it maybe like 2 years ago, I want to say. So everybody there is using it, and yet nobody from the Babel team was there. And so that that that was probably kind of an awkward time where they were like, we should probably get somebody from the Babel team in here just to, you know, just to represent.

[00:16:35] Henry Zhu: Yeah, and it's not like nobody went. Like, I know Sebastian was- I at least went 1 or 2 times. Um, and obviously if Facebook people are there, then, you know, and Sebastian works at Facebook, then there's communication there, but I don't know if there was like anything specifically like, oh, this thing has to change, or we're thinking about how, you know, transpilers work or whatever. Um, and and recently TypeScript has also, um, like Microsoft obviously sends people, and so TypeScript team, some of them are able to go as well.

[00:17:04] Michael Jackson: Got it.

[00:17:05] Henry Zhu: Um, but I think it's just that, uh, yeah, we we have we get to be more aware of what's going on and and other people, um. Um, just yeah, I think just having that conversation just changes how people think that, you know, if they're no- if you just to be there. Not that I even have that much to say about like how a certain specific proposal should be, uh, and maybe I just don't feel confident myself, but that that's his that's his own that's his own thing. Um, yeah.

[00:17:34] Michael Jackson: Yeah, well, I, you know, I think if anybody there gives you trouble, you just you just tell me about it and I'll I'll have a talk with them. They they don't know me or or care about who I am, but I'll give them an earful. Be like, Henry's my Henry's my friend. You let him talk.

[00:17:49] Henry Zhu: No, I mean, I think everyone that I've met has been really um friendly and-

[00:17:55] Michael Jackson: Got it, got it.

[00:17:55] Henry Zhu: Really uh welcoming. I think um it kind of like, you know how recently all this, you know, stuff that's happened with TC39 and the whole like fight and stuff, right?

[00:18:04] Michael Jackson: Are we gonna are we gonna talk about smooshgate? Are we gonna do that?

[00:18:09] Henry Zhu: We don't have to talk about it in specifically, we I just I can just talk about in general.

[00:18:14] Michael Jackson: Let's do it.

[00:18:16] Henry Zhu: I don't really care.

[00:18:17] Michael Jackson: Let's talk about it, dude. Let's talk about it because people want to know. What what what what happened? Were you there when when the when the-

[00:18:23] Henry Zhu: No.

[00:18:24] Michael Jackson: No? Okay.

[00:18:25] Henry Zhu: I didn't even- yeah, I didn't hear about until a lot later.

[00:18:29] Michael Jackson: Okay.

[00:18:29] Henry Zhu: It's funny because someone's like, oh, just just ask Henry how he would handle it. I'm like, I don't- I don't know, I guess I just wanted to say that like I think there's this- there's a huge gap between like what developers think of TCG9 and like how they work. And there's- I know they're trying really hard to, you know, shorten that and to- there's I think there's efforts into like how do we open um how the process works more. I mean, there's a GitHub and all that stuff and there's like all these resources everywhere, but like how do we- you know, make that better, um and finding people to do that. Um and then also also like in recently inviting more kinds of uh people. So uh and this is something they've been working on for a while and it's like it used to be all, maybe it was mostly language designers, like people that think about languages a lot.

[00:19:23] Michael Jackson: Mm hm.

[00:19:23] Henry Zhu: And then they started adding implementers, so that's like the people that work on like V8 and like all the browsers and then Then they started adding what they call practitioners, which are just developers like us, um, which who are coding in JavaScript uh every day. And then, you know, now it's like, oh, what if we ask like people that teach programming or like just different kinds of people and seeing getting their input. And and when people complain, it's kind of like they only think about their specific use case or how they use JavaScript. And JavaScript is a is a big This is a language that's affected you know the whole world in all these different ways, whether it's like websites or apps or IoT and all that. And it's like we I think the community wants to have this to be open to think about like how it's used in all in all these cases. And maybe that's like where the conflict is because the people think that this thing isn't as important and this thing is, right?

[00:20:16] Michael Jackson: Mm-hmm.

[00:20:17] Henry Zhu: And it's hard. And it's funny because that reminds me of open source, right? It's like except in a language. And I think-

[00:20:24] Michael Jackson: Oh my gosh, how many times do people show up on your your GitHub repo and they're like, this doesn't work for my specific thing, right? And you're like, think about the broader picture here, right? Is that what you mean?

[00:20:35] Henry Zhu: Exactly.

[00:20:36] Michael Jackson: Yeah.

[00:20:37] Henry Zhu: Um, where they kind of like, you've been maybe you've been like talking about this thing for like years and then this someone just shows up out of nowhere. And it's not like their opinion doesn't matter, it's just that you have no context into what they were saying and you you kind of need to know like what the previous stuff is and and maybe they need to do a better job of doing that too. And that's just hard. Like it's just really hard to show history because it's a lot of that's in the moment.

[00:21:01] Michael Jackson: For sure. Well, well, in terms of in terms of tightening the feedback loop, I think you talked a little bit about, you know, the sort of perception problem um that that they that they may or may not have. But in terms of tightening the feedback loop, um I think Babbel has actually done more for that, for me personally as a developer, as a JavaScript, you know, practitioner than, than almost anything. I remember, you know, first learning about the different stages of proposals in TC39.

[00:21:31] Henry Zhu: Right.

[00:21:31] Michael Jackson: Like I did, I had no— I, I mean, I assumed, I guess, that there was some sort of a, a stage or a process that, you know, that an RFC might go through. But I didn't really know exactly what it was until I started using Babel and they're like, hey, You know, there's a stage 0 preset, there's a stage 1 preset, there's a stage 2 preset. And this is what the different stages are. Um, so, you know, these are the uh the different uh you know features that you can use in each stage. And that really helps helps me, like from a from an outsider standpoint, that's actually how I track the progress of these RFCs. Is I I go to I go to the Babel presets and I see, oh, you know, like uh like class properties, for example, I think. You know, in the last 6 months moved from uh Stage 1 to Stage 2. And that was a thing that for me, I was like, you know, at least able to keep up on it a little bit and see, you know, that things were progressing and and that someday, you know, this is gonna be in Stage 3. I guess Stage 3 is the one where it's like all all it's like a recommendation, right? All all browsers should do this type thing.

[00:22:35] Henry Zhu: Um, yeah, I feel like I could talk about this for a long time. So first point is that, yeah, I think Babel, I feel like that is half of its role, well, in my vision is like most developers think of it as just a way to use what is JavaScript for older browsers, but I think the other half of the role is to figure out what will be in JavaScript later. Um, and and maybe that's just as important, maybe it's more important depending on- I mean, obviously if you don't support old browsers, it doesn't matter. But um I think there's definitely something there and thinking about like how does that like how can we improve that relationship um more instead of just like- because before we would just like wait for the proposals and we implement something. It just felt like we have all this burden of work but no one's actually like helping us, you know. Or like or if I feel this pressure from the community or somebody, anyone, um or internally where it's like, oh, there's a proposal we didn't implement it yet. And then it's like, do I have am I responsible for doing this? And it's like. And are we blocking like the future of the language and all that stuff just because I don't have enough time to do it? And it's like, why aren't like- either we get the community to do it or the community's members to do it or we pay someone to do it. It's like, why- we took 2 years to like even get something for decorators. It's like, it's hard to to think about all that when you're just a volunteer, right? And not just volunteer, like I can be paid full-time to do this and it's still not gonna be enough, right? And it's like, yeah, it's it's weird.

[00:24:04] Michael Jackson: You spoke the the whole reason I'm going down this route is because you spoke about this actually last year at React Rally, uh which I thought you you gave an excellent talk. You spoke a little bit about how Babel helps to sort of bridge the gap between developers and and TC39. So I know you've done sort of a lot of thinking about this and um I guess the the part that for me feels kind of enabling, like I I feel like I could go out and and write a Babel transform or a plugin or something. And that might be a path towards, you know, at least sharing the idea, right? At least saying, hey, check out this cool thing that I added. And all you got to do is just boop, drop this little plugin into your Babel pipeline and everybody's using it nowadays. So it's no big deal, uh, cause everybody's got a compile step. And, and, and at least then we can actually start to try it out, right? That's a huge step forward from where we were in the past where, you know, if, if previously, if I wanted to try an experiment, I mean, what would I have done? You know, introduce a build into your into your pipeline when you didn't really have one? You know, there was no, I guess, standard way, I guess, to share, you know, a step, a compilation step. And now that now that we have one, which is Babel.

[00:25:16] Henry Zhu: So that's definitely something I want I'm think I'm trying to think about more. And I think that's something TC39 is interested in too. And there's the the problem is, um, well, there's a balance that needs to be had too where I think um there are a lot of people, you know, most probably most on the committee are uh people that are scared of like what's gonna happen if it doesn't get in. Uh and that that's a valid concern. Um you know, what how do we deal with that? And I don't think we want to just like, you know, in a negative sense, open the Pandora's box where it's like, oh, anyone can make whatever they want. And then and then you go on GitHub and there's like crazy syntax everywhere and like you don't even know how to contribute to projects because it's like everyone's using something, their own like syntax. Um, and so we do want some kind of boundary on that, but I don't want to like prevent someone from exploring their idea. I definitely want- I would- I don't think anyone would be opposed to that, but it's like, how do we allow someone the the opportunity to explore that and share it with people so that people can test it? Well, I mean, I uh but then also-

[00:26:19] Michael Jackson: Well, I was just gonna say, I mean, I think that's kind of what the presets are for, right? Is when you have a preset and then you say, look, This is, you know, which which the vast majority of developers are just gonna stick to the presets. You know, they're not gonna drop any sort of uh experimental thing in there. I just think, you know, that that at least I've got the ability now to to add, you know, I mean, just just 5 or 6 years ago, I was at, you know, I was working at Twitter and our our compilation step was literally cat. It was just like cat all of our JavaScript files into the same file and like, good luck with, you know, whatever, like. Everything was global, you know, so so at least at least we've sort of advanced beyond that point and we now have, you know, a structure. There's a there's an AST, there's, you know, plugins and and uh you know things like that. I mean, there's even a handbook on how to write your Babel plugins, which I think goes a long way towards— uh I mean, that helped me last year to write my first

[00:27:17] Henry Zhu: yeah

[00:27:17] Michael Jackson: my first one.

[00:27:18] Henry Zhu: And I I totally would want to yeah improve on that. Um and I think so it's funny because you mentioned stage presets and that's actually something that Is kind of some like some people actually want to remove them or think it's better to remove them. And the concern there is that, um, well, first of all, most people don't really understand what the difference is between the numbers and maybe it's just arbitrary like, oh, zero, I probably shouldn't use it, like all that stuff. And then there's also just that technically, you know, how do we— like I'm thinking about how do we version these things? Like All of these things are technically unstable, experimental anyway until they're stage 4 technically. And so if we version them as like major, like if we do it at 1.0 and above, then that means every time there's a proposal change, we got to make a new major bump, major version bump. Or do we do like 0.x or do I like do it by time? It's like it's just so hard to figure out what the right thing to do there is. And so some people think it's better where you just- why do you even have stage presets at all because you have to look it up anyway. So you might as well just ask people to do it like each one individually. Um,

[00:28:24] Michael Jackson: yeah, I mean, I don't, it's hard. Yeah, it is hard. It is hard. I I I can I can definitely see that point of view. Let's uh move on just a little bit. Sorry to be kind of like a rough break there, but um, you did mention TypeScript a little while ago. So I feel like, I feel like Babel and TypeScript, I feel like are kind of, I don't know, not really competitors, but But they kind of are. I mean, didn't TypeScript recently get a plugin for Babel? So you can use TypeScript with Babel.

[00:28:55] Henry Zhu: Yeah. Well, I mean, if we do that, then it's not really a competitor, right?

[00:28:58] Michael Jackson: Yeah. It's it's yeah. That's what I said is I before I thought they were competitors and then all of a sudden I was like, oh, I guess you can use TypeScript with a Babel project. So I misunderstood.

[00:29:08] Henry Zhu: Yeah. So let's see. So um in some sense. They kind of do the same thing and in some sense TypeScript does more than Babel in that it adds it adding the type checking, but I think they have different roles. Um ultimately TypeScript is trying to be a what is it called a superset of JavaScript where they add type checking to JavaScript itself, but they also have their own some small differences, um but they're trying to like uh keep track of the standard and they only implement things that are Stage 3. Um, but like there's no role, like there's no tool that is purposely implementing things that might never make it to JavaScript except Babel. And I think why would anyone want to spend, waste their, you could say waste your time doing that because maybe all of it will go away, right? And so I think Babel is important in that people are willing to spend the time to figure out if it's good enough to go into the language or to refine it so that it becomes better. Um, through this tool and I think um that's why it makes sense for people to to work together to make that happen. Um, and so what happened was um there's a lot of people that they want either they already used— type well, I'm assuming, yeah, they probably use Babel and they want to use TypeScript. And so we already supported Flow, um because you know Facebook, so they had Flow and they had Babel, so they wanted the way to use both. And so I was like, well, why- I'm okay with adding a TypeScript thing if just for compatibility.

[00:30:38] Michael Jackson: So what happens if TypeScript implements something that is not basically that is not compatible with a a direction that future JavaScript takes, right? Do they have to remove it from the language or what?

[00:30:52] Henry Zhu: Um, you talking about for Babel?

[00:30:54] Michael Jackson: Well, if their goal is to be a superset, right, then that-

[00:30:57] Henry Zhu: Uh, yeah, yeah. So so I think, I don't know what, like, I don't have a lot of history on TypeScript itself, but I know Before, they did implement a lot of things early or before they were in the spec, and I think recently they've stopped doing that as much. So it's definitely not like, I don't think that's gonna happen anytime soon. Um, they they do wanna track the language and and that's why they're on TC39, 'cause they're providing feedback. I mean, they do have things that aren't in the language yet, and it's like there's like enums and like these special import equals, export equals syntax, namespaces, like a few things. But most of it is uh the same. But yeah.

[00:31:36] Michael Jackson: So let me let me ask you about, have you have you uh I assume you've done some some React?

[00:31:42] Henry Zhu: Mm-hmm. Yeah. Well, I mean, some, well, mostly.

[00:31:46] Michael Jackson: I mean, this is this is the React podcast, Henry. Right. So uh let me let me just ask you kind of a React-specific question, which is how do you think Babel relates to React specifically, because React, I feel like there was a weird time where, um, you know, React, when it first came out, they were using like that JS transform thing. Uh, the JSX transform, transformer, whatever. And then, and I I actually remember talking to Chris Chedeau, uh, back in the early days. I was like, why don't you guys just use this SixtoFive thing? Or, or I think they might've recently- why don't you guys just use Babel? He's like, yes, we want to. So, so they recently just threw all of their weight. Behind Babel. How much, I guess, does that- I guess, does does the future direction of React now influence Babel at all or is it the other way around?

[00:32:37] Henry Zhu: Um, I wasn't around during that time, but I yeah, I know that that Amjad and a bunch of other people, probably Christopher, were pushing that because they didn't want to maintain it anymore if the community was gonna move to Babel. Um, and I don't we don't I mean, I don't do like calls with like the React team or anything like that. Um, so I, I kind of hear about it after.

[00:33:03] Michael Jackson: Also, but there was one feature in in particular, the, uh like the JSX spread thing where you can like spread all of your props to a component, spread in JSX. And I remember at the time that was introduced, I like hadn't even seen it before. And apparently that was something that they got from, you know, the object spread uh syntax.

[00:33:25] Henry Zhu: Yeah.

[00:33:26] Michael Jackson: Which I thought was cool. I was like, oh, this is something that, you know, that they're taking essentially from the future of JavaScript, the future, you know, which is- there was a there was probably just a Babel transform for it at the time. I'm not sure exactly, but it definitely wasn't, uh, you know, as part of the standard yet. And that's something that they're sort of taking and bringing back into their own project, you know, something that was, you know, made it into React that was influenced by, you know, the future of JavaScript, which again was only enabled by, you know, the only reason we we had knew that something like that was coming down the pipe or even had the ability to experiment with it is because we were all using a a compilation step anyway on our code, uh and and we had the, you know, the ability to drop in this this transform for the object spread syntax. So I thought that was that was just kind of one small, you know, example of how, uh, you know, Babel itself or maybe, you know, Babel, Babel definitely played a role in sort of influencing an implementation of React. One of the other things that I've heard of is possibly, you know, Babel lets uh the implementers of React do some kind of interesting things. So, I've I I haven't actually played with, but I've heard of, um, I think it's a Babel transform that will take out some of your sort of inline JSX expressions and will actually take them out of your render function and kind of put them- and maybe Dominic is a better person to ask about this. But it will sort of put them um so that they are defined uh statically once outside of your render function. And then it will just use references to those things. Do you know what I'm talking about?

[00:35:05] Henry Zhu: Yeah, yeah. Um, so there's It might not be this, but there's two other things. There's a there's a Babel plugin called like inline React something and uh elements, and there's also a hoisting thing where it can hoist static uh like JSX. Like if it was just like a div with like text in it, then we can move that outside of the function because you know it's static. Um I think the thing you're talking about, because you're talking about Dominic, um he uh been working on prepack, um which is uh a separate thing which optimizes your code, um and he he's been working on like specific React Or a better version of that, basically.

[00:35:39] Michael Jackson: Yeah. That's, uh, that when I hear about stuff like that, I'm kind of blows my mind. Like, oh, so the, uh, I mean, cause that it feels like that's essentially what, and I don't know what your familiarity is with some of the other, uh, templating engines, like, like Ember, for example, or Glimmer, but it feels kind of like some of the stuff that they've done, right, with Glimmer in that, you know, we've got, these are the static versions of our template. These are the dynamic versions of our template. You know, the static versions never change. It feels kind of like, oh, you know, we can do that in in JavaScript with this Babel plugin.

[00:36:12] Henry Zhu: Yeah.

[00:36:13] Michael Jackson: Which is really cool because I that's like, I I I for one, I I used to work a long time ago on a project called Mustache.js. Um, I basically like, I basically rewrote it when I during my time at Twitter and I gave it a proper, you know, AST and a parser and a tokenizer and all that stuff. And that's where I kind of got my. I've kind of cut my teeth on like parsing and and interpreters with that project. But after I after I did that and I came to React, I was like, oh good, this is just JavaScript. Like I won't have to ever use like a templating engine ever again. And then the templating people came back and told me, they're like, oh, but we've got templates that are super fast because we've got these static pieces. And I was like, oh man, I wonder if we could do that in just JavaScript. So anyway, I was really excited to see that. Somebody was working on that and thinking about it at least in in in.

[00:37:00] Henry Zhu: Yeah. It's definitely a monumental effort for sure, because it's gonna be way more complicated than templates, right? Yeah.

[00:37:07] Michael Jackson: Anyway, sorry, part of part of that I guess was just a ramble.

[00:37:10] Henry Zhu: Oh yeah, yeah, yeah, for sure. But yeah, real quick though, like prepack is also built on, it's not, it's built on top of Babel. It's not a plugin or anything, but it uses like the underlying Babel libraries.

[00:37:22] Michael Jackson: Yeah, that's, I definitely want to have uh an episode. I've already talked to Dominic about it. He's just, I mean, he's super busy with it, but, but anyway, so there's, there's, there are a couple of projects that are built on top of Babel that are, that are kind of exciting. There's also um the Babel minifier, which is Babbeli, right? Or Babbeli?

[00:37:40] Henry Zhu: Well, no, I know. Well, so-

[00:37:41] Michael Jackson: Is that an old name? Did I just say an old name?

[00:37:44] Henry Zhu: Yeah. Yeah. I, I totally changed it because uh everyone was complaining and I hated it too. So I, I changed it.

[00:37:49] Michael Jackson: Naming stuff is hard.

[00:37:50] Henry Zhu: So it's just Babel minifier now.

[00:37:52] Michael Jackson: So you worked on Babel minify? Was that- can you tell us a little bit about that? Was that pretty cool?

[00:37:58] Henry Zhu: Yeah, um, so, I I mean, I helped launch it. I I don't work on it anymore per se, I just work on Babel in general, like the whole project. Um, we have um 2 people that are maintaining it now, uh Bupathi and Vignesh, and they they're in uh um Germany. Um, but uh they- it's funny, well. To start, um, it was Amjad um that was working on it and Sebastian too. And they both had the idea of making a minifier with Babel. Because it's like, oh, they already already like compile stuff, so what's the difference, right? Um, and so they were working on that and then we um spent a long time on the name. And I think it's funny because at first we were like, oh, we should make it different so that it becomes its own project. But then now I'm like, why would I- like, it makes sense to use the Babel name. There's and and people, like, we picked a name that didn't make any sense because it, like, people can't remember how to spell it and all that stuff. So, and uh what happened was like Amjad and um Kangax, they both um stopped working on Babel. And then I think I was just like, okay, let's just change it.

[00:39:08] Michael Jackson: Oh, so they turned their heads for a second and you swapped it.

[00:39:14] Henry Zhu: Well, I mean, they both went on to do other things, right? So, you know, Unrest is doing awesome work.

[00:39:19] Michael Jackson: I'm cool with that. That's fine.

[00:39:20] Henry Zhu: Yeah, I'm sure they're proud too.

[00:39:22] Michael Jackson: So tell me, tell me uh real quick, what would you say, like, so, you know, Uglify is a thing that's been out there for a long, long time. Um, and and now Babel Minify, and I've talked to other people who are like, well, you know, Babel Minify is able to better, better minify the code because it can understand things at the AST level, which has never really made sense to me because I'm like, I'm sure Uglify probably has an AST and you know, so yeah, like, could you help me maybe understand a little bit more kind of the need for, or how how I guess Babel helps you to build a a a better minifier?

[00:39:57] Henry Zhu: Yeah, so, well, first I wouldn't say that like, oh, just because there's a Babel minifier, you don't like, you don't have to use it. Um, it's definitely, it's newer, so like. It's uh like if you're using Uglify and it works, then you should use Uglify because it's it's more it's more stable in the sense that there's more users, but um it's still Babel minify is built on Babel and so we get to use whatever infrastructure we had before. Um and so yes, Uglify has its own like it it works the same way. It's uh it's uh has a parser and there's a a way to change an AST Um, I think it has its own format or you can use Acorn, I'm not sure. But it's a lot of it is like everything is, they did their own thing, right? And so the problem is in the long run, um, anytime you make a new syntax, you gotta implement that new syntax in their parser. And obviously we have the same problem because, you know, we have our own parser, which that's its own discussion, but we already have to implement, like the whole point of Babel is that we implement syntax early so we don't have to like go out of our way to do it. We're gonna do it anyway. But we get the parser part for free for the minifier, right? Um, whenever our parser updates, then the minifier can automatically read that syntax, which is great. Um, so that's really the reason, right? It's like the the thing, the idea of Babel as a platform is that because we already deal with syntax, everything else could be built on top of it, whether it's a minifier or or a linter or whatever it is, like the syntax part leads to like all these other things.

[00:41:28] Michael Jackson: If somebody introduces a new kind of syntax or a new token, then it gets a new name and your existing tools that operate on the tree without that token, like they just ignore it, right? They don't care. Um, that's cool.

[00:41:39] Henry Zhu: Right. And that's where it's like, like how much do we think about the ecosystem? And like when there's a new- I think about like workflow where it's like once a new syntax is introduced, how does that literally affect the whole ecosystem and what can we do to like make sure everyone's on the same path? And that's, I mean, that's like crazy amount of work, but like how do we like let people think about that and improve it so that it's easier to transition or transition off if you know a certain syntax is removed or something like that.

[00:42:09] Michael Jackson: Awesome. Well, hey, we we should probably wrap it up, but I just I really wanted to give you a chance to kind of drive it home. I think one of the one of the things that you've been stressing a lot lately in your talks at you know JSConf EU, React Rally, uh TC39, Um, you know, you've been talking a lot about like how how vital uh Babel is to the JavaScript community, and that's the main uh reason why I I wanted to get you so bad on this podcast, which is of course specific to React, is because React is JavaScript. So we are members of this community. Babel is uh a a huge part of this community and needs our support. Um, could you could you talk a little bit about more about, you know, maybe how people can help support you, help support the Babbel project or or why you feel so strongly about it?

[00:42:58] Henry Zhu: Yeah, um, the ways you can support us, um, I guess this is pretty straightforward. Um, yeah, I left my job 2 weeks ago, um, and started a Patreon the next day and um, so yeah, you can go to that to support me. It's patreon.com/henryzhu, my name. Um, and if you want to— if you don't want to support me directly, Um, then you can also support our Open Collective, which is just opencollective.com/babel. And that way you can help fund either me to work on improving Babel, the ecosystem, because I'm trying to focus more on like maintaining the project, not just like code itself, but like how do we get more people and like thinking about these kinds of things. And then, like, it's not just me, obviously I don't want to be the only person working on this project. I want to get more people involved. And we already have a lot of people that are either maintainers or core members and I think that we should fund them too to see if they can get fully funded if they want to do that. And then that's just like from the money point of view. Um, and then there's also like actually contributing to the project yourself or your company. Um, yeah, I'm definitely willing, especially I have time now, I'm willing to you know either mentor people or I could do workshops uh to explain how it works or how you can contribute and you don't even have to contribute to the literal like source code in Babel repo, but like whether it's like making your own plugins or videos or like the stuff that like maybe like Kent's doing, um like teaching people like educational stuff or or even just teaching people about JavaScript. I feel like I'm I mean I don't care if it's Babel itself, it's just like people understanding how JavaScript works, the the language or the process of the language, I think improves everything, right? So I yeah. I'm definitely not even tied to Babel per se. Like, I think one of the reasons why I made the Patreon is to say that like, even though I'm fully committed to working on Babel, it's not that's not all I'm trying to do. It's like I'm trying to improve JavaScript as a whole. And even in a maybe in a greater sense, I want to improve open source as a whole. Like, how do we think about it as a community? And the way we do it now, just, I don't know, I think it can-

[00:45:07] Michael Jackson: Well, and it's important too to spread that load because you know, you're not gonna work on it forever. You know, you're gonna, you're gonna move on. You're gonna do other things with your life eventually. There's, there's stages of life. And, and so when, you know, when things- when, when it- when that time does come, it's important to have other people who have an understanding of how things work, who can step in and, and, and keep things going. So.

[00:45:28] Henry Zhu: Right.

[00:45:29] Michael Jackson: All right, Henry Zhu, thank you so much, uh, for coming on to the podcast. Um, really appreciate I appreciate everything that you do for the JavaScript community and appreciate you taking the time out of your day to to be with me and and with the listeners here on the podcast.