Deno 2 is here… will it actually kill Node.js this time?

511.83k views965 WordsCopy TextShare
Fireship
Take a first look at Deno 2.0 - a JavaScript runtime with first-class TypeScript support, and now fu...
Video Transcript:
all the best programmers in the world love JavaScript while all the worst programmers in the world love to hate JavaScript I don't understand why that is because I'm a hater myself but today the JavaScript world just leveled up big time with the release of Dino 2 many people thought Dino was about to go extinct after it was hit by an asteroid named bun but now it's back with a vengeance and provides the most polished back-end JavaScript experience in the world not only is it now backwards compatible with no JS and npm but most importantly it's
got a new logo that can dramatically improve the quality of your code in today's video will break down all of its new features and find out if it's finally time to take node.js behind the barn it is September 24th 2024 and you're watching the code report a lot of people make fun of JavaScript because it has multiple competi and server run times like node Dino and Bun when really it should have zero run times and only ever be used in the browser to trigger popup ads but competition is good and even languages like python have
cpython piie and Russ Python and C++ has multiple compilers like GCC and clang for over a decade nodejs was the only game in town but then one day its original Creator Ryan do realized that it was alled up and decided to ship the letters around to create a new runtime called Dino the killer feature on the first iteration was typescript support out of the box you could create a TS file and run it with no TS config or compile step required but nowadays you can even do that in node.js so why didn't everybody just drop
nodejs and switch to dino four years ago the problem is that it wasn't fully compatible with node.js and npm many of your favorite packages just wouldn't work that motivated a new runtime called bun to come out of nowhere and sees the opportunity to not only provide typescript support but also npm compatibility well now doo2 is thrown The Gauntlet down yet again by providing full backwards compatibility with node and npm like check this out I have a basic API written in expressjs in plain JavaScript one easy way to take advantage of Dino right away is to
run lint which will have it scan my code and tell me what sucks about it you can forget about es lint or run Dino format and forget about prettier or better yet I can start writing better code by switching to typescript by simply changing in the file extension tots then instead of npm run I use Dino Run and the code runs perfectly without having to mess around with a TS config and Dino also forces us to give the script proper permissions to access the network that's pretty cool but Doo 2 now also fully understands the
package Json file and it can even work with monor repos using npm workspaces and that's huge if you're someone who wants to use Dino but you'll never escape the technical debt of your existing project because now you can run Dino install and it works with every package and meta framework like nextjs spelled and so on but you should also know that Dino has its own package registry called jsr where every package on there natively supports typescript but one of the main goals of the runtime is for you to install fewer packages because you don't need
any more packages in your node modules folder mining Bitcoin or holding your machine for ransom in Doo 2 the standard library is fully stable and eliminates the need for tools like just for testing chalk for CLI formatting or low Das for utilities just to name a few of the STDs you can get here the amount of mental boiler plate you end up for moving with Dino is pretty staggering but it also has some more exotic commands that you'll want to know about like Dino compile can take your JavaScript code and turn it into a binary
that runs on Mac OS windows or Linux allowing you to lar as a compiled language programmer what's even cooler though is that Dino has integrated the Jupiter kernel from the python ecosystem a tool that allows developers to create interactive notebooks where you execute code block by block that's never really caught on in the JavaScript world but now that you can just run Dino Jupiter that might change in the future now I know I've been doing a lot of shilling and this video is not sponsored but what are the actual drawbacks of switching from node to
dino well prior to version two its number one weakness was the node npm compatibility but now that that's a thing of the past I'm having a hard time coming up with bad things to say about it it's free and open source although it's maintained by a for-profit company that wants to sell you hosting and things like that in contrast node is part of the openjs foundation and supported by tons of big companies which is essential if you're an Enterprise but Dino is just now rolling out its own long-term support schedule but if you guys don't
buy their hosting the company might run out of money and Ryan do will have to move on to his next project Odin the nodejs dino killer and then on to Endo after that and he'll keep doing that until he reaches the final anagram of done this has been the code report thanks for watching and I will see you in the next one
Copyright © 2024. Made with ♥ in London by YTScribe.com