Deno - HTTP 203

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Regarding 23:20, they are also working on a Rust implementation of the URLPattern W3C draft spec API (see the PR for progress) which will be added into Deno via an extension which is fairly exciting as you will probably be able to play around with URLPattern in Deno first🎉

👍︎︎ 6 👤︎︎ u/Carters04 📅︎︎ Aug 17 2021 🗫︎ replies

I really like Deno and wrote a script for ETL recently using it. Not needing to use NPM was nice, and I really liked using Typescript for as much as possible. I had to use some Javascript libraries, but leveraging skypack and jspm.io CDNs really made that pretty easy once I figured out worked.

👍︎︎ 6 👤︎︎ u/chinpokomon 📅︎︎ Aug 18 2021 🗫︎ replies
Captions
SURMA: OK, you ready? JAKE ARCHIBALD: Uh, yeah. SURMA: 3, 2, 1. JAKE ARCHIBALD: Wait, what do we do now? SURMA: I don't know. We're so in sync we don't-- JAKE ARCHIBALD: Well, we don't need to do it twice, but that's because we were sitting, like, 100 miles apart. But I'm not very good at geography. SURMA: How much are we sitting apart now? JAKE ARCHIBALD: Hmm? SURMA: How much are we sitting apart now? JAKE ARCHIBALD: Oh, that's a good question. Because it needs to be safe, because things aren't back to normal yet. It needs to be 2 meters. SURMA: At least. JAKE ARCHIBALD: At least. SURMA: If it-- well. JAKE ARCHIBALD: This is absolutely terrifying, watching this coming towards me. Keep going. Uh-oh. Oh boy. SURMA: Hey! 2 meters and 20. JAKE ARCHIBALD: Perfect. SURMA: Ow! JAKE ARCHIBALD: Did you just lose a finger? SURMA: No, just a bit of pain. But that's OK. JAKE ARCHIBALD: Excellent. Good. Because that's your-- SURMA: So we're safe! JAKE ARCHIBALD: That's your slide clicker hand. SURMA: Where's my slide clicker? JAKE ARCHIBALD: It's down there. SURMA: Thanks. JAKE ARCHIBALD: There you go. SURMA: Right. [THEME MUSIC] JAKE ARCHIBALD: Right. SURMA: Shall we talk about the web? JAKE ARCHIBALD: Let's talk about the web, come on. SURMA: I'm actually web adjacent with this one because I want to talk about this. JAKE ARCHIBALD: Yeah, mate, you realize in CSS you can have font sizes bigger than 12? SURMA: I just installed the web font and something must have gone wrong. This is what you get. JAKE ARCHIBALD: OK. SURMA: People-- JAKE ARCHIBALD: So hang on, it's-- Deno-- Dee-- "Denn-o." Now this is controversial. SURMA: There we go. This is exactly why I put it there and didn't say it myself, because-- JAKE ARCHIBALD: You wanted me to make the mistake. SURMA: Yeah. JAKE ARCHIBALD: And get all the YouTube comments. SURMA: Now you're wrong, not me. JAKE ARCHIBALD: So because-- right, it's "Denno" or "Deeno." SURMA: That much is true. It's one of the two. And you know what I did? I went back to this presentation. You know what this is? Or who this is, rather. JAKE ARCHIBALD: This is Mr. "Deeno." isn't it? Jeremy Deno. [LAUGHTER] SURMA: It's Ryan Dahl. JAKE ARCHIBALD: Yep. SURMA: Ry on GitHub. JAKE ARCHIBALD: Yep. SURMA: Originally the creator of Node, and now also the creator of the thing. JAKE ARCHIBALD: Yup. SURMA: And this is JSConf 2018, where he announced it and I was in the audience. And I was like, ooh. And he called it "Denno." JAKE ARCHIBALD: Oh, well, there you go. That's surely case closed. SURMA: And I smugly tweeted, just in case, here's proof it's called "Denno," everyone. JAKE ARCHIBALD: Well, there you go. SURMA: And then Deno tweeted at me, saying like, uh, actually, Ryan is wrong. [LAUGHTER] JAKE ARCHIBALD: Who's behind that account now? SURMA: Apparently he got convinced it should be called "Deeno." And so it's Deno. The canonical pronunciation is "Deeno." JAKE ARCHIBALD: It's like GIF. "Jif." SURMA: Just so everyone knows, I will probably get this wrong in this episode. I will probably even use both interchangeably. It's both the same. We're talking about the thing. JAKE ARCHIBALD: Deno. SURMA: The thing that I want to talk about. So what is Deno? Well, it's that. It is basically Node. It's a JavaScript runtime. But it has TypeScript. I think that's what most people already know. Instead of running JavaScript, it can also run TypeScript. It's actually TypeScript first. And has a bunch of very interesting, not necessarily new takes, but just a combination of things into one, which is a different take on package management, security, web compatibility. And I thought, just give it a little round up, because I've been playing with it. I've been liking it. JAKE ARCHIBALD: It's really good to-- I've used it once in passing, but I don't know a lot about it. So I'm going to learn a lot here. SURMA: So you're an expert. JAKE ARCHIBALD: Yeah, I put it on my CV now. But we've not had a lot of competition in this space. 100 years ago, there was the server-side JavaScript stuff that Netscape did. And then there was-- SURMA: I don't know that one. JAKE ARCHIBALD: Oh yeah. Yeah, you're younger than me. This was a long, long time ago. And then there was Node. And now there's Deno. So it's like this-- and so much had changed between the old Netscape thing and Node, so it's interesting to see what have they learned, what have they changed, what have they learned from Node and gone [INAUDIBLE]?? SURMA: And you know what? I think they have. The talk from Ryan Dahl from JSConf 2018 actually explicitly was a talk, 10 things I learned or 10 mistakes I did in Node. Something like that. And he kind of used that talk to then lead into Deno. But the mistakes he talks about are really interesting, so we're going to link to that. JAKE ARCHIBALD: All right, all right. SURMA: But I just want to basically just look at Deno by itself and just talk about a bunch of things. So this is-- don't be intimidated by this. JAKE ARCHIBALD: [LAUGHS] Oh, perfect. Yeah, it's great. SURMA: This is from-- JAKE ARCHIBALD: There we go. SURMA: --their website. You don't need to know this, but there's a couple of interesting things I want to extract. The one thing is Deno's written in Rust. JAKE ARCHIBALD: Ah. SURMA: That by itself doesn't mean much immediately, although I have no experience at actually contributing to Deno, like hacking around in the actual engine. It's quite doable. JAKE ARCHIBALD: So you just dropped that in there. You are now a contri-- SURMA: No, I just hacked around. JAKE ARCHIBALD: You corrected a spelling mistake in Read Me-- SURMA: Not even that. JAKE ARCHIBALD: Right? Yeah. SURMA: I didn't even-- I don't even have a commit. JAKE ARCHIBALD: All right. SURMA: I added a sum function, a global. JAKE ARCHIBALD: Oh, OK, [INAUDIBLE].. SURMA: And that was easy enough. And you know, that is saying something. I actually-- I have some-- I know some Rust. I'm far from an expert. But the cool thing is the build system is super easy. And if you've ever tried to build V8 or something like that, you know that is not easy. JAKE ARCHIBALD: Yeah. SURMA: And the nice thing is they extract it all away. It just builds. And the other thing that I want to point out-- it uses V8. So it's our trusty V8 engine running the JavaScript. And the other thing that's just-- you don't really need to know that, but I found it interesting. In Node, most of the file system functions are direct bindings to C++-backed functions, which is why you often see native function when you see a stack trace or something. In Deno, you have exactly two native functions, which are just able to send buffers to the isolate backgrounds. And so you always have to communicate to these two functions. That has something-- JAKE ARCHIBALD: Is that a good thing or a bad thing? SURMA: It's a good thing because the-- JAKE ARCHIBALD: Oh, OK. SURMA: --that's the only way to get out of the V8 sandbox. Only through these two functions. So the audit surface is very small. JAKE ARCHIBALD: Unless that function is [INAUDIBLE].. So what are we talking here? How is this looking? SURMA: I think it's interesting that if something goes wrong, it has to go through one of these functions. You only have to see-- I'm not an expert on this, so I probably shouldn't be talking. I just found it interesting that in contrast to Node, where loads of things call directly into C++, you only have two functions according to C++ here, and those are these two functions for receiving buffers and sending buffers. JAKE ARCHIBALD: Oh, OK. SURMA: And that's quite interesting. But that's not really interesting in terms of us web developers. So I want to talk a bit more about the first thing that's quite interesting is the standard library. You know in Node, you have an extensive standard library, and so does Deno, but you have to import it. It's not just there-- you have to import it as a URL. And the interesting thing is that that's an actual URL. Like, if you type in this URL into your browser, you will see TypeScript code appear. JAKE ARCHIBALD: OK. Because-- yeah, if you're leaving Node behind, I guess you're also leaving NPM behind? SURMA: Yes. JAKE ARCHIBALD: Is that true? Yes. SURMA: Pretty much. So there is actually no real package manager in Deno because it's like, you know what? We're just going to use the thing that JavaScript on the web uses. You just import modules. And that works really well. So on the one hand, you will see the URL is versioned, so you import a specific version of a sort of library, which is nice because it decouples the standard library from the engine, which in Node is not the case. You always require fs and that is the fs that came with your Node version. So in this case, Deno the engine can evolve without the standard library evolving, which is also, I think, a benefit for backwards compatibility-- you import a specific version. But also, there's obviously a place to publish user modules. JAKE ARCHIBALD: You say obviously. Did we know that? SURMA: Well, we have to-- you want to be able to import code, right? And so-- JAKE ARCHIBALD: Can you not just put this on your own web server? SURMA: You can. And that-- [INTERPOSING VOICES] SURMA: They have this deno.land/x, where you can go on and publish your own code under a nice, memorable URL. But and then it's a normal request and normal URL, so you can actually, in fact-- JAKE ARCHIBALD: [CHORTLES] SURMA: --also point straight to GitHub. JAKE ARCHIBALD: Oh, look at that. SURMA: Or point to your own web server. And that's actually kind of nice. It kind of has this decentralized thing built in, that you don't rely on the central registry to keep all the code you depend on. JAKE ARCHIBALD: So what's the offline story for this, then? SURMA: That's a good question, because obviously you want to run a script and you do it like this. You just do deno run and your script, and on the first run, that will download all these files via an actual request, and then look at dependencies and do that. And then it will never do it again. Which, obviously, sometimes is a problem. I mean, if the URL is versioned, you would hope it's kind of immutable and the same version should not deliver different code in the future. JAKE ARCHIBALD: So it's not paying attention to the caching headers specifically of the request? It's just like-- SURMA: I don't think it is. JAKE ARCHIBALD: OK. SURMA: But I'm actually not 100% sure. But Deno has a Command-R, Command-F5, whatever, built in by passing a --reload flag, and then it will actually reload everything. So in case you do get stuck, you can re-- but also, it is-- if you want to develop on a flight without Wi-Fi, just make sure you run it once before, and then you're pretty good to go. JAKE ARCHIBALD: So-- that's my thinking pose. So how does dynamic importing fit into this? Because that's one of those things of like, you're not just going to be able to say, load once, then go on your flights or-- remember flights. But then-- because if it's a dynamic imports, you do all that, and then you hit a runtime import and that fails. SURMA: So dynamic imports work. JAKE ARCHIBALD: Mm-hmm. SURMA: Good. JAKE ARCHIBALD: Excellent. SURMA: I think for the offline story, you would have to have them loaded once for them to work offline. JAKE ARCHIBALD: I see. OK. SURMA: I think that's all there is to it. I think it's a system with very simple rules, but there will be drawbacks. At the same time, how often do we really run into this, I'm developing offline case [INAUDIBLE]?? JAKE ARCHIBALD: Well, I would say it's quite rare to have a-- when you're running a server style app, having a dynamic import of a module is pretty rare. I think your dynamic imports are more likely to be JSON or something like-- something that is local anyway. SURMA: Yeah. JAKE ARCHIBALD: So yeah, it's-- yeah. SURMA: For server-side, I think it doesn't happen that often, and we will actually see a bit more that Deno is actually going all in on this like it should probably mostly be static imports, anyway. I feel like dynamic imports are going to be rare in this context. JAKE ARCHIBALD: Yeah. SURMA: But they do work. I did try it and that's good. JAKE ARCHIBALD: All right. SURMA: You can even run scripts that are non-local. So, for example, the standard library does provide a file server, something that in Node, you often have to either write or NPM install. You can just run the URL-- JAKE ARCHIBALD: Nice. SURMA: --and it will download the script and run it, and all is well. You see that --allow-net is a flag. JAKE ARCHIBALD: Yes. SURMA: Because by default, you can't just access your network from a script. And actually, that's a whole security story here in Deno I want to talk about a bit more. JAKE ARCHIBALD: Because the security story around Node and NPM is sort of terrifying. SURMA: Yes. Have you heard of post install scripts? JAKE ARCHIBALD: Right, exactly. SURMA: Yeah, so as we have no NPM or anything [INAUDIBLE] there is no such thing. But even this has-- even just reading files, accessing your network, opening a server has a permission story. So for example, here, we use the Deno global, which has a couple of functions that haven't found a web compatible home. I'm going to talk about that a bit later. But reading files you do via the Deno global. And it's all promise-based. Also great, promises now that it's-- it's kind of nice sometimes to start from scratch, isn't it? JAKE ARCHIBALD: Yeah, absolutely. SURMA: You can catch up on the developments. And if you run this script in Deno, it will fail and tell you, well-- or will throw, rather, saying you don't have permission to read files. Please run me again. JAKE ARCHIBALD: Just such a nice default. SURMA: It is. JAKE ARCHIBALD: Just by running npm whatever, it can read anything on your file system. SURMA: Exactly. So let's drill into that a little bit more, because I can add --allow-read and it will be fine, but this is obviously a bit binary. It's a bit all or nothing. JAKE ARCHIBALD: Oh, you're going to tell me it's scoped. SURMA: So what if I did this? Like, I have a legit reason to read a file, so a person would be quite keen to give me --allow-read, but then I use my permissions. I abuse my permissions and read my Bitcoin wallet, which I don't actually have, but I thought that might tie it to monetary value so people actually care. JAKE ARCHIBALD: [LAUGHS] SURMA: So if I run it like this, it would work, and that would be bad. What you can do is you can actually supply this flag multiple times for every individual file that this script should be allowed to read. So you can actually give very granular permissions in the script. JAKE ARCHIBALD: Can it be for a whole directory or-- SURMA: I would hope so. JAKE ARCHIBALD: Yeah, [INAUDIBLE].. SURMA: I actually haven't tried that. But even then I would say this doesn't necessarily scale, because sometimes, you don't know upfront which files you might want to read, or the script can't potentially even tell you. And this is where something really interesting comes in, I think, is that you can even dynamically request permissions. JAKE ARCHIBALD: Oh, like what we do in the browser, like? SURMA: Pretty much. It is very-- and that, I think, is a story that you see all throughout Deno is that they really took the web model-- learned many, many things from the web, because the web has really taken their security quite seriously and lots of other things, that they want to be secure by default and still be able to run random sites that you don't trust. Like, that's a pretty hard place to start, and we have found a way to make that kind of work. And so if you do this, there is these request objects. And you pass it to Deno.permissions.request and that will manifest as a prompt on the CLI, where it goes, hey, the script wants to do the thing. Do you want a permit to do the thing or would you rather not? JAKE ARCHIBALD: That's very good. I would say one thing-- the browser gets away with-- the browser has special UI for permissions. I guess we don't really have the equivalent in Deno-- SURMA: No. JAKE ARCHIBALD: --because a Deno program could output there. SURMA: I think this is an escape hatch when you don't know which file, or it just doesn't scale with the amount of files you want to request. I'm not quite sure, but I like that there is a way. It's not nice and not the most beautiful way necessarily. Maybe there will be better ways in the future. Maybe at some point in the future, we can actually forward this permission request to the browser or something. Give it a nice common UI. Who knows. But I mean, in that sense, it's early days for Deno. It's got announced in late 2018, I think. JAKE ARCHIBALD: Yeah. SURMA: It's gotten a good amount of attention recently, but there's still-- I think even they're 1.0. It's not that old. So they're still early days and iterating on all these things. JAKE ARCHIBALD: And they're going all in on the web APIs as well, so like the streams are WHATWG streams-- SURMA: Hold on to that. JAKE ARCHIBALD: Oh, OK, OK. SURMA: Yeah. JAKE ARCHIBALD: Zip. SURMA: Speaking of-- JAKE ARCHIBALD: All right. SURMA: Let's talk about a couple of global objects that are available in Deno. And I tried to order them by increasing amount of surprised face-- JAKE ARCHIBALD: [LAUGHS] OK. SURMA: --that I pulled. JAKE ARCHIBALD: Yeah, I'm not surprised at globalThis. It is, of course, stan-- well, it's a-- SURMA: It's in JavaScript. JAKE ARCHIBALD: --JavaScript standard. SURMA: Yeah. JAKE ARCHIBALD: Right. OK? Not surprised. OK? Hang on, is webAssembly in Node as well? Because you can do webAssembly in Node. So this is a global in Node as well. No surprise face. SURMA: No. JAKE ARCHIBALD: And that's a web standard. Right, so we're talking a little bit more surprised now, because Node has its own crypto module. SURMA: Yeah. JAKE ARCHIBALD: All right, all right. SURMA: What I like with it is using the compatible API, because all this will boil down to, I have more chances to write-- I guess this is isomorphic code, code that works without changes on both sides, the server side, the client side? That's a good thing. JAKE ARCHIBALD: Yeah. All right, all right. Nice. SURMA: Not really a surprise? JAKE ARCHIBALD: Well, we know Node has workers as well. SURMA: But you have to import them. They're not API compatible with the web. These are. JAKE ARCHIBALD: So it's the same pattern the web uses? SURMA: Yeah. JAKE ARCHIBALD: Amazing. Yeah, well, you see, I did know this one. So I'm-- SURMA: Not surprised face, but I was very happy about this. JAKE ARCHIBALD: Because I much prefer the streams that-- the WHATWG standardized over the various ones that-- SURMA: I will say-- JAKE ARCHIBALD: --Node has. SURMA: I just saw a couple of days ago, Node now has them as well. JAKE ARCHIBALD: Yes, they've kind of changed their mind on a lot of stuff because they're looking at fetch as well. So yeah, it seems like everything is converging on standardized APIs. SURMA: Which is good. JAKE ARCHIBALD: Yes. SURMA: That's what standards are for, so we could converge on them. JAKE ARCHIBALD: Absolutely, absolutely. Yes, OK, so Node has similar things to this now. SURMA: I think so. JAKE ARCHIBALD: That's-- yeah, we now have EventTarget. Yeah, so Node has that as well. That's good. SURMA: Oh, do they? JAKE ARCHIBALD: Yes, yes. SURMA: I did not know that. JAKE ARCHIBALD: Yeah, no, you can use signals to remove event listeners and stuff now-- SURMA: Fascinating. JAKE ARCHIBALD: --in Node, so that's-- SURMA: Well, maybe I didn't get the order right, but still, it's interesting. JAKE ARCHIBALD: Well, it is based on me having a slightly lopsided knowledge of how Node and Deno work. But location? That does surprise me. I didn't know that. SURMA: It surprised me as well. JAKE ARCHIBALD: Nice. SURMA: I actually forgot how it's executed, but I think it is compatible, and it mostly reflects import.meta.url. JAKE ARCHIBALD: Nice. Yeah, excellent. So this is building up to fetch, right? This is where we're going. SURMA: Yeah, of course. But actually-- JAKE ARCHIBALD: Because these are all the prerequisites for having a full fetch-- [INTERPOSING VOICES] SURMA: I don't think I have fetch on the list because it surprised me very little that fetch was in there. But I found it interesting that the Request/Response objects are actually fully-- so I guess it makes sense [INAUDIBLE] that it has to be. JAKE ARCHIBALD: The sort of prerequisites. And oh, window's on there as well. But OK, that is surprising. SURMA: I think-- JAKE ARCHIBALD: That is surprising. SURMA: It's such a little developer experience wrinkle. JAKE ARCHIBALD: Why not? SURMA: If it's literally equivalent to globalThis, what's the harm? JAKE ARCHIBALD: Yes. Absolutely. SURMA: Just to make the code work that works on both sides. JAKE ARCHIBALD: Well, hang on. When you start a worker, does it have window? SURMA: I do not know. JAKE ARCHIBALD: That's what I-- because that would be fun. SURMA: I do not know. JAKE ARCHIBALD: OK. Anyway. SURMA: I would have to check that. [MUSIC PLAYING] JAKE ARCHIBALD: And that closes the process? SURMA: Process closed, yep. JAKE ARCHIBALD: Very good, excellent. Now, what do these do? SURMA: These are basically similar to the permission requests. They're a CLI-- JAKE ARCHIBALD: Mode-- [INTERPOSING VOICES] SURMA: --variant of these things. JAKE ARCHIBALD: Of course. SURMA: But yeah, like window.alert, confirm, or prompt will be synchronous in blocking until the user acknowledges. Like, an alert needs to press OK, confirm, obviously it's a yes, no, or yes, no, cancel, even, and a prompt is type something in. JAKE ARCHIBALD: This is fun and exciting. SURMA: It is. JAKE ARCHIBALD: Is there more? SURMA: A bit more, there is. JAKE ARCHIBALD: Oh. Well, what's the dif-- hang on, does it persist, localStorage? SURMA: It does. JAKE ARCHIBALD: Oh. SURMA: Between runs. JAKE ARCHIBALD: Where is that stored? SURMA: It has-- like, if you-- if you run deno info, it will give you a folder where it stores per origin data, and you have to supply an origin as a command line flag. Otherwise, it fails. So you have to say, OK, I'm pretending to run on the origin whatever. And then it creates its own little folder, and everything in local storage will go in there. And on the next run, you can read the data back and don't have to worry about file system shenanigans. JAKE ARCHIBALD: This is amazing. SURMA: It says something more? Do I know my own slides? I don't know. Is there? Oh, there is. This. My favorite. JAKE ARCHIBALD: Oh! SURMA: Because not only does it have navigator, it has navigator.gpu. JAKE ARCHIBALD: And this is straight through to WebGPU. SURMA: So yeah. I've been looking a little bit into WebGPU. I'm not going to get into it, but the main new thing about WebGPU is not only is it a newer, saner, approachable API, but it decouples the GPU from canvas. You can use WebGPU just for purely computational purposes, and that's exactly what they're exposing here. It's experimental, so it's behind an experimental flag, but it's exposed just like it is in the browser. And I-- that made me happy. JAKE ARCHIBALD: That's so good. SURMA: It's so good. So looking at this, I could really see the whole, OK, I can actually use Deno as a stepping stone to write some code, and I can be fairly confident that it will run on the web as well later on. Or the other way around-- if I've written web code, it's quite likely that it will also run in Deno. I can move modules around almost seamlessly. And I'm kind of-- I'm not even talking about TypeScript much, but you know, Deno can run JavaScript. If it's TypeScript, it will strip out the-- it will do the type checks on some of the types, but in the end, it's just JavaScript, so you can also just import normal JavaScript as well. JAKE ARCHIBALD: Nice. SURMA: And that's really cool. So going back to the imports and talking a bit more about standards that we have on the web, these URLs are long and annoying. Wouldn't it be much nicer if I could say something shorter? JAKE ARCHIBALD: OK. SURMA: Obviously it needs to be a bit more easier to remember. How would I do this on the web, Jake? JAKE ARCHIBALD: This is exciting. This would be --import-maps. Does it support --import-maps? SURMA: It supports-- JAKE ARCHIBALD: Oh my god. SURMA: So basically, you can provide an --import-map as a file, and that, I think, is really good. Again, it allows this thing. We can-- JAKE ARCHIBALD: They've really gotten in on the web standard stuff. SURMA: And they keep keeping up with those as well. As far as I can tell, they really keep an eye out for the things that are useful to them. I'm actually now waiting for them to do the newer import type assertions, because that would solve the "how do I get a JSON in?" Because currently, I think you have to go by reading why the file APIs. JAKE ARCHIBALD: Well, that stuff's there in V8 now, so could it just work? Pretty sure it's-- SURMA: Maybe? I haven't checked. But you know-- and I love seeing this, that they're keeping up with it. It will also help solidify these standards, testing them out in more scenarios. JAKE ARCHIBALD: This is exciting. This is an exciting future for seeing where Deno and Node diverge, where they converge. SURMA: I also saw the Node people talking about that they don't necessarily see Deno as a competition. It's a different take on a similar problem space, and they're learning from each other. And I love seeing that. And I think that maybe that is why they were now starting to look at streams a bit more and starting to ship the WHATWG streams to Node, because it just makes sense to be more compatible on that front. Node obviously has the burden of being around for much longer and having backwards compatibility and all these things. JAKE ARCHIBALD: The WHATWG streams didn't just appear out of nowhere your being much better. They learned from the mistakes that Node had made over a few iterations of their streams, so yeah. It's great to see sort of-- SURMA: (SINGING) Circle of life. Streams. JAKE ARCHIBALD: Circle of life. SURMA: Yeah, and just as a quick tie-up at the end, here's a couple of commands that they could support, because they really try to come in with all batteries included. So they have a repl, you can run a file. They have a pretty printer, they have a test run and a test framework. They have a coverage tool. Bundle is a bit like parcel, like rollup in that they just inline all your static imports into one big file. Whether that's standard library or something else, it just makes it one big script. JAKE ARCHIBALD: As an optimization step, I guess. What's compile do? Tell me what compile does. SURMA: Compile is like bundle, but it even bundles Deno itself. So you get one single statically linked binary that contains your script. Which I think is probably really interesting for all the backend folks who want an easy time deploying something to a function or a Docker container. Put this one binary in there. You don't need a base image. It's just that one file. JAKE ARCHIBALD: That's very neat. SURMA: It's still-- again, the compile bit is experimental, which yeah, it's considered unstable. But I tried it and it worked. That was kind of cool. I obviously didn't use it to a large project. It's just a-- JAKE ARCHIBALD: No. SURMA: --script. But yeah. JAKE ARCHIBALD: But it's there. SURMA: I thought it was really cool. It's like, obviously the binary's like, I don't know, 70 megs or something. But at the same time, size on the server side matters less. The ease of deployment could matter more on that front. Makes it easier to cache potentially as well or to roll back a deployment. I could see it really beneficial on the backend side for folks. JAKE ARCHIBALD: Amazing. SURMA: Yeah, if people want to know a bit more, the website. JAKE ARCHIBALD: I do! SURMA: Yeah, well, go right there. That's the URL. Yeah dot land is a proper top level domain. JAKE ARCHIBALD: Dot land. SURMA: And now I would like to see in the comments how often I said "Denno," how often I said "Deeno," because I don't even know anymore. JAKE ARCHIBALD: Look at the things we couldn't do before for a whole year. SURMA: I know! We couldn't cut our fingers off. Now we can! JAKE ARCHIBALD: I can tell you where your side clicker-- it's just-- SURMA: Oh, terribly. JAKE ARCHIBALD: Oh, everything's back to normal. You couldn't put the tape measure in my mouth. It's-- look, I'm just so glad we're back. SURMA: So glad. I'm sure people have missed this.
Info
Channel: Google Chrome Developers
Views: 50,011
Rating: undefined out of 5
Keywords: purpose: Educate, pr_pr: Chrome, series: HTTP203, type: Interview, GDS: Yes, deno, what is deno, how to use deno, deno tutorial, http 203, http, developer, developers, chrome developer, chrome developers, google chrome developer, google chrome developers, chrome, google chrome, google, Jake Archibald, Surma
Id: SYkzk_j3yb0
Channel Id: undefined
Length: 23min 57sec (1437 seconds)
Published: Tue Aug 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.