chantastic.fm

33: Transcendence and the Future of React with Laurie Voss

Episode 33 · December 19, 2018 · 00:48:13

Hosted by chantastic · With Laurie Voss

Download MP3 · Jump to transcript

Laurie Voss is the Co-founder/COO of npm. He’s traveling the world and telling developers about npm and the future of JavaScript. Chantastic asks about his bold predictions for 2019, what the future brings for React, and how React could beat web components. They talk about fresh npm commands and security features, why teams are picking Vue or Ember, some sad truths about maintaining a diverse company, and the lgbtq.technology slack.

Featuring

Links

Transcript

[00:00:00] Michael Chan: This is React Podcast. I'm Chantastic. This week I get to share with you one of my favorite conversations of the year, sitting with Laurie Voss to talk about one of my favorite talks of the year, NPM and the Future of JavaScript. If you haven't yet watched this talk, you have to. It is the best talk. This year, and such a tremendous overview of the JavaScript ecosystem as a whole. If you want to see where things have been, where they're coming from, where they're going into the future, Laurie Voss does an amazing job covering all of those details. And he sat down with me after his talk to go even further into what that means for you today as a React developer. I think you'll love this talk. It is a great one to end the year on. We'll dive in right after this. This episode of React Podcast is brought to you by React Training. In-person, hands-on training for development teams provided by community leaders and experts. For more information or to find a workshop near you, visit reacttraining.com. This is React Podcast. I'm Chantastic. And today I'm sitting at JSConf in Carlsbad with the incomparable, inimitable Lory Voss. Uh, he's the COO and co-founder of npm. And uh, we're gonna talk about some of the stuff that he is uh up to right now. We got to speak at uh JSConf this year, which is an amazing conference. And um he had an amazing talk on a lot of things JavaScript called NPM and the Future of JavaScript. Um and there was a lot in there for React developers. So um we're gonna talk about that. Uh but first, uh how are you doing today?

[00:02:07] Laurie Voss: I'm doing great today. I think uh I like the way that you refer to it as JSConf. I like how JSConf gets to be the default. Everybody else has to be JSConf somewhere.

[00:02:16] Michael Chan: Oh, that's right.

[00:02:17] Laurie Voss: And JSConf US is just like, no, we're just JSConf.

[00:02:19] Michael Chan: We're just JSConf.

[00:02:20] Laurie Voss: We invented this.

[00:02:21] Michael Chan: It's very American of me. Yeah, so how did you feel your uh your talk went this week?

[00:02:27] Laurie Voss: It seemed to go down pretty well. Uh very, very unusually, I had written it more than 24 hours in advance of the conference. Usually how how my conference talks go is I arrive with most of a talk written or even a whole talk written, and then I have like 3 or 4 conversations with people at the conference, and I'm like, this talk is garbage, and I need to talk about something completely different. And I rewrite it all the night before. And I finally had like the fortitude to not do that this time. Time, and it it was better as a result of having been like you know written in advance and practiced and stuff. I should I don't know, I should have more patience with my talks.

[00:03:01] Michael Chan: Yeah, we actually had the privilege of uh sharing a stage about a month ago at NEJS Conf. Um, were you as prepared then?

[00:03:10] Laurie Voss: No, that was uh that was all as you were there, so as you can as you know, it was very similar to the talk that I gave here. Um, the primary differences were I updated it with another month's worth of data, and I also threw out a bunch of stuff that didn't land as much. I went hilariously overtime at NeurIPS, and so I boiled down what ended up being like 55 minutes of talk into like 34 minutes of talk, and it was, you know, it was more concentrated and more fun as a result.

[00:03:38] Michael Chan: Yeah, I felt like all of the all of the jokes that you put in there were just pristine. They just they were really perfect. It was it worked really well.

[00:03:46] Laurie Voss: I like being able to poke fun at people and then sort of, you know, like throw my hands up and go, "It's just the data. I'm not making fun of you. It's just the data. The data's making

[00:03:56] Michael Chan: This is your first time on the show, so I'd like to ask, how did you get into programming?

[00:04:01] Laurie Voss: I'd sort of messed around with various kinds of programming as a kid. I'd like gone to like computer camps and things, and those things seemed interesting to me. But where it really got me into programming like as a career was um the introduction of the web. Uh internet access arrived in Trinidad in like 1996, and I saw my first web page uh in like December of 1996, and I wrote my first web page like four hours later, it was very, very clear to me, like very instantly, I was like, "I like this and I want to do this the rest of my life." And it's very strange to me that the decision I made when I was 14 years old has absolutely been true. That is exactly what I spent the rest of my life doing.

[00:04:45] Michael Chan: Do you remember what the first web page you made was?

[00:04:47] Laurie Voss: The first web page that I made, um, it was, you know, what is the first web page everyone makes? It's like, "Here's my home page. This is about me." I remember why I made it though. The homepage that was set by default by the ISP in Trinidad was trinidad.net, which is defunct now. But trinidad.net, it was a website that looked exactly as professional as any other website on the internet that day. I was used to living in Trinidad as like a backwater, right? Like our TV was crappy and our radio was unprofessional and, you know, like our print ads weren't as like polished as what you saw on American cable. But our website, looked just as good as the New York Times, just because there was only so much you could do with HTML in 1996. And the people in Trinidad could do exactly as much as the people at the New York fucking Times. And it was wonderful to me. Yeah. I had- I was like, I can be just as good as anyone in the world. This playing field is level right now, and I am on it. I am gonna do this. And that was very clear to me, like, from the get-go. I was like, I can do this just as good as anybody else.

[00:05:49] Michael Chan: Now, obviously you've been working on the internet for a really long time. We've all started to see that kind of power start to like- people start to grab for power in the internet space. And so do you feel like that's still true today, or is it less true, or is it more true for the people who are coming into the web right now?

[00:06:08] Laurie Voss: That's a really good question. I think it is even easier now to produce a website of the complexity that I was producing in 1996. I could produce one of those. In 10 seconds. In fact, I wouldn't even need to, right? Because you could make a website that is just as good as a homepage was back then by, you know, starting a Tumblr and typing into it, right? Like, you don't need to make a website to do that anymore. Yep. So a lot of people, I think, look at the complexity required to build what we would consider to be like a modern website and go, oh, this is much less accessible. And that's true, right? Like, I could learn all- literally all of HTML I could learn in an afternoon in 1996, and there was no CSS and there was no JavaScript. I was done by the first afternoon. And now you could spend years just learning like the the ins and outs of React and you would be really good at one corner of one framework of the whole space of the web. So in that sense, it's harder, but on that but like that's a a function of because we do so much more stuff now. Yeah. So yes and no. It's harder to become a professional web developer now, but it is much, much easier to build websites.

[00:07:20] Michael Chan: I want to talk about your talk a little bit. There was a ton, a ton of data and uh we'll link it, but I wanted to kind of like start with some of your, your stats and kind of the framework of the talk. So, um you said that 10 million people are using npm right now?

[00:07:36] Laurie Voss: Yep.

[00:07:37] Michael Chan: How many gigabytes are downloaded every week? Do you remember?

[00:07:42] Laurie Voss: We download 6 billion packages a week.

[00:07:44] Michael Chan: Okay, 6 billion packages.

[00:07:45] Laurie Voss: And in terms of how much data that is, I don't even know anymore. It's a lot. Although it's actually- it's- we generate more in terms of log data than we actually- than is actually downloaded. Most packages are quite small. Um, so it's one of these weird features. It's like I produce more data by recording what it is that people downloaded than they actually downloaded.

[00:08:08] Michael Chan: Yeah, yeah. 97% of app code is actually downloaded from npm. Is that correct?

[00:08:14] Laurie Voss: In a modern web application, so a React app is an excellent example, the application code that the developer themselves writes uh is about 3% of the total code in the application.

[00:08:24] Michael Chan: That is wild.

[00:08:25] Laurie Voss: That's not like 97% of all application code everywhere, but modern web apps, the code that you write is only the last 3%.

[00:08:32] Michael Chan: Crazy. In your talk, you talk about how NPM had started originally as the Node Package Manager.

[00:08:40] Laurie Voss: Yes.

[00:08:40] Michael Chan: Right. And how that is shifting, and the majority of users of NPM are using it to make web applications.

[00:08:47] Laurie Voss: Indeed.

[00:08:48] Michael Chan: Can you tell me a little bit more about that?

[00:08:49] Laurie Voss: So the the stats are 93% of people who use NPM are using uh are using it to write code for the browser. That's not us guessing, that's us running a survey of 16,000 people and asking them, what are you up to? In that same group, 70% say they are writing some server-side code, but the focus for most people is frontend applications, and that is a total reversal of how npm thought it was going to be.

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

[00:09:15] Laurie Voss: Right, we consider ourselves a Node company. Um, I remember very distinctly because there was this gap in JSConf. Um, so there was the last JSConf I went to was 2015, and now I'm uh at JSConf in 2018, and in that intermediate period was when this change really happened. And I remember in 2015, it was a little bit strange being npm at JSConf because we would be like, "Hey, you want to talk about Node?" And people would be like, "No, I'm a frontend developer." And now every single talk is involving npm. Every single frontend developer takes it for granted that you will be using npm to put a frontend web application together. And that only changed in the last 3 years. It feels like bedrock now, but it was not at all true. In 2015, people were like, I can build frontend web apps anyway. And now npm is just the thing you use to build websites.

[00:10:03] Michael Chan: Yeah, no, that wasn't a foregone conclusion, obviously. It wasn't even something that you anticipated back in 2015.

[00:10:10] Laurie Voss: It was something we were hoping to do. In 2014, we had a bunch of really serious conversations about like, what can it- like, frontend developers, there's so many more of them than there are Node developers. That was clear even then. What can we do to make npm attractive to frontend developers? Because there's this thing called Browserify, which lets you use Node packages on the frontend. And that seems really exciting, seems like that's gonna take off. What can we do about that? And we were like, you know, we were hemming and hawing, and in the end, we did what npm frustratingly has to do quite often, which is go, we need to concentrate on keeping the registry up. We can't try and steer JavaScript at the same time. Um, and what happened instead was that the frontend developers figured it out on their own. The Webpack folks came up, uh, and they um significantly improved the ergonomics of Browserify. Browserify definitely invented the concept. Sure. Um, all hail Substack, but Webpack really nailed it and the result was just this explosion in frontend usage of npm.

[00:11:04] Michael Chan: Does Webpack then seem like the inflection point?

[00:11:07] Laurie Voss: In an ecosystem as complicated and as big as ours, it's very hard to point at any individual factor. Um, but I will say that pulling the stats out of my head again, uh, I think it is something like 79% of people who use npm are using a um a bundler of some kind and 80% of those people are using Webpack. Webpack is the overwhelming choice for doing any kind of bundling. So clearly, uh Webpack has had a huge impact there.

[00:11:34] Michael Chan: What do you think some of the ergonomics were to Webpack that made it the uh the the front-runner now over the um originator of the idea, Browserify?

[00:11:44] Laurie Voss: Browserify was unopinionated, and that was kind of its downfall. Webpack, right there in the name, it says Webpack. You are building a thing to put stuff onto the web, Browserify, James became sort of overwhelmed with the possibilities of what he had built. He had built this really amazing technology that could transfer one type of JavaScript into any other type of JavaScript, and the number of transforms you could apply was bewildering. And so he did this sort of like, you know, choose your own adventure situation with Browserify, whereas Webpack was like, we'll just, we'll pick things for you.

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

[00:12:21] Laurie Voss: Developers hate having to make tooling choices. They would much prefer that the defaults work. And that is that's basically what's why um Webpack is winning, which is interesting because, as as you know, I mentioned later in the talk, one of the things that's most striking about React is that its huge success has come despite the fact that it is a choose-your-own-adventure situation, right?

[00:12:42] Michael Chan: Yeah.

[00:12:42] Laurie Voss: It's like you have to to make a Webpack in React, you have to choose a router and you have to choose a bundler and you have to do a bunch of other stuff. And it's a it is a testimony to how powerful React is that people are putting up with that because they hate it. They really hate it.

[00:12:58] Michael Chan: So I came to React from a lot of experience in the front end, doing Angular 1 and then Ember, which was kind of my savior at the time because Angular was very opinionated and then Ember felt like magic because I could just use the Ember CLI. It did all the stuff that I didn't want to have to do. And then I was good to go. I could just start focusing on on app code. Mm-hmm. And I I realized that that started to fall over when I was working in a company and we had these very established uh Rails apps that we wanted to just do a little bit a little bit more like interactive stuff on top. And it was almost impossible to get the Rails opinions and the opinionated Ember stacks to to really work Perfectly well together.

[00:13:44] Laurie Voss: Yeah.

[00:13:45] Michael Chan: Um, I know for us, like, React was a perfect spot for us because it just gave us the component, which is what we need since needed since we already had a framework. In your talk, you mentioned that that it seems like there's a lot of reversal of that right now, and it seems like it the Vue might be kind of and that opinionated mindset again might be kind of chewing away at what React's doing.

[00:14:08] Laurie Voss: To put in context, what I said in the talk was uh React's growth has been enormous. Something like 60% of npm users are using React, which is absurd when you consider how many npm users there are. And React's growth relative to other packages in the registry for the last 4 years has been amazing. But in the last 12 months or so, that growth has slowed down. And also in the last 12 months, the growth of uh Vue and to a lesser extent Ember has really picked up. So, um, you know, correlation is not causation. Sure. But my guess is that uh Vue is stealing some of React's thunder, especially in terms of new users. Um, and I think it goes back to the point that I was making earlier, which is that Vue comes with defaults that work a lot more of the time, and you have to make fewer choices. And anecdotally, when I went on Twitter and was like asking people who've act- you know, actively using Vue, what made you pick it over the alternatives? That answer came up a lot. It was like a sort of sweet spot between the amount of flexibility and extensibility that it allowed, but the the lack of setup that it required.

[00:15:11] Michael Chan: Yeah. What are some of the successes that you've seen in the React space, um given how uh modular it is and the fact that um things can independently succeed apart from their relationship to React?

[00:15:25] Laurie Voss: Um, I think you're probably steering me towards a specific insight there, which is uh Flux. So, when, again, as I mentioned in the talk, when React was released, Facebook released Flux at the same time. And Flux was how Facebook was managing state in very large applications for itself. And Facebook sort of- it sort of expected that developers would use Flux as well, but it was kind of weirdly apologetic about it. It was like, you could do it this way, although it seems kind of overkill for most applications Facebook, even Facebook was like, this probably, this probably won't work for you. Nobody listened. You should probably write your own. Um, so people started using Flux a lot, um, but but Facebook was right, the ergonomics were not good for for smaller web applications, you know, where any app is smaller than Facebook. And so Redux came around instead, and as soon as Redux was available, Flux's usage began to fall off a cliff. Redux was a much better set of choices for for that. problem. And the thing that I was saying in the talk was that is a triumph of like a design decision, right? If you decide as React, we are not going to couple this, we're not going to couple this component model to this data model because we don't think they're gonna be as popular as each other. That was exactly right. Like if Flux had been coupled to React, then Flux, Flux being unpopular would have pulled React down with it. And instead what happened is React continued to dominate. In fact, React, one of the best things about React is that it goes into a bunch of places where a web framework strictly doesn't need to go at all. Right? People are building desktop applications in React. People are building mobile applications in React, right? React Native is a big deal, and that doesn't need a whole bunch of web framework stuff at all, right? You don't need a router. You don't need, you know, a bunch of data model stuff that that web apps need is just not present in React at all. And that means that React's potential range of applications is much broader, which is part of why it's getting so much usage.

[00:17:19] Michael Chan: We've seen a lot of development in the uh around GraphQL, and there's two kind of competing uh or 2 front-runner libraries in terms of consuming a GraphQL endpoint, um which are Apollo and Relay. Um which one has which one seems to be having the most uh success right now?

[00:17:40] Laurie Voss: Um I hesitate to uh to sound too authoritative on GraphQL because I am a complete neophyte on on GraphQL, but the the stats do say that Apollo appears to be running away with it. Apollo is something like 4 times as popular uh as um any any competitor that I could find. Um but like I said, uh I'm sufficiently ignorant about uh the GraphQL space that there literally could be some other package out there that I just haven't heard of yet.

[00:18:05] Michael Chan: So you made some bold predictions uh in your talk. Do you mind recapping some of those for us?

[00:18:11] Laurie Voss: Sure, I can make the uncontroversial ones. Um the the most the most uncontroversial one is that no framework is going to last forever. Uh I My examples were Backbone and jQuery. People like to hate on jQuery now. jQuery was an amazing, amazing invention that completely changed the way that we use the web and that we program the web. And people sort of say that, you know, oh, jQuery is dead now. jQuery isn't dead now. jQuery transcended, right? Like document selectors, jQuery invented those and they're part of the browser now. jQuery was so useful, we built it into the browser and we didn't need the we didn't need jQuery anymore because now it's in everything. Yeah. But jQuery, the library, uh its heyday was only about 4 or 5 years. Um Backbone had a similar lifespan. React is 3.5 or 4 years into into that cycle right now. Um and I think the most interesting thing about React is that it has the potential to do what jQuery did. It has the potential to transcend rather than decay. Because what tends to happen with frameworks is people use a framework, they love a framework, they learn from the framework, and they build a better version of that framework or a new framework that learns from the mis- mistakes of the last one, and the new one takes off. And the old framework doesn't fall off of a cliff. People continue to use, you know, continue to maintain applications written in the previous framework, but they slowly retire those applications. And as a result, the usage for that um for that library slowly decays, and the new one begins to take off. And like, by default, that will happen to React too. By default, that happens to every library. Yeah. But there is a sort of escape clause, which is if React is so useful that we build it into browsers in the way that we built jQuery into browsers. If the component model that React has introduced becomes a first-class construct to browser manufacturers, which is not impossible, then React could do what jQuery did and just sort of like, you know, ascend into the pantheon of like, it's web technology now. We don't even think of it as a library. And the thing that could do that for React is if React is- if React components are truly reusable. So one of the things, the other things that I mentioned in the talk is this study by Leo Mirovich of uh um programming language selection. He studied academically why people pick what programming languages they pick. Um you know, is it because they like the features, they like the language, they love the performance, their you know, their boss tells them that they have to, you know, what are all the possible reasons? Um and over and above anything else was there was a library in that language that helped me do it. People will pick a language because of the libraries, not the way other way around. That goes a long way to explaining JavaScript's success because npm is so big these days that people are being driven into JavaScript, sometimes against their will, just because there's so many npm libraries that help them do what they want to do. If React components are truly reusable, if it becomes the pattern that people start putting websites together not by writing a bunch of HTML, but by installing a bunch of reusable React components and and starting to glue them together at a higher level of abstraction. There could become this sort of gravity well of really useful reusable React components that keep more people sucking more people into React. They'll write more components. This ever-growing library of components will become unstoppable and nobody will ever stop using React. That could happen. The odds are against it. Sure. But it is- it is- I would say that if it doesn't happen in the next 18 months, it won't happen.

[00:21:40] Michael Chan: Okay. So the competition against something like that would be the work that's already happening in web components?

[00:21:47] Laurie Voss: Web components are an interesting question. Um, I went deep on web components recently because I was writing this talk and I was looking at that, and that is one of the potential conclusions of writing this talk is that maybe web components are what we're going to use to do this kind of stuff. So I asked on Twitter for people who have actually built things in web components, How did you like it? And I explicitly said, if you've decided not to use web components and you think you know why, I am not interested in hearing from you. I do not want to hear all the clever reasons why you think web components are stupid. Those people can stay out of my mentions. Tell me if you specifically wrote something using web components, what did you like about it? Yeah. And it was really interesting because a bunch of really good practitioners showed up in my mentions. And uh it turned into a sort of mini conference of people trading best practices and things of of like, you know, this is what we did and this is what worked. This is what worked and this is what didn't work. And the feedback was pretty universal that people like the performance implications of having it built into the browser, but the ergonomics of the technology itself were not good. Um, they like the the fallback position of being able to use a tag, and if the tag isn't supported, then you just get the content inside the tag. That's cool. Um, but they really didn't like uh the fact that um There's a lot of of low-level DOM manipulation required to to write the web components themselves. And in general, the whole abstraction is kind of too low level to be useful or to be or to be useful by itself. A lot of people are using a a framework called Stencil with web components.

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

[00:23:23] Laurie Voss: Um, and if you're using a framework with something built into the browser, that kind of suggests that the level of abstraction is wrong, right? Like if you shouldn't need to if if we got it right. So if you're gonna replace React the framework with Stencil the framework, which is slightly less of a framework because some of it is built into the browsers, have you really built something better or are you just doing the same thing a different way? And also the overriding feedback was like, they're not ready yet.

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

[00:23:48] Laurie Voss: Like a bunch of them just isn't supported. And and so it may not be it may not be fair to be judging them yet. But I I wouldn't go so far as to make a confident prediction about it, but my my my expectation of web components is not positive right now.

[00:24:04] Michael Chan: If the thing that excites most people are the performance implications of that, does it seem like possibly there's a future where React using WebAssembly as a target could bridge that gap?

[00:24:18] Laurie Voss: That's a good question. I had uh one of the great things about conferences is you meet people you wouldn't otherwise meet. Uh the PM for WebAssembly and and a couple of the devs from uh V8 uh from Google are here. And I had a really fantastic conversation with them on the first night about WebAssembly and how to use it, um and what where they expected to go. And it's interesting because the WebAssembly guy obviously was like, yeah, WebAssembly is gonna take over the world, whereas the V8 guy was like, WebAssembly isn't actually that much faster than V8. He's like, JavaScript's fine. And I'm like, well, of course you'd say that, you write V8. But the actual problem is that V8 right now, or or rather WebAssembly right now, it can't talk to the DOM directly. If it's talking to the DOM, which is like what you're doing all of the time, it's as slow as JavaScript. In fact, it's slower than JavaScript because it's constantly crossing the blood-brain barrier from WebAssembly into JavaScript. There is a proposal, the name of which I forgot, I think it's the Native Modules proposal or something along those lines, that would let WebAssembly interact with the DOM directly. And if you did that, then you could write stuff that was WebAssembly and much, much, much faster, probably.

[00:25:20] Michael Chan: Wow.

[00:25:22] Laurie Voss: Uh, but that's embryonic, no one's even implemented it yet, they're still just talking about it. WebAssembly is probably not going to be any kind of short-term solution to a a React performance problem. React doesn't have that much of a performance problem. Um, what I think would be a really great idea, but it's just me, is one of the browser manufacturers should get just say, this component thing and the JSX in there, I'm just gonna make it a first-class thing. Like, every time somebody says we should make JSX part of JavaScript, people immediately crawl out of the woodwork to say, oh, but it's fundamentally mutually incompatible with some of the existing language features of JavaScript, backwards incompatible. You couldn't- I'm like, of course we could. Of course we could. We have made- we have made sense of much more complicated, mutually conflicting standards problems before. We just declare some stuff to not work anymore, right? Like, there's no mark- key tag either. Like, you can, if something is sufficiently useful, we will stomp on backwards compatibility sometimes. And even if we don't, then you, you know, you can put in feature flags or use strict or, you know, use JSX or, you know, some kind of flag that says this is a situation where JSX is gonna be fine. We should, I think we should build JSX into JavaScript and I think we should make React components a first-class feature of browsers. And that would make them a lot more performant and let's see what happens.

[00:26:41] Michael Chan: Do you feel that the React component model is ready at this point for something like that?

[00:26:46] Laurie Voss: I think anything that has 6 million users is ready enough.

[00:26:50] Michael Chan: Okay.

[00:26:51] Laurie Voss: Um, and I also, having been in web development for 22 years, believe very strongly that standardization should follow the users and not the other way around. All of the times that the standards bodies have got together and said, we know how this is going to work, and put something together, it has been an abject failure. We did it with HTML3, we did it again with XHTML 2.0, a standard so bad that we threw it out without implementing it. We did it with a bunch of other XML- basically, like, over and over and over. Every time we have a good idea, we standardize it, and then we give it to the standards bodies to take it to version 2, and the version 2 is so bad that no one uses it. So whether or not the people who make browsers and the people who standardize HTML think that React components are the best possible solution, They should look at the facts on the ground and say that everyone is using it already, so we should just let them use it and standardize it.

[00:27:42] Michael Chan: I'd be I'd be happy with that.

[00:27:44] Laurie Voss: I mean, of course you would.

[00:27:46] Michael Chan: So tell me a little bit about React at npm. You're using it for the front end of npmjs.com and .org, right? Mm-hmm.

[00:27:55] Laurie Voss: It's funny that you should say .org. .org hasn't existed for 4 years, and it was so subtle nobody even noticed we retired it. .org is only the registry. The registry itself, where everyone downloads the packages from, is npmjs.org, and specifically so that our website never takes down the registry, those are separate domains. Yeah, so we use it on npmjs.com. My web team is gonna be listening to this podcast and be like, now he's gonna talk about stuff he doesn't know, because I didn't implement our website, obviously. Like, we have a bunch of people who did that. But I believe I am correct in saying that while we use React to do uh the dev mode because it has really great debug tools, And in production, it is actually Preact. We made the, you know, the trade-off there in terms of compatibility and performance and went with Preact as being a lot uh smaller and faster to deliver. And we've been pretty happy with it so far. You know, sort of the promise of React is like, you know, really fast iteration, um being able to reuse a library of components and stuff like that, and that's definitely paying off. It took us much longer than we wanted to rewrite our previous website in React components, but now that they are there, adding new pages is really fast, like really delightfully fast.

[00:29:04] Michael Chan: Yeah, I noticed after the the incident with- I can't remember exactly which ESLint plugin it was.

[00:29:10] Laurie Voss: It was ESLint itself.

[00:29:11] Michael Chan: ESLint itself. Okay. Um, I remember very shortly after you had had you had had all of these new features implemented where you could see, you know, which users on which packages had had um two-factor auth enabled, et cetera, et cetera. And I was amazed at how quickly you rolled that that UI stuff out?

[00:29:29] Laurie Voss: That- well, so the UX stuff genuinely did um get out the door really quite quickly. There was- it was uh a little bit of an illusion quite how fast we appeared to be moving there. We were literally a week away from releasing that feature anyway.

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

[00:29:42] Laurie Voss: It was really annoying to us that we were about to release that feature and uh a security incident that was basically the result of the lack of that feature happened. Uh but we were like, hey, look at this thing we made earlier. It's a whole cake.

[00:29:57] Michael Chan: Because it might have been less likely to happen or been more visible if you'd been just right ahead of it.

[00:30:02] Laurie Voss: It's one of those things when you make security tools that aren't by default, right? Like if everybody had— like we'd already released 2FA, and if everybody in the ESLint team had been using 2FA, then they'd have been fine. Sure. Um, but also when you build security tools, you know that you you can't blame the user for security failures. If something has— if a security incident has happened, it's because you put together a system where it was too hard to use the security or the security wasn't there. And in this case, it was the former. So, uh, yeah, like we we should have made it easier for the ESLint team to be responsible, but we didn't. There were some ergonomics about uh automated builds and things like that that meant that it was convenient for that one person out of everybody who works on ESLint to turn off 2FA. Um, and that turned out to be the weak link in the armor.

[00:30:45] Michael Chan: npm is doubling, tripling, quadrupling down on security. Uh, can you tell me a little bit more about what's going on there?

[00:30:52] Laurie Voss: In the same set of survey data that we have been basing the rest of this talk on, we asked people a lot of questions about security. Um, and uh something like 77% of people said that they were concerned about the security of the open source packages they use. That's not really surprising. Everyone should be concerned about security. Um, but 52% of people said that the tools that they use, uh the tools available, um, to judge the security of open source software were not good enough. And that's not great. It's that that's that doesn't mean like oh, it's too hard or it's too much trouble. They were like, the the tools don't exist, was the message. Since the very beginning of npm Inc. in 2014, we were like, and one day we should start getting into package security. And it was becoming a bigger and bigger problem that we couldn't hand wave away. And we were like, okay, this is going to be really, really expensive, but we are going to have to become a security company as well. That was not the plan. We had a plan that was gonna get us to profitability. It was gonna be great and we had to be like, actually, no, we're gonna have to take a bunch of our money. We're gonna have to buy a security company, uh and we're going to have to become a security company, and it is going to push the whole plan out by a couple more years because it turns out security is too important to wait. So that's what we did. Luckily, we had— uh there was a company sitting there, the perfect company to buy, uh Lift Security, who'd been our security auditors since the beginning of npm Inc. Adam Baldwin in particular was a uh you know like a personal friend to us as well as a really leading light in JavaScript security. And he'd also been sort of like batting down the door for a couple of years going, this is really stupid that I'm outside of npm. We were like, we agree, but you're really expensive. Um, but eventually we figured it out. Yeah. And so now now Lyft Security is part of npm Inc. Um, and we've turned a bunch of of uh Lyft's products into uh just features of npm, which is honestly what they always should have been.

[00:32:48] Michael Chan: What does that look like as a consumer of npm packages? Uh, how would someone use these security features?

[00:32:54] Laurie Voss: Um, so if you're using the npm CLI, and you should be using the npm CLI uh for this reason, whenever you run npm install, it will automatically let you know, uh, it will do what we call a quick audit, which is it will let you know if any of the packages that you've just downloaded contained any known vulnerabilities, uh, whether they were critical or severe. Or high, or whatever. If you are alarmed by that information and you run npm audit, it will give you a lot more information about them, uh including how to fix them. And the good news there is that usually uh the act of discovering a security vulnerability means that the author of that package fixes it, which means that there's usually a new version of the package available which fixes it. So the npm audit information usually consists of a bunch of instructions on how on running npm again, Uh, to to upgrade packages to fix the security vulnerabilities. I wish I could say that it occurred to us the first time we put all of this together that if npm is instructing you to run npm, why doesn't npm just run itself? But we didn't. We got all the way to releasing that feature before we were like, why does it just tell you to run npm? So now npm audit fix does that. npm audit fix takes its own advice and runs npm to fix all of your security vulnerabilities that it can, which is really quite magical, right? It's like quite a it's quite a step change in 8 months to go from well, I guess we need to do security too. npm is a piece of software that used to manage your packages, but now it fixes security holes in your software.

[00:34:17] Michael Chan: Yeah, it's a huge difference.

[00:34:19] Laurie Voss: That's a big transition in terms of value-add as a tool.

[00:34:22] Michael Chan: So which version of npm do you need to be on in order to take advantage of these amazing features?

[00:34:29] Laurie Voss: Thank you for the softball. The current version of npm is 6. I think we are at 6.4 right now. Um, and that is what everyone should be on, because that's the one that has all of the performance improvements. Uh, npm is something like uh 25 times faster than it was 2 years ago. Uh it also contains all of the the audit and audit fix functionality, which is really, really useful. And uh we are seeing uh you know real improvements in the in the ongoing security of of open source JavaScript just as a result of this sort of ambient information landing on developers these days.

[00:34:59] Michael Chan: Is there any other npm command that we should we should know of that might be hidden there that would make our lives way better?

[00:35:06] Laurie Voss: Um the other one that I love to plug is right now is npm ci. There's a very common trope in JavaScript land. If you run uh rm -rf node_modules and then semicolon npm install, you're like, blow node_modules away and reinstall it. Uh if you run npm ci, it will do exactly that, but it will be twice as fast.

[00:35:27] Michael Chan: Wow.

[00:35:27] Laurie Voss: Um uh where npm— that's that's sort of the party trick. Um where npm ci is intended to be used is in continuous integration environments. Um, the thing about continuous integration environments is that they tend to have that kind of shape. They tend to be a fresh VM with no cache and no packages and no node_modules folder. Um, and as a result of knowing that we're running in that environment, npm ci can be like, okay, I'm not even gonna do all of this like tedious error checking. I'm just going to suck packages down from the internet and slam them onto your disk as fast as I can possibly do them. So, npm ci is really fun because it's literally limited by how many cores you have. It's not even how fast your network is because the packages are quite small. If you put npm ci on a supercomputer, it will go faster than if it's on your laptop. And you don't run into very many processor-limited web development use cases, I don't think, right? No one's like, my web app would go faster if I had more cores, but this one does.

[00:36:21] Michael Chan: This one does. When we were at NEJS, we were having a conversation and someone asked about diversity in hiring, and you had a really interesting answer, and I'd love to kind of bring that back up again. But you said something about how npm has been diverse from the beginning and how that's really shaped the way that hiring has happened throughout the whole process. Can you talk more into that?

[00:36:49] Laurie Voss: I would not want to say- I think it is taking too much credit to say that npm was diverse from the from the beginning. NPM, by some standards, was more diverse than other companies in Silicon Valley was from the beginning. NPM was more queer than the average company. It had more Hispanic people than the average company, and it had a better gender balance than the average company. And all of those things have remained true. And the weirdest thing is they've remained true in almost exactly the same ratio since we were 5 people to when we were 35 people. That's crazy. The same ratios that were in the first 5 people are still true. But there are lots of there are lots of axes of diversity, and we are not present on some of them. Sure. Uh, we are good at age diversity. We do not have as much racial diversity as we want. There are you know, there's a zillion intersectional axes of diversity, and we're not- I would not yet call us a fully diverse company, but we're doing okay. And the but the thing about it was that the interesting thing about it was that those ratios were so locked in. The company you are at the very beginning is pretty much the company you stay. And you can see that happening in companies from every size, from us to Google. The company that Google was when Google was 10 people, it's still the company that Google is. And Google is spending, you know, millions upon millions of dollars trying to stop it. Yeah. But they're still exactly the company they were when they started. They're still like, "And if you don't have a PhD, we're kind of gonna look at you funny." That was true of Google in 1999, and it's still true of Google like 20 years later, which is bizarre because they're like, "We know, we have data, we've done incredibly expensive studies that that's a stupid way on which to hire," but it's still the way Google is. It's not a great message for diversity. It's like, if you mess it up in the first 10 minutes, you're done. You have one chance to get it right, and after that, there's nothing you can do.

[00:38:37] Michael Chan: Do you have any insights into why that might be?

[00:38:39] Laurie Voss: The overriding thing that brings people to a company is networks. People hire their friends, they tell their friends this is a good, safe place to work. And because hiring is so broken in most of Silicon Valley, people trust other their friends' recommendations over any other signal. First off, the signals are really crappy. Like, a job description is like- can you imagine if you wanted to get into, like, if you wanted to marry someone and they were like, I "I think you should marry me. Here is a 4-paragraph description of what marrying me would be like." Keep it to one page, please. Right. And you're like, "Okay, well, you've obviously only written the good things about yourself. I think I'm well ready to marry you." That's how we do job descriptions. We like- like, at both- at at best, we're doing like 4 or 5 hours of interviews, and even that is a lot of trouble. Like, it's a- it's a ridiculously small amount of information that we make these decisions on. And as a result, people don't trust it. So people use, oh, my friend works there and they say it's good. And so if you get if you get your network set correctly at the beginning, that network perpetuates itself. People hire people like themselves because those are the people they know.

[00:39:45] Michael Chan: So we're gonna wrap up in just a second, but I wanted to ask you about a community that you started. One of my hopes for this show is that as people learn about open source communities or Slack communities, they'd be able to find safe places to communicate, share their experiences, hear from other developers that maybe had shared experiences. And uh you started LGBTQ.Tech, and uh it's a Slack group. Yep. And um yeah, can you tell me more about that?

[00:40:16] Laurie Voss: Um, the funny thing about LGBTQ.Tech, the LGBTQ Slack as we usually call it, is That it was almost entirely an accident. Um, one of the one of the things that I've done in my life repeatedly is formed online spaces for queer geeks. It's just the thing that I do. I used to— I I still own, in fact, a domain called gaygeeks.org, where I created a forum which was like specifically for that. Um, and there were a bunch of other times that I've done this in my career in the last 20 years. And so it was almost an afterthought. In like 2014, I was like, huh, this Slack thing seems to be taking off. And in fact, it was literally because Slack had added the feature of being able to have multiple Slack groups in the client at the same time. Oh yeah, yeah. And I was like, oh, well, I'm only in one Slack and I want to see what that feature looks like. What Slack should I create? I know, I'll create a queer Slack. I tweeted, if I created a queer Slack, would anybody join? And immediately like 200 people were like, yeah, obviously we would. And so I created it mostly just to see what the Slack client looked like. With 2 slacks in it, and now there's like 4,000 people in it.

[00:41:19] Michael Chan: Wow. Amazing.

[00:41:20] Laurie Voss: I would say that it wasn't what I intended, but what I intended was just, you know, there to be queer people in a Slack, and it's very much that. It was it's very different from what I would have expected.

[00:41:28] Michael Chan: Sure.

[00:41:28] Laurie Voss: Um, it's it is a space that prioritizes um safety uh of marginalized groups over basically anything else, and that makes it a very good place for some people and uh an uncomfortable place for some other people. But I I I sort of like it for that. Um and it's very self-regulating. When I say I started it, starting it is basically all that I did. Um very quickly, a group of of the heaviest users sort of, you know, self-identified as being as like, we should be the admins. And I'm like, you're right, you should be the admins. And we I made them the admins. And now they, you know, as people have moved on and stuff, they've like nominated their successors and it's entirely self-regulating.

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

[00:42:12] Laurie Voss: And there's hundreds of channels in it, you know, like from local neighborhood groups to like, you know, people looking for jobs or people talking about JavaScript or people talking about whatever, you know, technology the thing is, uh, you know, like romantic topics, all just every possible subgroup and combination is there. And there's this, you know, amazing hierarchy of like how safe a channel can be. So there's like a flirting channel and then there's like a flirting channel, but where it's PG-rated, and then there's a flirting channel where it's R-rated. And like, we we are gonna make very clear that no one's gonna be uncomfortable because the channel name is gonna be 400 characters long.

[00:42:50] Michael Chan: You know exactly what you're getting into.

[00:42:52] Laurie Voss: Right, exactly. But yeah, it's it's a really it's a really great space, and there've been a lot of success stories from it. Like people have got jobs, people have like found partners, people who are in remote locations have just been like, oh, it turns out I can be a web developer and gay at the same time, and I didn't know that that was gonna be okay. So I'm I'm super happy it exists.

[00:43:10] Michael Chan: How far does it uh reach? Is it mostly US folks? Is it all over the world?

[00:43:17] Laurie Voss: Um, it is mostly English speaking, but it is it is fairly widely geographically distributed. Um, I tend to mention it whenever I go to a conference, and I've gone to conferences all over the place. So there's uh a sizable South American contingent. Oh, awesome. A big chunk of Europeans are on there. Yeah.

[00:43:33] Michael Chan: Is there a question that uh you would've liked to have been asked, but I did not ask it?

[00:43:38] Laurie Voss: Does npm have any useful paid products for React developers?

[00:43:43] Michael Chan: Does npm have any useful paid products for web developers?

[00:43:49] Laurie Voss: It absolutely does.

[00:43:51] Michael Chan: Tell me about them, please.

[00:43:52] Laurie Voss: If if what you're doing is you are putting together React components in particular, One of the things about React components is that they are intrinsically uh packageable, right? They have a package.json at the root, and you can put them together that way, um and you can npm install them. So if you're the thing that you're doing with React is you're using it to collaborate across multiple applications that are sharing these components, and a really great way to do that is to use private packages to do it, because you can just npm publish your component, and then anybody else in your company can npm install the component into their application, and all of the same sort of good or developer ergonomics of an npm package apply. So, you can be like, okay, well, you know, our new calendar component is backwards incompatible. So, we've created a breaking change version of the calendar component, but you can still use version 2.

[00:44:35] Michael Chan: Right.

[00:44:36] Laurie Voss: And we don't have to like all, you know, fight over a monorepo, you know, like all of the same problems that it solves for open source, it can solve for uh a a you know group of people who are collaborating on web components. Uh and it's really useful for that.

[00:44:48] Michael Chan: Yeah. Now the ergonomics of that really don't change from any type of npm organization at all, right? So if you're already namespacing some of your components through at your organization, creating a private organization is just about turning that feature on, right?

[00:45:03] Laurie Voss: Yes, although private organizations come with other features like uh security and auditing and things like that. Once it's private, you can you know you can say, well, only people in this organization have access to it, so we know exactly who was using it and why they were using it and stuff like that. If you're a company of the size where you're like, we need to know where this went and who is using it. And also a lot of people are just like, I don't want to put all of my, you know, every single button component I've ever created on the on the public internet. Could I keep them private, please?

[00:45:29] Michael Chan: I'd like to hide my shame.

[00:45:32] Laurie Voss: Exactly.

[00:45:33] Michael Chan: Are there further products for people who need to control their own distribution?

[00:45:37] Laurie Voss: Yes, npm Enterprise. Uh, if you are a larger organization can act as a sort of firewall between you and the public registry. You know, you can use sort of big company features like single sign-on and stuff like that. You get your own registry domain that you can point your clients at. And so you can know every all every single package that's coming into uh into your company and where it went and what it was and you know whether it was secure or not and if you need to fix that deploy, those sorts of things, uh which big companies do really care about.

[00:46:04] Michael Chan: So who in this uh JavaScript space is doing work that you are really excited about right now?

[00:46:11] Laurie Voss: GraphQL is probably my thing to watch in 2019. That trajectory is really amazing, suggesting that it will be a big thing, if not the next big thing. I'm sort of rooting for Ember this year. Oh, okay. Ember had Ember had uh a rough patch in in 2016. It was popular in 2015, it became less popular, it looked like it was, you know, on track to die, uh and it rebounded. Ember's growth has doubled in the last 8 months.

[00:46:36] Michael Chan: That's wild. That seems bizarre.

[00:46:39] Laurie Voss: Um, it's unprecedented for a framework. I've never seen a framework come back.

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

[00:46:44] Laurie Voss: You know, they made some really substantial changes to how they work, you know, with uh Glimmer and all of those other changes. So, um, it is a new framework with the old name, really. But I'm I'm sort of rooting for them. I've always liked the people- the people who actually do that work are really nice people. So I'm really glad to see their work getting the attention it deserves.

[00:47:00] Michael Chan: Well, thank you so much for taking uh this time to chat with me. I hope that you enjoy the rest of your pool time here at uh JSConf US. Thank you for correcting me on that. And uh I hope that we'll uh be able to talk again soon.

[00:47:13] Laurie Voss: Thank you for having me.

[00:47:15] Michael Chan: That's it for this episode of React Podcast. To find out more about anything mentioned in the show, visit reactpodcast.com/13. Now, this is actually the last episode of the year. So, thank you so much for sticking with us this entire year. Uh, I had a great time and I hope that you did too. We've already got a lot of great interviews queued up for January. I can hardly wait to share them with you. If you have someone you'd like to see on the show, hit us up on Twitter. We're @reactpodcast. There's so many amazingly talented people in our industry and we We rely heavily on your recommendations. Thanks for listening. Thanks for supporting the show. We'll be in your ears again next year.