text
stringlengths
0
2.02k
[1117.58 --> 1122.70] And we've basically done away with all of that. We've just said, you know, if you've got code that
[1122.70 --> 1128.42] you're working on locally, then, you know, you store that in your local folder, and that's yours to
[1128.42 --> 1135.40] deal with. And if you want to link to some third party code, you can, of course, download it into a
[1135.40 --> 1142.74] vendor folder, if you wanted to, and dot slash relative include relative import that. But you
[1142.74 --> 1149.54] can also just import the remote URL via HTTP. So our module system is really the web browsers module
[1149.54 --> 1156.22] system, which is exactly HTTP. So you know, we don't have, unlike NPM, which has a specific protocol for
[1156.22 --> 1162.54] distributing packages, you have to ask the NPM server what the latest package is, get the link to
[1162.54 --> 1168.52] the tarball, download the tarball. We don't define a protocol like that. We just have HTTP, and you
[1168.52 --> 1172.34] can download JavaScript or TypeScript over HTTP.
[1173.72 --> 1178.26] And what are the advantages of that, then? If pulling a module, say for NPM, for example,
[1178.84 --> 1184.48] the stability of being able to make those, you know, NPM install, for example, and being able to,
[1184.84 --> 1188.56] I suppose, sit there and wait, like some people might, you know, what are the advantages,
[1188.56 --> 1194.52] I suppose, of that system over this older one? Obviously, it's, you know, modern in terms of
[1194.52 --> 1199.08] the way the web browser is working. But what are the specific, you know, DevEx, you know,
[1199.40 --> 1202.22] DevExperience kind of advantages there?
[1202.70 --> 1209.98] I think it has the effect of feeling immediate. And there's nothing to install ahead of time,
[1209.98 --> 1215.06] because the Dino system itself actually takes care of downloading that. And so, you know,
[1215.06 --> 1220.94] I would say the other DX effect is that you can have scripts that are single files. In Node,
[1221.00 --> 1227.08] you generally, at minimum, need to have a package JSON and your JavaScript file. Your package JSON
[1227.08 --> 1233.10] needs to define where you're linking. And your JavaScript file has some source code in it.
[1233.94 --> 1239.62] In Dino, you can say where you're linking on line one, and the rest of the script can be your code.
[1239.62 --> 1245.02] So you can actually define a complete program, both where to get your third party code,
[1245.16 --> 1250.54] and your own code all in one file, run it without, you know, creating a directory. And
[1250.54 --> 1254.66] I guess what I'm trying to say is there's less boilerplate to deal with.
[1255.04 --> 1255.42] It's minimal.
[1255.56 --> 1256.02] Yeah, simple.
[1256.22 --> 1256.92] It's very minimal.
[1257.56 --> 1263.24] Yeah, I mean, you can have, you know, file tabbing fatigue or swapping from different files.
[1263.44 --> 1267.02] I love that a lot in a whole different land. With like Tailwind, for example,
[1267.02 --> 1271.92] you can do a lot in the same file or in the same HTML file. You're not jumping back from CSS to HTML.
[1272.14 --> 1276.80] So similar to how that world might work, you're not jumping back and forth. You can stay in the
[1276.80 --> 1283.26] same file, have this sort of immediate instant gratification of just moving forward, and not
[1283.26 --> 1287.80] have to jump back and forth between different ways to define what your application is needed to inherit
[1287.80 --> 1290.04] from or to import, etc.
[1290.04 --> 1297.24] When you have a large application, if you have hundreds of files, right, having one extra package
[1297.24 --> 1302.44] JSON file is not a big deal. Like it's no big deal to have a, you know, if you have hundreds of modules,
[1302.58 --> 1308.32] and you have one extra one, it's not a big deal. So, you know, I think in kind of the tail end of
[1308.32 --> 1313.94] larger projects, it probably doesn't feel that different. But when you get down to the very small
[1313.94 --> 1321.34] scripts, the one off scripts, Dino scales down to to a much smaller installation, I would say much
[1321.34 --> 1328.78] less boilerplate, right? When you do npm in it, it's going to ask you for, I don't know, the license
[1328.78 --> 1334.52] of your project, you know, the name of your project, all of that stuff is, let's say you're trying to
[1334.52 --> 1340.12] write a script that's going to rename a bunch of files in a folder. Who cares? I don't care what the
[1340.12 --> 1345.64] license is. Like, why am I spending any time at all thinking about that problem? Like that is boilerplate.
[1346.20 --> 1351.64] Yeah. What about the potentially hidden advantage? And I'm assuming this the internet essentially is
[1351.64 --> 1357.74] your package manager, right? You can link to a raw file on GitHub, you can link to some random site on
[1357.74 --> 1363.32] adamsdokowiak.com or changelaw.com and just inherit from that. Is that how Dino works? You can just pull
[1363.32 --> 1368.28] in from any URL, or as you'd mentioned, even a relative from, you know, somewhere locally?
[1368.28 --> 1375.88] Yeah, that's right. So yeah, you can pull in files from any server. And the nice side effect of this is
[1375.88 --> 1382.06] that the node ecosystem and all essentially all other programming languages are dependent on a
[1382.06 --> 1388.94] specific server to distribute third party packages, right? Whether that's crates.io, whether that's
[1388.94 --> 1396.34] golang.org or npmjs.com. If that server goes down, everything breaks, we are heavily dependent on that.
[1396.34 --> 1401.48] But contrast that with this is just not very webby. This is not how web browsers work.
[1402.22 --> 1407.80] It would be a bad day if Google went down. But hopefully, hopefully web browsers continue to
[1407.80 --> 1415.68] operate like your website should isn't necessarily dependent on any one specific server existing.
[1415.68 --> 1421.86] And that's nice. Like that's a distributed system. And because of this aspect that you can download
[1421.86 --> 1429.24] code from any URL, Dino is not dependent on our website, Dino.land, nor is it dependent on any
[1429.24 --> 1434.18] other website. You can use, you know, unpackage.org for pulling in your third party dependencies,
[1434.18 --> 1436.18] or you can use GitHub directly.
[1436.56 --> 1437.00] Great.
[1437.10 --> 1439.56] Which might be nice since that's where the code is actually stored.
[1439.56 --> 1442.92] Right. Then if GitHub goes down, we're screwed again. But we were already screwed. So
[1442.92 --> 1448.24] great website, by the way. I love the dinosaur brand. I love the name. Dino.land is such a cool
[1448.24 --> 1453.06] domain. Just wanted to give you props for that really quick. What about versioning? I mean,
[1453.08 --> 1457.26] if I'm a library author, are there idioms around that? Do I just have a new file with like the
[1457.26 --> 1463.98] version in my file name? How do we deal with things like, you know, Lodash 3.7.1 is out? How do I go get it?
[1463.98 --> 1473.40] I mean, ultimately, a version is a string of characters. And so is a URL. And so you can
[1473.40 --> 1479.26] have a version in a URL to specify the version. Think back to the jQuery CDN example, right?
[1479.62 --> 1479.74] Yeah.
[1479.86 --> 1482.80] You have perfect ability to link to any version of jQuery.
[1483.38 --> 1488.08] Good answer. What about existing NPM? Are all the existing NPM packages
[1488.08 --> 1494.62] then supported if I can find the exact URL of the source code? Is that they'll just work? Or are
[1494.62 --> 1498.68] they using some things that might not be ESM compatible and stuff like that?
[1499.50 --> 1504.96] Yeah. So if it's not using ESM, then it's going to be probably problematic.
[1506.00 --> 1511.22] It may be problematic, even if it is using ESM. Unfortunately, we're kind of in this state
[1511.22 --> 1518.78] right now in JavaScript, where there's a lot of fragmentation between TypeScript, CommonJS,
[1519.42 --> 1527.00] Deno, Node. You know, I hate to contribute to that. But I also am, you know, I feel like fighting the
[1527.00 --> 1532.82] good fight, trying to make things simpler. All NPM packages are available on, for example,
[1533.00 --> 1535.54] unpackage.org or Skypack.
[1535.80 --> 1536.20] Skypack.
[1536.20 --> 1543.28] So you should be able to access those files through HTTP. And if they're ESM, then you're
[1543.28 --> 1550.24] close to that, to it working. I think the problematic thing is if they use Node APIs. So
[1550.24 --> 1557.60] Node, for example, has, you know, require FS, you can require FS and like open a file. Deno has
[1557.60 --> 1564.78] alternative APIs for that. We do not have a top level FS module. We have a compatibility layer for that.
[1564.78 --> 1571.28] So that's in our standard library. By the way, Deno has a standard library. And you can find that at
[1571.28 --> 1579.12] deno.land slash std slash node. And using that compatibility layer, you get pretty close,
[1579.22 --> 1583.98] although there's definitely a lot of modules where there's going to be require some work,
[1584.08 --> 1589.88] but you can get pretty close to importing a lot of modules. There's a long tail end of
[1589.88 --> 1591.72] things that are incompatible though.
[1591.72 --> 1620.68] This episode is brought to you by Retool. Retool is the local platform for developers to build
[1620.68 --> 1626.14] internal tools, super fast and super easy. They have a ton of integrations and templates to start
[1626.14 --> 1631.16] with, with a click of a button in seconds. You can start with a new Postgres admin panel application,
[1631.56 --> 1635.76] kick off an admin panel for reading from and writing to your database built on Postgres.
[1636.20 --> 1641.16] This app lets you look through, edit and add users, orders and products. It's too easy to
[1641.16 --> 1645.40] get started with Retool. Head to retool.com slash changelog to learn more and try it for free.
[1645.40 --> 1648.36] Again, that's retool.com slash changelog.
[1658.60 --> 1666.52] So Ryan, on your website, deno.land, awesome website. It says a secure runtime for JavaScript
[1666.52 --> 1671.18] and TypeScript. And of course, secure by default is the top level bullet of Deno features. We haven't
[1671.18 --> 1674.06] talked about security yet. You want to give us the skinny?
[1674.92 --> 1682.28] Yeah. So obviously if you're pulling in random packages over HTTP, you should be worried if you're
[1682.28 --> 1688.28] pulling in code because, you know, you, maybe you've audited this code, but probably not like