Skip to content

Instantly share code, notes, and snippets.

@m0o0scar
Created August 22, 2024 06:07
Show Gist options
  • Save m0o0scar/c370ccf81bf3e1e47035578b1cab25d3 to your computer and use it in GitHub Desktop.
Save m0o0scar/c370ccf81bf3e1e47035578b1cab25d3 to your computer and use it in GitHub Desktop.
NodeJS Evolves. Continue this conversation at https://readfm.vercel.app?gist=c370ccf81bf3e1e47035578b1cab25d3

[youtube] NodeJS Evolves

Source

Syntax

Duration: 00:55:46 Published: 2024-08-21

In this episode of Syntax, Wes and Scott talk about the latest features in Node.js, including native support for TypeScript, .env parsing, a built-in test runner, watch mode, SQLite integration, glob support, and top-level await. They also discuss some wishlist items, and experimental features like WebSocket support and the require module.

Show Notes

(00:00) Welcome to Syntax! (01:13) Brought to you by Sentry.io (01:37) Node.js new features (02:51) TypeScript (10:03) SQLite v22.5 (14:35) .env support (16:24) Test runner (19:42) Watch Mode (21:22) Glob support (22:48) Top-Level Await (26:40) Experimental require module (29:39) Experimental WebSocket support (30:13) Async local storage (31:43) Single file executables (32:46) Wishlist

  • (32:54) Hot reload
  • (34:20) Window shim
  • (35:30) Better server
  • (35:56) Better terminal integration (41:36) Twitter responses (46:54) Sick Picks (54:56) Shameless Plugs

All links available at https://syntax.fm/811


Hit us up on Socials!

Scott: https://twitter.com/stolinski Wes: https://twitter.com/wesbos Randy: https://www.youtube.com/@randyrektor Syntax: https://twitter.com/syntaxfm

http://www.syntax.fm

Brought to you by Sentry.io

#webdevelopment #webdeveloper #javascript

URL: https://www.youtube.com/v/8oU_TTbG-O8

Conversation

▲ Please summarize the video content and the major opinion of the comments into concise bullet points.

Here's a summary of the video content and the major opinions from the comments:

Video Content:

  • Node.js is evolving rapidly: The video highlights numerous new features and experimental features in Node.js, including native TypeScript support, .env parsing, a built-in test runner, watch mode, SQLite integration, glob support, and top-level await.
  • Influence of Dino and Bun: The video suggests that the emergence of Dino and Bun has likely influenced Node.js's rapid improvement, as they have introduced features that Node.js has now adopted.
  • Focus on web standards: Many of the new features align with web standards, making it easier to write cross-platform code.
  • Experimental features: The video discusses experimental features like WebSocket support and the require module, which are not yet stable but show Node.js's willingness to experiment.
  • Wish list: The video concludes with a wish list of features that the hosts would like to see in Node.js, including hot reload, a window shim, a better built-in HTTP server, and better terminal integration.

Major Opinions from Comments:

  • Positive reception of new features: Many commenters express excitement about the new features, particularly TypeScript support, .env parsing, and the built-in test runner.
  • Ease of use for newcomers: Commenters note that these features make Node.js more approachable for new developers.
  • Desire for SQLite in browsers: Some commenters express frustration that SQLite is not a native feature in browsers.
  • Concerns about .env support: One commenter highlights the limitation of .env support being only a command-line option, making it difficult to use in certain scenarios.
  • Appreciation for Node.js's progress: Overall, the comments reflect a positive sentiment towards Node.js's direction and its commitment to improving the developer experience.

Data Source Content

Full data source content here # YouTube Video

Info

  • Title: NodeJS Evolves
  • Channel: Syntax
  • Published at: 2024-08-21T10:00:12Z

Description

In this episode of Syntax, Wes and Scott talk about the latest features in Node.js, including native support for TypeScript, .env parsing, a built-in test runner, watch mode, SQLite integration, glob support, and top-level await. They also discuss some wishlist items, and experimental features like WebSocket support and the require module.

Show Notes

(00:00) Welcome to Syntax! (01:13) Brought to you by Sentry.io (01:37) Node.js new features (02:51) TypeScript (10:03) SQLite v22.5 (14:35) .env support (16:24) Test runner (19:42) Watch Mode (21:22) Glob support (22:48) Top-Level Await (26:40) Experimental require module (29:39) Experimental WebSocket support (30:13) Async local storage (31:43) Single file executables (32:46) Wishlist

  • (32:54) Hot reload
  • (34:20) Window shim
  • (35:30) Better server
  • (35:56) Better terminal integration (41:36) Twitter responses (46:54) Sick Picks (54:56) Shameless Plugs

All links available at https://syntax.fm/811


Hit us up on Socials!

Scott: https://twitter.com/stolinski Wes: https://twitter.com/wesbos Randy: https://www.youtube.com/@randyrektor Syntax: https://twitter.com/syntaxfm

http://www.syntax.fm

Brought to you by Sentry.io

#webdevelopment #webdeveloper #javascript

Caption

00:00:00 --> 00:00:05 welcome to syntax today we've got an

00:00:02 --> 00:00:07 awesome show for you today on how nodejs

00:00:05 --> 00:00:09 has been kicking ass lately lots of new

00:00:08 --> 00:00:12 features hitting node.js a lot of stuff

00:00:10 --> 00:00:15 we've been asking for for years and it

00:00:12 --> 00:00:18 kind of splits up into like a aligning

00:00:16 --> 00:00:21 with web standards and B not web

00:00:19 --> 00:00:23 standards at all but things that we all

00:00:21 --> 00:00:24 use anyways it's sort of just like

00:00:23 --> 00:00:26 industry norms and they're being

00:00:24 --> 00:00:29 implemented and a lot of these things

00:00:26 --> 00:00:31 are we think because Dino and bun have

00:00:30 --> 00:00:34 have sort of come along and said hey

00:00:32 --> 00:00:35 let's make a better nodejs and now node

00:00:35 --> 00:00:39 is adding them so we're going to go

00:00:36 --> 00:00:40 through this massive list of new

00:00:39 --> 00:00:43 features that you can use natively in

00:00:41 --> 00:00:45 node.js and I'm pretty excited about

00:00:43 --> 00:00:47 them my name is West boss I'm a web

00:00:45 --> 00:00:49 developer from Canada with me as always

00:00:47 --> 00:00:51 is Scott tulinsky how you doing Scott oh

00:00:50 --> 00:00:53 I'm doing great you know I'm stoked for

00:00:52 --> 00:00:55 all this stuff and in fact some of these

00:00:54 --> 00:00:59 things making me want to update my node

00:00:56 --> 00:01:00 version to a nightly version which uh

00:00:59 --> 00:01:02 that that's not out of the realm of

00:01:00 --> 00:01:03 something I would do but not not quite

00:01:02 --> 00:01:05 what I'm going to be doing and let's say

00:01:04 --> 00:01:07 if you are updating your version of node

00:01:06 --> 00:01:08 to a nightly version you're definitely

00:01:07 --> 00:01:10 going to want to have airon exception

00:01:08 --> 00:01:11 handling tracking in your application

00:01:10 --> 00:01:13 because who knows what's going on in

00:01:12 --> 00:01:16 those nightly so you'll want to check it

00:01:14 --> 00:01:17 out at sentry.io the perfect place to

00:01:16 --> 00:01:19 track all of your errors and exceptions

00:01:17 --> 00:01:21 but also track your performance track

00:01:19 --> 00:01:22 metrics track all kinds of stuff you

00:01:21 --> 00:01:25 want to understand what's going on in

00:01:23 --> 00:01:27 your application why it's slow uh this

00:01:25 --> 00:01:28 is the place to do it why it's slow why

00:01:27 --> 00:01:30 it's buggy we both know it's slow and

00:01:29 --> 00:01:33 buggy so let's fix that by having that

00:01:31 --> 00:01:35 visibility from Sentry so head over to

00:01:33 --> 00:01:38 sentry.io syntax sign up and get 2

00:01:35 --> 00:01:40 months for free and let's get into it so

00:01:39 --> 00:01:44 first and foremost you would mentioned

00:01:41 --> 00:01:46 like is this because Dino or and Bun and

00:01:44 --> 00:01:47 I think one thing that you'll notice

00:01:46 --> 00:01:49 through the course of this episode that

00:01:48 --> 00:01:53 a lot of these

00:01:49 --> 00:01:55 features did arrive first in Dino or bun

00:01:53 --> 00:01:57 so it's it's not necessarily without

00:01:56 --> 00:02:00 question to say the competitive nature

00:01:58 --> 00:02:03 of these run times probably has

00:02:01 --> 00:02:06 influenced node's continued Improvement

00:02:03 --> 00:02:06 because honestly I don't know if it's a

00:02:06 --> 00:02:09 very recent thing because node has

00:02:07 --> 00:02:12 always been kind of steadily improving

00:02:10 --> 00:02:15 it does feel like in the past 6 months

00:02:12 --> 00:02:16 or five months there's been a huge jump

00:02:15 --> 00:02:18 of some of these wild features that I

00:02:17 --> 00:02:20 don't think I would have ever predicted

00:02:18 --> 00:02:23 would have landed in in

00:02:20 --> 00:02:26 nodejs yeah and we should also say that

00:02:23 --> 00:02:28 like node is not a company right like

00:02:27 --> 00:02:30 it's just an organization and it's run

00:02:29 --> 00:02:33 by

00:02:30 --> 00:02:35 team yeah volunteers and anyone can

00:02:33 --> 00:02:37 bring suggestions to no and say hey

00:02:36 --> 00:02:40 maybe we should so like there's been a

00:02:38 --> 00:02:42 lot of people that have been sort of

00:02:40 --> 00:02:43 fighting for it or not necessarily

00:02:42 --> 00:02:46 fighting for it but making a good case

00:02:44 --> 00:02:48 for adding these types of things to the

00:02:46 --> 00:02:51 runtime and it's it's really exciting to

00:02:49 --> 00:02:54 see it take this direction yeah super

00:02:52 --> 00:02:56 exciting in fact man I I don't know what

00:02:55 --> 00:02:58 we want to get up to the start but I

00:02:56 --> 00:03:00 think the most exciting one to me is

00:02:58 --> 00:03:03 this first one that we have on the list

00:03:01 --> 00:03:09 which is node in their nightly has added

00:03:04 --> 00:03:11 support for typescript files and this is

00:03:09 --> 00:03:15 awesome it I should say the support is

00:03:12 --> 00:03:19 is that it is able to run typescript

00:03:15 --> 00:03:21 files as JavaScript files where the

00:03:19 --> 00:03:24 runtime itself is going to just ignore

00:03:21 --> 00:03:26 the typescript types exist and it's

00:03:24 --> 00:03:29 going to just run it as JavaScript

00:03:27 --> 00:03:32 meaning that your editor your your you

00:03:30 --> 00:03:34 know text editor will now be able to get

00:03:32 --> 00:03:37 all of those classic typescript insights

00:03:35 --> 00:03:40 that you get from typescript you can use

00:03:37 --> 00:03:42 typescript itself to run against your

00:03:40 --> 00:03:46 whole application to type check but you

00:03:42 --> 00:03:48 don't need to build your typescript code

00:03:46 --> 00:03:52 into JavaScript code to get it to run in

00:03:49 --> 00:03:54 node which is a massive massive

00:03:52 --> 00:03:58 productivity boost we won't have to

00:03:55 --> 00:04:01 reach for a whole bundler or anything

00:03:58 --> 00:04:03 set up just to load up a stinking

00:04:02 --> 00:04:06 typescript file which that's the those

00:04:04 --> 00:04:07 are the times I I reach for bun CU it's

00:04:06 --> 00:04:09 like I got a typescript file I just want

00:04:08 --> 00:04:11 to run this dang file I'm going to maybe

00:04:09 --> 00:04:12 write a singular script I don't want to

00:04:11 --> 00:04:14 compile this script and then have to run

00:04:13 --> 00:04:17 the script I just want to run the script

00:04:15 --> 00:04:19 that I'm writing and this is where this

00:04:17 --> 00:04:20 uh new typescript support will really

00:04:19 --> 00:04:22 come in handy for me personally I'm

00:04:21 --> 00:04:26 really excited about this because like

00:04:23 --> 00:04:27 like I use TSX right now and anytime I

00:04:26 --> 00:04:29 have to use something that's like sort

00:04:27 --> 00:04:31 of outside node you have to add another

00:04:29 --> 00:04:34 another like tooling to it and when it's

00:04:32 --> 00:04:36 not native then you have to realize okay

00:04:35 --> 00:04:38 well I'm not using the native node to

00:04:36 --> 00:04:41 run this like the like literally node

00:04:38 --> 00:04:43 command now how do I do this like like

00:04:41 --> 00:04:45 when the EnV support came out in node

00:04:44 --> 00:04:47 which we'll talk about in just a sec and

00:04:46 --> 00:04:49 I was like okay well like how do I pass

00:04:47 --> 00:04:50 these arguments to the thing I'm using

00:04:49 --> 00:04:53 so that they can then pass it to node

00:04:51 --> 00:04:55 and putting something else in between is

00:04:54 --> 00:04:58 kind of annoying so we should also

00:04:56 --> 00:05:00 explain that how typescript works with a

00:04:58 --> 00:05:02 lot of these things and it works this

00:05:00 --> 00:05:04 way in in Dino it works this way in bun

00:05:03 --> 00:05:07 now it works this way in node is that

00:05:04 --> 00:05:10 there's there's kind of like two parts

00:05:07 --> 00:05:13 to typescript there is type checking

00:05:11 --> 00:05:15 which is uh you take your typescript and

00:05:14 --> 00:05:18 you actually check that all of the types

00:05:16 --> 00:05:20 are satisfied and there is no errors and

00:05:18 --> 00:05:23 the only thing that can do that right

00:05:20 --> 00:05:25 now is the TSC node package the official

00:05:23 --> 00:05:27 type script node package there are no

00:05:26 --> 00:05:30 other tools there are some being worked

00:05:27 --> 00:05:32 on but they're sort of just piped dreams

00:05:30 --> 00:05:34 that will be able to do that but right

00:05:32 --> 00:05:36 now it's just TSC and then there are

00:05:34 --> 00:05:38 lots of other tools or several other

00:05:37 --> 00:05:41 tools that will simply take your

00:05:39 --> 00:05:43 typescript and take out the types they

00:05:41 --> 00:05:45 will strip them from the runtime and

00:05:43 --> 00:05:47 give you JavaScript out the other end

00:05:46 --> 00:05:51 and then sort of in between that there

00:05:48 --> 00:05:53 are several features of typescript that

00:05:51 --> 00:05:57 are compiled too because I often like to

00:05:53 --> 00:05:58 explain typescript as JavaScript with

00:05:57 --> 00:06:02 sprinkles on top meaning that you sort

00:05:59 --> 00:06:03 of sprinkle on typings so that you can

00:06:02 --> 00:06:06 add a type system to JavaScript but

00:06:04 --> 00:06:10 there are things like enums the older

00:06:07 --> 00:06:13 typescript decorators several I think

00:06:10 --> 00:06:16 Nam spaces is another one where they

00:06:13 --> 00:06:19 literally do compile to JavaScript which

00:06:16 --> 00:06:22 is a bit of a an odd one and those

00:06:19 --> 00:06:25 things can be done in these these build

00:06:23 --> 00:06:29 toolings but they are not part of the

00:06:25 --> 00:06:30 node.js support and quite honestly I

00:06:29 --> 00:06:33 think I like that because it's a pain if

00:06:31 --> 00:06:35 you use enums but all of those like

00:06:34 --> 00:06:39 weird stepchild parts of typescript I

00:06:36 --> 00:06:40 don't I don't mess with so uh I'm pretty

00:06:39 --> 00:06:43 excited about that plus like we're

00:06:41 --> 00:06:46 getting types as comments or that is now

00:06:44 --> 00:06:50 a spec that's being proposed meaning

00:06:47 --> 00:06:53 that JavaScript is being proposed that

00:06:50 --> 00:06:57 we we give some syntax we allocate parts

00:06:53 --> 00:06:58 of the language for typing and the

00:06:57 --> 00:07:01 browser will not and the JavaScript

00:06:59 --> 00:07:03 runtime is not going to parse them it's

00:07:01 --> 00:07:04 not going to type check them it's simply

00:07:03 --> 00:07:06 going to do what we just said which is

00:07:05 --> 00:07:09 the browser will simply ignore them

00:07:07 --> 00:07:10 that's why it's called types as comments

00:07:09 --> 00:07:12 not because we write them in comments

00:07:10 --> 00:07:15 but because the browser ignores them as

00:07:12 --> 00:07:17 if they were a comment and I like that

00:07:16 --> 00:07:19 because the the enum stuff and whatever

00:07:18 --> 00:07:21 is is not going to be part of that as

00:07:19 --> 00:07:23 well and if we're looking forward to

00:07:22 --> 00:07:26 what comes after typescript I think that

00:07:23 --> 00:07:27 this is it yeah and and what's so great

00:07:26 --> 00:07:29 about this and to be clear for those of

00:07:28 --> 00:07:31 you who who might not be

00:07:30 --> 00:07:34 entirely up on the differences and what

00:07:31 --> 00:07:36 exactly all this stuff is again this is

00:07:34 --> 00:07:39 not the JavaScript types as comments

00:07:37 --> 00:07:42 this is not a language feature this is a

00:07:39 --> 00:07:43 nodejs feature so this this code will

00:07:42 --> 00:07:46 not be ignored the types will not be

00:07:44 --> 00:07:48 ignored in browser until it's added to

00:07:46 --> 00:07:51 browsers themselves so this is just for

00:07:49 --> 00:07:54 what to the language yes cor part of

00:07:52 --> 00:07:56 like the JavaScript runtime like V8 must

00:07:54 --> 00:07:59 implement it what's interesting about

00:07:57 --> 00:08:03 this is that you know technically is

00:07:59 --> 00:08:05 that this uses s swc wasm typescript

00:08:03 --> 00:08:09 under the hood to do that stripping of

00:08:06 --> 00:08:12 the types and I think that's really wild

00:08:09 --> 00:08:15 to see I I are things like swc wasm

00:08:13 --> 00:08:19 being added to node is that a new style

00:08:16 --> 00:08:22 of improving node like bringing in a

00:08:19 --> 00:08:24 third-party wasm type stripper it feels

00:08:23 --> 00:08:26 pretty crazy to me but I actually I

00:08:25 --> 00:08:28 don't know the history to know if there

00:08:27 --> 00:08:30 there haven't been or has been things

00:08:28 --> 00:08:31 like this that have happened more often

00:08:30 --> 00:08:34 but you can now be kind of assured that

00:08:31 --> 00:08:36 if you used s swc or bet on S swc for

00:08:34 --> 00:08:39 any particular reason yeah it's probably

00:08:37 --> 00:08:41 not going anywhere and the kind of cool

00:08:39 --> 00:08:43 thing about if you read the proposal for

00:08:42 --> 00:08:47 this and we should say this is all still

00:08:44 --> 00:08:51 experimental but the idea here is that

00:08:48 --> 00:08:53 don't bake this into node core but I I

00:08:52 --> 00:08:56 think the idea is eventually it will be

00:08:53 --> 00:08:58 a loader meaning that in no. JS loaders

00:08:56 --> 00:09:01 are a way to tell it hey when somebody

00:08:59 --> 00:09:05 requires this type of file you can use

00:09:02 --> 00:09:07 this code to First parse it and process

00:09:05 --> 00:09:09 it right like somebody loads CSS no

00:09:08 --> 00:09:11 doesn't know about CSS but you can put a

00:09:09 --> 00:09:13 no you can put a loader in there so it

00:09:11 --> 00:09:15 will understand what to do with the CSS

00:09:14 --> 00:09:19 when somebody Imports it or or requires

00:09:16 --> 00:09:21 it so the idea is like it's not going to

00:09:19 --> 00:09:25 be like baked in to nodejs very similar

00:09:22 --> 00:09:28 to how npm is not baked in to node.js

00:09:26 --> 00:09:30 and they can be operated separately and

00:09:28 --> 00:09:31 that's going to be ideal because then

00:09:30 --> 00:09:35 you're not going to be locked in

00:09:32 --> 00:09:37 typescript versions to to node versions

00:09:35 --> 00:09:39 so I was surprised to see that this is

00:09:38 --> 00:09:43 not a loader this is just some sort of

00:09:40 --> 00:09:45 other experimental implementation but

00:09:43 --> 00:09:47 the end game is that this will be a

00:09:45 --> 00:09:50 loader interesting yeah cool so this is

00:09:48 --> 00:09:52 not available to necessarily use unless

00:09:50 --> 00:09:54 you're grabbing a nightly right now if

00:09:52 --> 00:09:55 you just want to go experiment with it

00:09:54 --> 00:09:57 but for now I think it's just something

00:09:55 --> 00:09:58 to be aware of this thing is going to be

00:09:57 --> 00:10:00 coming down the line really soon and

00:09:59 --> 00:10:04 will update you when it is available to

00:10:01 --> 00:10:06 use in node the next one is something

00:10:05 --> 00:10:08 that I also did not expect this was

00:10:07 --> 00:10:10 something that I would have expected to

00:10:08 --> 00:10:13 have gotten a lot of push back and this

00:10:10 --> 00:10:16 is adding SQL light to node and this is

00:10:14 --> 00:10:19 one of my favorite bun features and one

00:10:16 --> 00:10:20 of the reasons why I would pick bun for

00:10:19 --> 00:10:23 various little things is because SQL

00:10:21 --> 00:10:27 light is just available as an import in

00:10:24 --> 00:10:29 bun and it has been added to node uh Wes

00:10:28 --> 00:10:32 can you tell us more

00:10:30 --> 00:10:35 yeah so you might be asking like like

00:10:32 --> 00:10:36 why would we add a database driver to

00:10:35 --> 00:10:42 the language you know that seems a bit

00:10:37 --> 00:10:44 odd but because squeite is so popular

00:10:43 --> 00:10:47 I'm just

00:10:45 --> 00:10:48 joking we Honestly though we should just

00:10:47 --> 00:10:51 mispronounce things like that for the

00:10:49 --> 00:10:56 sake of a Tik Tok clip

00:10:51 --> 00:10:59 be because a SQL light is so uniform

00:10:56 --> 00:11:01 it's on literally every device there's

00:10:59 --> 00:11:02 chances are that there's a toaster out

00:11:02 --> 00:11:06 there there's probably it's running on

00:11:03 --> 00:11:09 your phone iMessage uses it it's so

00:11:07 --> 00:11:12 common place that it's it's everywhere

00:11:09 --> 00:11:14 it makes sense to sort of bake this in

00:11:12 --> 00:11:17 straight to the language so you can save

00:11:14 --> 00:11:18 it and by default it it works with

00:11:17 --> 00:11:22 memory you can also use it with external

00:11:19 --> 00:11:24 file I don't know that it would probably

00:11:22 --> 00:11:26 works with like like externally hosted

00:11:25 --> 00:11:30 SQL light I haven't used it myself just

00:11:27 --> 00:11:33 yet but I'm I think this is great to

00:11:30 --> 00:11:37 have it right baked in because again if

00:11:33 --> 00:11:40 we now have a standardized way to share

00:11:38 --> 00:11:43 data to a file that is not I I know we

00:11:41 --> 00:11:45 have local storage and index DB but we

00:11:43 --> 00:11:47 don't really have those in node do we

00:11:45 --> 00:11:49 now we have a standardized way that we

00:11:47 --> 00:11:51 can store and share data what does that

00:11:50 --> 00:11:55 mean for different modules that want to

00:11:52 --> 00:11:56 sort of talk to each other yeah so this

00:11:55 --> 00:12:00 is it's super interesting you can import

00:11:57 --> 00:12:02 it import sqlite from node col SQ light

00:12:00 --> 00:12:04 it was added in version

00:12:02 --> 00:12:06 22.5 and what I'm looking at that

00:12:04 --> 00:12:09 connection string and it says that the

00:12:07 --> 00:12:12 location when you're doing a essentially

00:12:09 --> 00:12:14 a connection here must either be stored

00:12:12 --> 00:12:16 in a file or in memory so you can just

00:12:15 --> 00:12:18 have the value as being colon memory

00:12:17 --> 00:12:21 colon if you want it to be stored in

00:12:19 --> 00:12:25 memory but for a file backed database

00:12:22 --> 00:12:27 the location must be a path to a file so

00:12:25 --> 00:12:29 it doesn't say anything about if that

00:12:27 --> 00:12:32 path to a file is X external or internal

00:12:30 --> 00:12:36 or whatever probably uses the like file

00:12:33 --> 00:12:38 system apis I think for most serverless

00:12:36 --> 00:12:40 neither of these are going to be okay if

00:12:39 --> 00:12:43 you want it to persist past running and

00:12:41 --> 00:12:45 I I think well maybe that is okay

00:12:43 --> 00:12:46 because a lot of times you might be

00:12:45 --> 00:12:48 using this with a serverless function

00:12:47 --> 00:12:50 where the function starts you'll create

00:12:48 --> 00:12:52 a quick SQL light database you'll store

00:12:50 --> 00:12:53 a bunch of stuff and then you'll send it

00:12:52 --> 00:12:57 along the way but with these like

00:12:54 --> 00:12:59 ephemeral hosts serverless Edge compute

00:12:58 --> 00:13:01 uh even

00:12:59 --> 00:13:03 box based stuff that spins up multiple

00:13:02 --> 00:13:06 boxes you're not going to be able to to

00:13:04 --> 00:13:07 do that because they spin down and and

00:13:06 --> 00:13:09 delete the files that's the same reason

00:13:08 --> 00:13:12 why you can't store jpegs that people

00:13:10 --> 00:13:14 have uploaded to your website on the

00:13:12 --> 00:13:16 actual box that you're running because

00:13:15 --> 00:13:18 they will be deleted and cleaned up

00:13:16 --> 00:13:19 before you run away this be super handy

00:13:18 --> 00:13:22 if you're building like even desktop

00:13:20 --> 00:13:23 applications you can think like electron

00:13:22 --> 00:13:25 or or Tori that have like or I don't

00:13:24 --> 00:13:27 know if Tori has a node available but

00:13:26 --> 00:13:29 like let's say something like electron

00:13:28 --> 00:13:31 you have available node you could have

00:13:30 --> 00:13:34 your data living in a database that's

00:13:31 --> 00:13:35 shipped with the application itself nice

00:13:34 --> 00:13:40 and easy or even like another thing I

00:13:35 --> 00:13:41 was thinking is the raycast extensions

00:13:40 --> 00:13:45 one of the raycast extension that I use

00:13:42 --> 00:13:47 is it takes the one-time passwords that

00:13:45 --> 00:13:50 get SMS to you and will autofill them

00:13:47 --> 00:13:52 into your into the browser which is a

00:13:50 --> 00:13:53 thing on Safari such a great feature but

00:13:52 --> 00:13:55 it's not a thing on all the other

00:13:54 --> 00:13:58 browsers so what that extension does is

00:13:56 --> 00:14:01 it reads the sqlite database from your

00:13:59 --> 00:14:03 computer which is your iMessage is a

00:14:02 --> 00:14:06 whole bunch of sqlite databases on your

00:14:04 --> 00:14:08 computer so if you're writing node

00:14:06 --> 00:14:10 scripts that need to not necessarily

00:14:08 --> 00:14:13 just save data but sometimes you just

00:14:10 --> 00:14:15 simply need to parse data that is is on

00:14:13 --> 00:14:18 a device yeah what about like embedded

00:14:16 --> 00:14:20 devices as well yeah is that where we're

00:14:18 --> 00:14:22 going with this like like we are

00:14:21 --> 00:14:24 starting we've talked a lot about like

00:14:23 --> 00:14:27 JavaScript running on embedded devices

00:14:24 --> 00:14:28 or JavaScript running on low power

00:14:27 --> 00:14:31 devices is that eventally where we're

00:14:29 --> 00:14:35 going with this type of thing yeah need

00:14:31 --> 00:14:38 a database got uh node yeah cool next

00:14:35 --> 00:14:41 one we have here isv support so again

00:14:39 --> 00:14:43 like the frustrating thing about

00:14:42 --> 00:14:46 developing a node application a year or

00:14:44 --> 00:14:47 two years ago is I would start a brand

00:14:46 --> 00:14:50 new node application and I would say

00:14:48 --> 00:14:53 okay well I need TSX to run I I'm going

00:14:50 --> 00:14:56 to do it in typescript uh I need the EnV

00:14:53 --> 00:14:57 because I put my environmental variables

00:14:56 --> 00:15:00 in aemv file and I need to be able to

00:14:58 --> 00:15:01 parse that and to put it into whatever

00:15:00 --> 00:15:02 and there was like three or four of

00:15:02 --> 00:15:05 these like you need these in every

00:15:03 --> 00:15:06 project and it's it's kind of annoying

00:15:05 --> 00:15:10 when you just want to write a quick

00:15:06 --> 00:15:13 script now node has the ability to

00:15:10 --> 00:15:18 simply just when you run node you can

00:15:14 --> 00:15:21 pass a-- EnV file and it will pick up

00:15:19 --> 00:15:22 the path to it and then it will populate

00:15:21 --> 00:15:24 and put all those environmental

00:15:22 --> 00:15:28 variables in so you can access them via

00:15:24 --> 00:15:31 process.env do whatever again major

00:15:29 --> 00:15:33 major update and also one of the cool

00:15:31 --> 00:15:35 things that people maybe don't recognize

00:15:33 --> 00:15:37 like yes you can put tokens in there you

00:15:36 --> 00:15:39 can put API keys and you can put

00:15:38 --> 00:15:41 passwords and and database connection

00:15:39 --> 00:15:42 strings and all that stuff that you're

00:15:41 --> 00:15:47 used to but the other thing that you can

00:15:42 --> 00:15:49 put in EnV files is node Flags so if you

00:15:47 --> 00:15:52 have features that you want to turn on

00:15:50 --> 00:15:53 in your node environment like for

00:15:52 --> 00:15:57 example we're going to be talking about

00:15:54 --> 00:15:59 the uh experimental require module or

00:15:57 --> 00:16:01 the experimental websocket support if

00:16:00 --> 00:16:04 you want to turn those features on you

00:16:02 --> 00:16:06 used to have to like put them in your

00:16:04 --> 00:16:10 like npm script package and You' have

00:16:07 --> 00:16:13 this huge ass long connection thing that

00:16:10 --> 00:16:16 you'd have to run now you can put those

00:16:13 --> 00:16:18 environmental variables in the nodecore

00:16:17 --> 00:16:21 options environmental variable and they

00:16:19 --> 00:16:24 will get picked up because it's reading

00:16:21 --> 00:16:26 the EMV file which is really cool yeah

00:16:24 --> 00:16:28 another like you said it's just one of

00:16:26 --> 00:16:30 those things we add to every sing single

00:16:29 --> 00:16:32 project and getting away from that stuff

00:16:31 --> 00:16:34 is great another one of these is a test

00:16:33 --> 00:16:36 Runner you know the the whole let me

00:16:34 --> 00:16:37 tell you I had my fair share of issues

00:16:36 --> 00:16:39 with just in the past with you know

00:16:38 --> 00:16:43 having to compile my tests and things

00:16:40 --> 00:16:47 like that having a a test Runner baked

00:16:43 --> 00:16:48 into node is one of those things that it

00:16:47 --> 00:16:51 feels like it flew way under the radar

00:16:49 --> 00:16:53 for most people and I don't I don't know

00:16:52 --> 00:16:56 why that is but there's so much good

00:16:54 --> 00:16:59 stuff in here it's just the um package

00:16:56 --> 00:17:01 name space is just node colon test and

00:17:00 --> 00:17:04 it works exactly like what you're used

00:17:02 --> 00:17:06 to test the name of your test inside of

00:17:04 --> 00:17:08 there you can do assertions like assert

00:17:07 --> 00:17:12 strict equal you can do all kinds of

00:17:09 --> 00:17:13 things to the point where like I I don't

00:17:12 --> 00:17:16 know what are the particular use cases

00:17:14 --> 00:17:19 for reaching for other testing

00:17:17 --> 00:17:22 individual libraries like v test I don't

00:17:19 --> 00:17:24 know why you would reach for v test over

00:17:22 --> 00:17:27 just using nodes baked in testing unless

00:17:25 --> 00:17:29 of course you're testing UI things I

00:17:28 --> 00:17:30 don't I don't know I don't I'm thinking

00:17:29 --> 00:17:32 off the top of my head here I don't

00:17:31 --> 00:17:35 honestly know because I haven't used the

00:17:33 --> 00:17:37 node testing I don't write that many

00:17:35 --> 00:17:40 unit tests I tend to go more towards end

00:17:37 --> 00:17:42 to- end testing myself but I think like

00:17:40 --> 00:17:45 maybe like if you're using TSX like you

00:17:42 --> 00:17:47 said some some of the client side stuff

00:17:46 --> 00:17:51 but like it's crazy like you're telling

00:17:48 --> 00:17:54 me now that I can write my tests in

00:17:51 --> 00:17:57 typescript and have features turned on

00:17:54 --> 00:18:01 in a EnV file yeah and none of that

00:17:58 --> 00:18:03 requires some bizarre bundle compile

00:18:02 --> 00:18:05 twep that was always the pain that

00:18:03 --> 00:18:07 everybody had with J is that you had to

00:18:05 --> 00:18:09 literally compile your code first yes

00:18:08 --> 00:18:12 with this it's testing it as it's

00:18:10 --> 00:18:14 running on your actual server and we're

00:18:13 --> 00:18:17 taking all of the

00:18:15 --> 00:18:20 middle ground out of the picture and

00:18:17 --> 00:18:22 it's just straight running with a node

00:18:20 --> 00:18:24 which I'm again I I keep saying I can't

00:18:23 --> 00:18:26 believe it I'm so happy about this but

00:18:25 --> 00:18:29 like as you get into larger and larger

00:18:27 --> 00:18:31 applications it's either and you want to

00:18:29 --> 00:18:34 add something it's just such a pain in

00:18:31 --> 00:18:36 the butt and things go wrong and esm

00:18:34 --> 00:18:39 doesn't work in this specific use case

00:18:37 --> 00:18:42 and there's gotas here and oh you

00:18:40 --> 00:18:44 actually are compiling to CJs and then

00:18:42 --> 00:18:46 you're running the test none of that

00:18:45 --> 00:18:49 we're all done with that it only feel it

00:18:47 --> 00:18:51 feels like a very short time ago that we

00:18:49 --> 00:18:54 were like why can't we have tests baked

00:18:51 --> 00:18:56 in like rust or why can't we have uh

00:18:55 --> 00:18:59 this or that and it's like so many of

00:18:57 --> 00:19:01 these things are here and we hardly even

00:18:59 --> 00:19:02 notice um which is just incredible it's

00:19:01 --> 00:19:04 so funny we just recorded an episode

00:19:02 --> 00:19:07 about CSS new stuff and the same thing

00:19:05 --> 00:19:09 it's like somehow relative color syntax

00:19:07 --> 00:19:10 uh the fact that it landed in July

00:19:09 --> 00:19:12 slipped under the radar for me and I'm

00:19:11 --> 00:19:14 staying up on this stuff so it's

00:19:12 --> 00:19:15 incredible that all this stuff is just

00:19:14 --> 00:19:18 kind of moving along here I think a lot

00:19:16 --> 00:19:19 of the reason behind this is because

00:19:18 --> 00:19:22 this these are decisions that you need

00:19:20 --> 00:19:25 to make early on in a project and most

00:19:22 --> 00:19:26 people's projects are already running

00:19:25 --> 00:19:29 and it's just not a lot of the stuff is

00:19:27 --> 00:19:30 if it's working I'm not messing with it

00:19:29 --> 00:19:33 nobody wants to mess with build tools or

00:19:31 --> 00:19:36 testing or or anything like that but if

00:19:34 --> 00:19:38 you're starting a fresh from scratch

00:19:36 --> 00:19:39 project it's worth taking a look at the

00:19:38 --> 00:19:41 list that we're talking today and saying

00:19:40 --> 00:19:45 which of these things can I go full

00:19:41 --> 00:19:46 native on yeah next one here is um watch

00:19:45 --> 00:19:50 mode which hey uh I used to be called

00:19:47 --> 00:19:51 the nodm and now I get to use watch mode

00:19:50 --> 00:19:54 baked into node it's crazy because like

00:19:52 --> 00:19:55 what else like that's another thing one

00:19:54 --> 00:19:58 more thing you install on every single

00:19:56 --> 00:20:01 project is something to watch your files

00:19:59 --> 00:20:04 for when you make a change so we now

00:20:01 --> 00:20:06 have watch mode which is as simple as

00:20:04 --> 00:20:09 just a hyphen hyen watch flag it's just

00:20:07 --> 00:20:11 a watch flag in your standard node

00:20:09 --> 00:20:14 command you even have a watch path if

00:20:11 --> 00:20:16 you want to watch a specific path folder

00:20:14 --> 00:20:18 watch a folder yeah um so man that's

00:20:17 --> 00:20:20 incredible you can even with watch path

00:20:18 --> 00:20:21 you you can have multiple paths too you

00:20:20 --> 00:20:23 can use that flag multiple times so you

00:20:22 --> 00:20:25 can say watch path here's a path and

00:20:24 --> 00:20:28 then watch another path here's the path

00:20:26 --> 00:20:30 man what what node mon is dead what what

00:20:28 --> 00:20:31 are you going to use noon for when this

00:20:30 --> 00:20:32 came out I posted that and like Ramy

00:20:31 --> 00:20:34 sharper was like ah it's it's not

00:20:33 --> 00:20:37 totally dead but with these tools

00:20:35 --> 00:20:39 there's always like nodon is so full

00:20:37 --> 00:20:41 featured and there's lots of little Edge

00:20:39 --> 00:20:44 casy use cases that people use it for

00:20:41 --> 00:20:46 but for for the high level very simple

00:20:45 --> 00:20:50 watching a file and rerunning it when it

00:20:47 --> 00:20:52 changes that's what most people need and

00:20:50 --> 00:20:55 and now that is totally baked in and

00:20:53 --> 00:20:57 again watching was always one of those

00:20:55 --> 00:21:00 pain in the butt things that was

00:20:57 --> 00:21:03 annoying with typescript because you had

00:21:00 --> 00:21:06 to write it in typescript compile it put

00:21:04 --> 00:21:09 it in some other folder then the Watcher

00:21:06 --> 00:21:11 had to see oh something in your compile

00:21:09 --> 00:21:15 folder changed let me now restart myself

00:21:12 --> 00:21:18 and it's not not a thing anymore you can

00:21:15 --> 00:21:20 simply just watch a typescript file uh

00:21:19 --> 00:21:24 which is is good news yes it's great

00:21:21 --> 00:21:27 news yeah uh next one we have here is

00:21:24 --> 00:21:30 glob support So Globs in programming in

00:21:28 --> 00:21:33 general General are the ability to sort

00:21:30 --> 00:21:35 of do like wild card file matching

00:21:33 --> 00:21:38 meaning that like you give me everything

00:21:35 --> 00:21:40 with an extension of DJs or give me all

00:21:38 --> 00:21:42 the files that start with puppy and end

00:21:41 --> 00:21:47 in jpeg or

00:21:43 --> 00:21:49 JPEG and being able to sort of people

00:21:47 --> 00:21:53 always think they're Rex's they're not

00:21:49 --> 00:21:55 but use this syntax to match files on

00:21:53 --> 00:21:56 your file system for example in the

00:21:55 --> 00:22:00 syntax website we have a glob that will

00:21:57 --> 00:22:02 simply just look for all MD files that

00:22:01 --> 00:22:05 are in the markdown folder and it pulls

00:22:03 --> 00:22:08 them all in and we process each of the

00:22:05 --> 00:22:11 shows individually glob support is

00:22:08 --> 00:22:14 something that was in node for many many

00:22:11 --> 00:22:18 years and it was never actually exposed

00:22:14 --> 00:22:21 as a public API until until recently and

00:22:19 --> 00:22:24 now we have full glob support in with

00:22:22 --> 00:22:27 the the file system to to read files off

00:22:24 --> 00:22:28 disk this one's so under my radar

00:22:27 --> 00:22:31 because when we had a section in this

00:22:29 --> 00:22:34 episode at the end called wish list and

00:22:31 --> 00:22:36 on my wish list was glob support or glob

00:22:34 --> 00:22:37 Imports uh we have them already I just

00:22:36 --> 00:22:39 did not know that's like one of my

00:22:38 --> 00:22:41 favorite features in vit I use it all

00:22:39 --> 00:22:42 the time to do like many of the same

00:22:41 --> 00:22:45 things you just mentioned so yeah glob

00:22:43 --> 00:22:47 Imports are super duper handy and I find

00:22:45 --> 00:22:49 myself reaching for them all the time

00:22:48 --> 00:22:51 another one that I uh new landed but I

00:22:50 --> 00:22:54 didn't know to the extent of the support

00:22:51 --> 00:22:55 is top level await now top level await

00:22:54 --> 00:22:57 means that you know you're typically

00:22:56 --> 00:23:00 working in a typescript file and let's

00:22:58 --> 00:23:03 say you have a function that's at the

00:23:00 --> 00:23:04 exact like uh is it the root of the file

00:23:03 --> 00:23:07 would you call that the root yeah yeah

00:23:05 --> 00:23:09 yeah the the root scope of or module

00:23:07 --> 00:23:11 scope I guess the module scope okay so

00:23:09 --> 00:23:12 at the module like the like let's say

00:23:11 --> 00:23:14 you have a file it's calling one

00:23:13 --> 00:23:17 function and that file it returns a

00:23:15 --> 00:23:20 promise in the past you would always

00:23:17 --> 00:23:23 have to do a DOT then on that to get the

00:23:20 --> 00:23:25 result but now with top level await you

00:23:23 --> 00:23:27 can simply just await that function now

00:23:26 --> 00:23:29 top level await there's a whole post on

00:23:27 --> 00:23:31 it from cheris about how it could be a

00:23:29 --> 00:23:34 foot gun and I tend to agree with that

00:23:32 --> 00:23:36 because you don't always want to wait on

00:23:35 --> 00:23:39 the execution of one specific thing you

00:23:37 --> 00:23:41 don't want to hold up things within a

00:23:39 --> 00:23:43 weight but I think if you know what

00:23:41 --> 00:23:45 you're doing with it and you have a

00:23:44 --> 00:23:47 specific situation in which it comes in

00:23:45 --> 00:23:49 handy uh top level of weight I think to

00:23:48 --> 00:23:52 me makes things a lot more simple let's

00:23:50 --> 00:23:54 say you want to just import a specific

00:23:52 --> 00:23:55 file to initiate a connection or

00:23:54 --> 00:23:58 something like that you can just await

00:23:56 --> 00:24:01 that connection in that file instead of

00:23:59 --> 00:24:04 having to create a function then run

00:24:02 --> 00:24:06 that function for that that to happen so

00:24:05 --> 00:24:08 the database connection one is the most

00:24:07 --> 00:24:12 common one that I hit all the time is

00:24:08 --> 00:24:14 like I want to import DB from a file

00:24:12 --> 00:24:16 called DB and the first time that I

00:24:14 --> 00:24:19 require that I need you to make the

00:24:17 --> 00:24:21 connection and then return it and it was

00:24:20 --> 00:24:25 always really annoying because instead

00:24:21 --> 00:24:28 of just importing DB from db. TS you

00:24:25 --> 00:24:30 would have to import get DB from

00:24:29 --> 00:24:33 whatever and then you would have to go

00:24:31 --> 00:24:35 inside of some sort of function and

00:24:33 --> 00:24:36 await that value and the first time it

00:24:36 --> 00:24:39 would return it would take a second to

00:24:37 --> 00:24:40 connect and return it and then the rest

00:24:39 --> 00:24:43 of time it would resolve immediately

00:24:41 --> 00:24:45 being able to put this instantiating

00:24:43 --> 00:24:46 things databases if you have a class

00:24:45 --> 00:24:49 that needs to be instantiated the first

00:24:47 --> 00:24:51 time a module is required that was

00:24:50 --> 00:24:55 always a huge bit of a pain and you get

00:24:52 --> 00:24:57 into this like really weird where

00:24:55 --> 00:25:00 everything has to like import a go

00:24:57 --> 00:25:02 function or a start function and none of

00:25:01 --> 00:25:05 that is is needed anymore and this was

00:25:03 --> 00:25:08 not like a pain point in node.js for a

00:25:05 --> 00:25:11 long time because you could do it in you

00:25:08 --> 00:25:13 could do this type of stuff in commonjs

00:25:11 --> 00:25:15 but then when esm came around you

00:25:13 --> 00:25:18 couldn't do it but now you finally can

00:25:16 --> 00:25:21 do it which I'm pretty excited about

00:25:19 --> 00:25:23 yeah I'm stoked but this this is not

00:25:21 --> 00:25:27 actually not that new at all it came out

00:25:23 --> 00:25:30 in 2021 um but one of those things that

00:25:28 --> 00:25:34 the the whole like um LTS a lot of times

00:25:31 --> 00:25:36 the people don't adopt new node features

00:25:34 --> 00:25:41 until it's in LTS and node.js has this

00:25:37 --> 00:25:45 feature where the even numbers of

00:25:41 --> 00:25:48 node.js are going to go into LTS so

00:25:45 --> 00:25:50 right now node version 20.16 is the LTS

00:25:49 --> 00:25:53 version meaning that they will support

00:25:51 --> 00:25:56 it for I believe it is like a year and a

00:25:54 --> 00:25:58 half and if you are in a large company

00:25:56 --> 00:25:59 you say okay we're going to we're use

00:25:58 --> 00:26:01 that because it's going to get security

00:25:59 --> 00:26:04 updates it's going to get updates for

00:26:02 --> 00:26:07 whatever we need and then we'll have

00:26:05 --> 00:26:09 enough of a Runway we know that it's

00:26:07 --> 00:26:12 going to expire by this date so then we

00:26:09 --> 00:26:15 can we can plan ahead and then the the

00:26:12 --> 00:26:17 odd numbers which is like 21 that's sort

00:26:16 --> 00:26:21 of where they do all the development and

00:26:17 --> 00:26:22 whatnot and then the the odd numbers are

00:26:21 --> 00:26:24 will never be promoted to long-term

00:26:22 --> 00:26:26 support so you have to wait until a

00:26:24 --> 00:26:29 feature hits um that's often when you

00:26:27 --> 00:26:32 see a new feature it'll be pushed out in

00:26:30 --> 00:26:35 both an odd and an even version and

00:26:32 --> 00:26:36 that's because they they want it to hit

00:26:35 --> 00:26:40 LTS as

00:26:36 --> 00:26:41 well word uh what do we got next here

00:26:40 --> 00:26:43 experimental require module this is

00:26:42 --> 00:26:46 another one of those esm paper cuts the

00:26:44 --> 00:26:50 whole getting ecmascript modules in

00:26:46 --> 00:26:55 node.js was a bit of a a painful go

00:26:51 --> 00:26:58 through and there is now if you want to

00:26:55 --> 00:26:59 use esm modules which everybody should

00:26:58 --> 00:27:01 be using it should be the default for

00:27:00 --> 00:27:05 absolutely everything however node.js

00:27:02 --> 00:27:08 has this like old baggage where it's

00:27:05 --> 00:27:12 commonjs by default so if you write

00:27:09 --> 00:27:15 import whatever from node.js and you run

00:27:12 --> 00:27:18 that file it will break because no JS

00:27:15 --> 00:27:19 expects common JS require syntax by

00:27:18 --> 00:27:21 default so you have to create a package

00:27:20 --> 00:27:24 Json you have to go into the package

00:27:22 --> 00:27:26 Json and you have to set type of module

00:27:24 --> 00:27:28 I have a little shortcut on my computer

00:27:26 --> 00:27:32 that does it immediately you cannot even

00:27:29 --> 00:27:36 put type of module in your like npm and

00:27:33 --> 00:27:40 nit file so that it goes in by default

00:27:36 --> 00:27:43 very bizarre to me so node is

00:27:40 --> 00:27:47 experimenting with being able to detect

00:27:43 --> 00:27:49 if something is an esm progress so it'll

00:27:47 --> 00:27:51 take a look at your file and parse it

00:27:49 --> 00:27:53 out maybe look if there's a Import in

00:27:52 --> 00:27:56 there instead of a require um and then

00:27:54 --> 00:27:58 it will programmatically change it they

00:27:56 --> 00:28:00 say that this does take a little bit of

00:27:58 --> 00:28:02 time on Startup so you should probably

00:28:00 --> 00:28:05 still put this in your package Json type

00:28:03 --> 00:28:09 of module but it's one of those paper

00:28:05 --> 00:28:11 cuts that bun and adino do not have

00:28:09 --> 00:28:13 where you you shouldn't have to know it

00:28:12 --> 00:28:15 works like this especially somebody

00:28:13 --> 00:28:16 coming brand new to no. JS I have this

00:28:16 --> 00:28:20 with python all the time I'm always

00:28:17 --> 00:28:21 complaining there's all these gotchas in

00:28:20 --> 00:28:23 Python that you oh you have to use this

00:28:22 --> 00:28:26 oh didn't you use this make sure you

00:28:24 --> 00:28:28 have this and it's just like no make it

00:28:26 --> 00:28:31 work

00:28:28 --> 00:28:34 no make it work

00:28:32 --> 00:28:35 yeah oh man I'm curious about some of

00:28:35 --> 00:28:38 these other ones you have on here

00:28:36 --> 00:28:39 because I I don't know much about any of

00:28:38 --> 00:28:41 these you have on here so do you want to

00:28:39 --> 00:28:42 just run through some of these yeah so

00:28:41 --> 00:28:46 another thing that landed maybe about a

00:28:43 --> 00:28:50 year and a half ago is all of the web

00:28:46 --> 00:28:52 request standards so streams form data

00:28:50 --> 00:28:56 headers request response and fetch these

00:28:53 --> 00:28:59 apis are web standards for creating

00:28:57 --> 00:29:02 requests and sending data from client to

00:29:00 --> 00:29:05 server or server to server and having

00:29:03 --> 00:29:08 full support for all of these things

00:29:05 --> 00:29:09 means that we can write code that works

00:29:08 --> 00:29:13 in the browser we can write code that

00:29:09 --> 00:29:15 works in node.js and a lot of these new

00:29:13 --> 00:29:18 Frameworks Hano JS probably being one of

00:29:16 --> 00:29:23 my favorites they're all built on these

00:29:19 --> 00:29:25 Primitives that I just rattled off and

00:29:23 --> 00:29:28 now that node.js supports all of these

00:29:25 --> 00:29:30 things natively means that

00:29:28 --> 00:29:32 you can write a lot more crossplatform

00:29:31 --> 00:29:36 code rather than having to do the

00:29:33 --> 00:29:38 node.js equivalent of it it's a web

00:29:36 --> 00:29:41 standard a web request and web response

00:29:39 --> 00:29:45 standard along with that is experimental

00:29:41 --> 00:29:47 web socket support meaning that it will

00:29:45 --> 00:29:51 if you want to use websockets from the

00:29:48 --> 00:29:52 the client to the browser and vice versa

00:29:51 --> 00:29:55 there used to be like a a node.js

00:29:53 --> 00:29:57 websocket version and now there's now

00:29:55 --> 00:29:59 there's a standard which is in node.js

00:29:57 --> 00:30:01 but then there's an experimental client

00:29:59 --> 00:30:04 support as well so that you can very

00:30:02 --> 00:30:07 easily talk between the browser and the

00:30:05 --> 00:30:09 actual client so I'm hoping that lands

00:30:07 --> 00:30:11 in stable as well but I'm I love seeing

00:30:09 --> 00:30:12 that they're willing to at least

00:30:11 --> 00:30:15 experiment with a lot of these things

00:30:13 --> 00:30:17 last do we have here we did a whole show

00:30:15 --> 00:30:20 on this async local storage the async

00:30:18 --> 00:30:23 context API is the standard version of

00:30:21 --> 00:30:25 this and the async local storage was the

00:30:23 --> 00:30:27 one that hit node before any of this was

00:30:25 --> 00:30:30 standardized so we do not see it being

00:30:28 --> 00:30:33 added to node just yet but I bet we will

00:30:31 --> 00:30:36 see it soon but what this API allows you

00:30:34 --> 00:30:40 to do is to sort of stick stuff in the

00:30:37 --> 00:30:42 call stack so if you have one function

00:30:40 --> 00:30:44 that calls another function or if you

00:30:42 --> 00:30:46 have middleware where one function runs

00:30:44 --> 00:30:50 and the next one and the next one you

00:30:47 --> 00:30:52 can stick stuff into context or into a

00:30:51 --> 00:30:55 sync local storage bad name has nothing

00:30:53 --> 00:30:57 to do with local storage and then you

00:30:55 --> 00:30:59 can access it anywhere down the call

00:30:57 --> 00:31:01 stack meaning that anywhere within the

00:31:00 --> 00:31:04 request or anywhere within a function

00:31:02 --> 00:31:05 calling another one and that's really

00:31:04 --> 00:31:08 nice because it doesn't it means you

00:31:06 --> 00:31:11 don't have to pass your data into every

00:31:09 --> 00:31:14 single function that you write it's sort

00:31:12 --> 00:31:17 of just available to you and it's scoped

00:31:15 --> 00:31:21 to the the call stack or it's scoped to

00:31:18 --> 00:31:23 the request in in a lot of use cases so

00:31:21 --> 00:31:26 like context for your server yeah it's

00:31:23 --> 00:31:29 it's like context and it's standard

00:31:26 --> 00:31:31 context meaning that if a package wants

00:31:30 --> 00:31:34 to use context and your own code wants

00:31:32 --> 00:31:35 to use context you're not like coming up

00:31:34 --> 00:31:40 with your own version of context and

00:31:36 --> 00:31:42 having to pass the spelt context into

00:31:40 --> 00:31:44 some other weird function that you're

00:31:42 --> 00:31:47 running single file executables I asked

00:31:45 --> 00:31:48 on Twitter like hey what do you want in

00:31:47 --> 00:31:51 note and and someone's like I want

00:31:49 --> 00:31:55 single file executables and we've had

00:31:52 --> 00:31:56 this for maybe about a year now and what

00:31:55 --> 00:31:59 this allows you to do is you can take

00:31:57 --> 00:32:02 the entire node.js runtime and you can

00:31:59 --> 00:32:04 take your entire node.js application and

00:32:02 --> 00:32:07 you take all of your node modules and

00:32:05 --> 00:32:10 bundle it up into a single package that

00:32:08 --> 00:32:13 is a single file and then you can bring

00:32:11 --> 00:32:16 that to different computers and that's

00:32:13 --> 00:32:18 really nice because you don't have to

00:32:16 --> 00:32:20 have people install node.js on their

00:32:18 --> 00:32:23 computer in order to run it and that is

00:32:21 --> 00:32:26 often a case with if you write some

00:32:24 --> 00:32:28 tooling and you need it to run on

00:32:26 --> 00:32:30 somebody's computer locally rather than

00:32:28 --> 00:32:33 on a server remotely you can just give

00:32:31 --> 00:32:36 them this file and it will it will run

00:32:33 --> 00:32:37 it's it contained it is fairly large it

00:32:36 --> 00:32:41 it's up to like 90 Megs but that's not

00:32:38 --> 00:32:42 even touching like electron which is

00:32:41 --> 00:32:45 sort of a lot of the alternative to this

00:32:43 --> 00:32:48 type of thing yeah word cool well let's

00:32:46 --> 00:32:49 get into our wish list here um what are

00:32:48 --> 00:32:51 things that we wanted to see my first

00:32:50 --> 00:32:55 one was glob Imports which we already

00:32:51 --> 00:32:57 have so uh yeah no you you had one that

00:32:55 --> 00:33:01 was um hot reload and how would hot

00:32:58 --> 00:33:03 reload work in this context I don't know

00:33:02 --> 00:33:06 the problem that I've had in the past

00:33:04 --> 00:33:08 with with long running node node

00:33:06 --> 00:33:11 applications is that if you make a

00:33:08 --> 00:33:13 change to the node application what

00:33:11 --> 00:33:15 happens is that the entire application

00:33:14 --> 00:33:18 stops and has to restart itself again it

00:33:16 --> 00:33:20 has to do the database connection and

00:33:18 --> 00:33:24 that type of thing and with hot reload

00:33:21 --> 00:33:27 if you make a change to a function like

00:33:24 --> 00:33:29 let's say you're dealing with a event

00:33:27 --> 00:33:31 hand and somebody visits this URL they

00:33:30 --> 00:33:35 fire an event and you want to reply with

00:33:32 --> 00:33:37 some Json if you change just that code

00:33:35 --> 00:33:39 the whole thing shouldn't have to

00:33:37 --> 00:33:42 restart itself and a lot of Frameworks

00:33:40 --> 00:33:45 are getting better at this so that they

00:33:43 --> 00:33:48 will simply just require they will

00:33:46 --> 00:33:50 dynamically require that function that

00:33:48 --> 00:33:52 needs to happen on a Handler um so that

00:33:50 --> 00:33:53 you don't have to do that restart so

00:33:52 --> 00:33:56 that's that was a big version and then

00:33:54 --> 00:33:59 also like my computer is getting really

00:33:56 --> 00:34:01 fast so not much of an issue but my like

00:34:00 --> 00:34:05 my Express app before I got the MacBook

00:34:02 --> 00:34:07 M1 would take two seconds to like

00:34:06 --> 00:34:10 restart the typescript server and and

00:34:08 --> 00:34:12 wait for the file Watcher to change so

00:34:10 --> 00:34:13 now that a lot of the stuff is built in

00:34:12 --> 00:34:15 we don't have to worry about that time

00:34:14 --> 00:34:18 and my computer is much faster at

00:34:16 --> 00:34:21 restarting so it's not really that much

00:34:19 --> 00:34:24 of an an issue anymore yeah it is funny

00:34:22 --> 00:34:25 how things things change here yeah

00:34:24 --> 00:34:27 another one might have been like a

00:34:25 --> 00:34:29 window shim you know I think that's

00:34:28 --> 00:34:32 interesting because a lot of libraries

00:34:30 --> 00:34:34 they do still use window dot things

00:34:33 --> 00:34:37 which will fail if you try to use it on

00:34:34 --> 00:34:38 node even if the code will work on

00:34:37 --> 00:34:40 desktop or even like let's say you're in

00:34:38 --> 00:34:41 a serers side rendering context and you

00:34:40 --> 00:34:43 want to set something you want to just

00:34:42 --> 00:34:45 use window you always have to check to

00:34:44 --> 00:34:47 make sure you're in the browser a way

00:34:45 --> 00:34:48 that you can get around this today is by

00:34:47 --> 00:34:50 using Global this but you know Global

00:34:49 --> 00:34:52 this is essentially putting something

00:34:51 --> 00:34:57 onto the global namespace which would

00:34:53 --> 00:35:00 include uh what's an window correct uh

00:34:57 --> 00:35:04 yes so Global this is the like spec for

00:35:01 --> 00:35:06 doing things isomorphically meaning that

00:35:04 --> 00:35:08 you write code on the server and on the

00:35:07 --> 00:35:12 thing but like nobody's typing Global

00:35:09 --> 00:35:14 this people are often just typing window

00:35:12 --> 00:35:17 do something and again that's another

00:35:15 --> 00:35:20 paper cut that we hit in noj land that's

00:35:17 --> 00:35:21 not an issue Doo is taking even further

00:35:20 --> 00:35:26 where like they've shimmed

00:35:22 --> 00:35:29 prompt and confirm to show you CLI um

00:35:26 --> 00:35:31 approvals which is kind of nifty yeah

00:35:29 --> 00:35:36 wow another thing I would love is like a

00:35:32 --> 00:35:39 better server so if I'm using bun or

00:35:36 --> 00:35:42 Dino their like default server HTTP

00:35:40 --> 00:35:44 server is is good enough just for a

00:35:42 --> 00:35:46 quick server and I I don't feel that way

00:35:44 --> 00:35:49 about the the built-in HTTP server and

00:35:47 --> 00:35:51 I'll usually go and grab some sort of

00:35:50 --> 00:35:54 lightweight server or even like a Hano

00:35:52 --> 00:35:56 JS to throw that in there so it' be nice

00:35:55 --> 00:35:59 to have that built in and then my last

00:35:56 --> 00:36:03 one here is is like better console log

00:35:59 --> 00:36:05 or better terminal integration because

00:36:04 --> 00:36:09 the console log in the browser is so

00:36:06 --> 00:36:13 good and then a console log in your

00:36:09 --> 00:36:15 terminal sucks and it doesn't show you

00:36:13 --> 00:36:17 where it's being logged from the setup

00:36:15 --> 00:36:20 to get either to get vs code working

00:36:18 --> 00:36:23 with it there's autod detect and vs code

00:36:20 --> 00:36:24 but again it's it's still still kind of

00:36:23 --> 00:36:27 tricky to get up and running and then or

00:36:25 --> 00:36:29 if you want like the Chrome Dev tools

00:36:27 --> 00:36:33 you you have to like set up the D-

00:36:30 --> 00:36:35 inspect or D- debug flag and then when

00:36:33 --> 00:36:37 that restarts the Chrome Dev tools has

00:36:35 --> 00:36:39 to like reconnect to it so there's this

00:36:37 --> 00:36:41 other Chrome extension called Nim node

00:36:40 --> 00:36:43 inspector monitor that has to like watch

00:36:42 --> 00:36:45 for those and it will auto reconnect to

00:36:44 --> 00:36:48 it and it's just like I just want to see

00:36:46 --> 00:36:51 what line something was console loged on

00:36:48 --> 00:36:53 I just want my like console. table works

00:36:52 --> 00:36:56 you know I want like a couple more

00:36:54 --> 00:36:58 things and I think it's a bit of a

00:36:56 --> 00:37:01 limitation of

00:36:58 --> 00:37:05 terminals as well as no JS but I would

00:37:01 --> 00:37:05 love if like warp just took like some of

00:37:05 --> 00:37:09 the I don't even know how this would

00:37:06 --> 00:37:11 work but like warp the terminal take the

00:37:09 --> 00:37:14 Chrome Dev tools or something and just

00:37:11 --> 00:37:16 make it work so that when I do something

00:37:14 --> 00:37:19 in whatever or I can fold a stack trace

00:37:17 --> 00:37:22 or something yeah folding if I have an

00:37:20 --> 00:37:27 object I shouldn't have to use console.

00:37:23 --> 00:37:29 dur dep or Jon stringify yeah yeah I

00:37:27 --> 00:37:31 should have to use that to like see an

00:37:29 --> 00:37:33 object more than four levels deep and

00:37:32 --> 00:37:35 again I realize there are lots of

00:37:34 --> 00:37:39 debugging tools out there but they all

00:37:36 --> 00:37:40 require too much setup and in larger

00:37:39 --> 00:37:43 projects it's worth it for me but as

00:37:41 --> 00:37:46 somebody who is slinging brand new

00:37:44 --> 00:37:48 projects several times a day so that I

00:37:46 --> 00:37:50 can talk talk to you guys about it it's

00:37:49 --> 00:37:53 it's too tricky yeah yeah I agree you

00:37:51 --> 00:37:55 know specifically that object thing that

00:37:53 --> 00:37:57 always bugs the life out of me when I'm

00:37:55 --> 00:37:58 conseling like I'll just like quick log

00:37:57 --> 00:38:00 something out and it's just like object

00:37:59 --> 00:38:03 I'm like okay great thank you uh for

00:38:01 --> 00:38:04 logging and telling me it's an object

00:38:03 --> 00:38:08 you know one thing that I I I really

00:38:05 --> 00:38:11 appreciate about the new spelt 5 is that

00:38:08 --> 00:38:13 they have a better console log which is

00:38:11 --> 00:38:15 called inspect and it's like a rune that

00:38:13 --> 00:38:18 you just do inspect I I don't like that

00:38:16 --> 00:38:20 I have to memorize or not memorize type

00:38:18 --> 00:38:21 something new that's not console log and

00:38:20 --> 00:38:25 have my muscle memory but what's cool

00:38:22 --> 00:38:27 about inspect is that it watches values

00:38:26 --> 00:38:29 anytime that value change

00:38:27 --> 00:38:30 it'll say all right this is the value

00:38:29 --> 00:38:32 init and then if that value changes

00:38:31 --> 00:38:36 it'll say update and have that like it's

00:38:33 --> 00:38:38 just a more full featured logging system

00:38:36 --> 00:38:40 for what's going on not that I want that

00:38:38 --> 00:38:42 in node specifically but I do think

00:38:41 --> 00:38:45 there is some maybe out of the box

00:38:43 --> 00:38:47 thinking that could happen to make the

00:38:45 --> 00:38:49 node console experience better too uh

00:38:47 --> 00:38:51 give us better debugging on that same

00:38:49 --> 00:38:54 point I forgot this one is node rolled

00:38:52 --> 00:38:58 out utils colon style text everybody

00:38:55 --> 00:39:01 uses node colors to like

00:38:59 --> 00:39:06 yeah or chalk so now you can use the

00:39:02 --> 00:39:07 node style text API to change the colors

00:39:06 --> 00:39:11 but I think it's a bit of a Miss because

00:39:08 --> 00:39:13 it's not it's so much more verbose like

00:39:12 --> 00:39:16 chalk is a better way better API like

00:39:14 --> 00:39:18 why didn't you just copy the chalk API

00:39:16 --> 00:39:20 and then also like why don't you just

00:39:18 --> 00:39:23 copy the browser API which is you can

00:39:21 --> 00:39:26 pass it CSS yeah and it will console log

00:39:24 --> 00:39:29 it with CSS and Dino does that you can

00:39:26 --> 00:39:31 pass it present C fetching data and then

00:39:30 --> 00:39:34 in the second argument of console log

00:39:32 --> 00:39:37 you can you can say background color red

00:39:34 --> 00:39:39 text white or sorry color white I don't

00:39:37 --> 00:39:42 know how to do CSS and it will match it

00:39:40 --> 00:39:43 as close as it possibly can to what's

00:39:42 --> 00:39:45 called antsy colors those are those are

00:39:43 --> 00:39:46 the colors available to you in the

00:39:45 --> 00:39:49 terminal and it will log it out for you

00:39:47 --> 00:39:50 so like just give us that you know if

00:39:49 --> 00:39:53 we're we're trying to web standards this

00:39:51 --> 00:39:57 whole thing just let me use CSS to to do

00:39:54 --> 00:40:00 it and like couldn't warp pick up a

00:39:57 --> 00:40:03 custom CSS color and display that to me

00:40:00 --> 00:40:05 we should go past ansy yeah yeah I just

00:40:03 --> 00:40:07 mad now I know I don't know if warp will

00:40:05 --> 00:40:09 ever get into that which's funny is that

00:40:08 --> 00:40:11 like warp is I don't want to say

00:40:10 --> 00:40:14 controversial but maybe you know anytime

00:40:12 --> 00:40:17 you bring up warp in general people get

00:40:14 --> 00:40:19 like not not real terminal even though

00:40:17 --> 00:40:22 it's like you have to log in you got to

00:40:19 --> 00:40:24 log into to your terminal I don't care I

00:40:22 --> 00:40:26 log into everything yeah and I

00:40:25 --> 00:40:28 understand why that they're doing that

00:40:27 --> 00:40:32 it's because they want to sell

00:40:28 --> 00:40:33 you team features uh they want to you

00:40:32 --> 00:40:36 five bucks a month per user and that's

00:40:34 --> 00:40:38 every single startup right now wants to

00:40:36 --> 00:40:40 do that so by aggressively putting you

00:40:38 --> 00:40:42 into an account even though I use zero

00:40:41 --> 00:40:45 of the account features but for me I

00:40:43 --> 00:40:47 don't care because it's worth it to me

00:40:45 --> 00:40:50 warp is so good so yeah number one warp

00:40:48 --> 00:40:52 feature to me being able to select text

00:40:51 --> 00:40:55 and delete it or click and you know use

00:40:53 --> 00:40:58 it use my text editor or use my uh

00:40:56 --> 00:41:02 prompt as like an action ual text input

00:40:59 --> 00:41:05 rather than just this archaic command a

00:41:02 --> 00:41:08 command K all this like yes let me think

00:41:05 --> 00:41:09 click on things for sure I I don't know

00:41:08 --> 00:41:10 you know if that's something that normal

00:41:09 --> 00:41:12 people care about but there's there's a

00:41:11 --> 00:41:15 handful of times where like you know you

00:41:13 --> 00:41:17 mess up a script ever so slightly and

00:41:15 --> 00:41:19 it's a long ass uh thing that you've

00:41:17 --> 00:41:21 just typed in and now I can just select

00:41:19 --> 00:41:23 where I want my mouse cursor to go and

00:41:21 --> 00:41:25 fix or you know group select or whatever

00:41:24 --> 00:41:29 so yeah work for me pretty dope all

00:41:26 --> 00:41:31 right let's move into some oh hold on

00:41:29 --> 00:41:34 actually um I asked on Twitter what

00:41:32 --> 00:41:37 people wanted let's rattle through good

00:41:35 --> 00:41:40 ones all right I asked on Twitter what's

00:41:38 --> 00:41:41 your njs wish list right now and it's

00:41:40 --> 00:41:43 kind of interesting to see what people

00:41:41 --> 00:41:46 say someone said a cheap C panel hosting

00:41:44 --> 00:41:49 kify definitely saving us from that I

00:41:47 --> 00:41:53 should tell you my like blue host

00:41:50 --> 00:41:55 hosting which I hate but I've had it for

00:41:53 --> 00:41:57 probably 15 years and there's like I've

00:41:56 --> 00:41:59 got my wife's website on on it my dad

00:41:57 --> 00:42:01 host a couple website on it I've always

00:41:59 --> 00:42:03 like been like you're allowed to host as

00:42:01 --> 00:42:04 many WordPress websites on there as

00:42:03 --> 00:42:06 possible and I the other day I got to

00:42:05 --> 00:42:09 email from them being like you're over

00:42:07 --> 00:42:13 your hosting limit for gigabytes and I

00:42:09 --> 00:42:14 was like over 15 gigs of of space and

00:42:13 --> 00:42:16 they're like you'll be automatically

00:42:14 --> 00:42:18 upgraded to our next tier I like oh no

00:42:17 --> 00:42:21 like they're squeezing us they're the

00:42:19 --> 00:42:23 last one to squeeze us realizing that

00:42:21 --> 00:42:26 selling somebody a server that you can

00:42:23 --> 00:42:28 run unlimited websites on is probably

00:42:27 --> 00:42:30 not getting as much money as you could

00:42:29 --> 00:42:33 if you charge five bucks a user per

00:42:31 --> 00:42:36 website per user per month per week per

00:42:33 --> 00:42:38 dog so gulfy save us is saving us from

00:42:36 --> 00:42:40 that type of thing uh bundle to ship

00:42:38 --> 00:42:42 executables you can do it this is a

00:42:40 --> 00:42:43 tweet that I did over a year ago and

00:42:43 --> 00:42:48 this might

00:42:44 --> 00:42:51 be besides my sock tweet my most viral

00:42:48 --> 00:42:53 tweet ever because crazy people lost

00:42:51 --> 00:42:56 their minds because it was 85 Megs as a

00:42:54 --> 00:42:59 hello world but even like a go hello

00:42:57 --> 00:43:01 World it by the way it's smaller now you

00:42:59 --> 00:43:03 can get it down quite a bit especially

00:43:01 --> 00:43:04 if you take out all the inl stuff so

00:43:03 --> 00:43:07 that if you're not doing International

00:43:05 --> 00:43:10 translation for Arabic you can take out

00:43:08 --> 00:43:12 that stuff and it will get much smaller

00:43:10 --> 00:43:14 but the reason it's so big is because

00:43:12 --> 00:43:17 you need the JavaScript runtime to run

00:43:15 --> 00:43:19 JavaScript it's not being compiled into

00:43:17 --> 00:43:22 machine code um so you still need that

00:43:20 --> 00:43:25 anyways TS support incoming is good

00:43:23 --> 00:43:29 people are happy affordable housing

00:43:25 --> 00:43:32 market uh of es decorators that is

00:43:29 --> 00:43:34 something coming to the import we talked

00:43:32 --> 00:43:38 about this a while ago a couple episodes

00:43:35 --> 00:43:42 ago on import something as text or

00:43:39 --> 00:43:44 import something as CSS so that's kind

00:43:42 --> 00:43:47 of cool I don't think that that is been

00:43:45 --> 00:43:49 specked out yet though is that finished

00:43:47 --> 00:43:52 so like it's not going to land in note

00:43:49 --> 00:43:54 until it hits the JavaScript language uh

00:43:53 --> 00:43:57 mature deao web framework that fills the

00:43:55 --> 00:43:59 rails void all right so like this is not

00:43:57 --> 00:44:02 node itself but like this kind of the

00:43:59 --> 00:44:05 community right somebody wants a laravel

00:44:03 --> 00:44:06 or rails of JavaScript what else we got

00:44:05 --> 00:44:10 in here

00:44:06 --> 00:44:12 pipes this would be amazing so pipes are

00:44:10 --> 00:44:14 being added or being talked about being

00:44:12 --> 00:44:16 added to JavaScript for many many years

00:44:15 --> 00:44:18 and that would allow it's not part of

00:44:16 --> 00:44:20 the JavaScript yet so it will not be

00:44:18 --> 00:44:22 part of node but it's kind of cool

00:44:21 --> 00:44:25 because you'll be able to do things like

00:44:23 --> 00:44:27 like you know when you chain a map

00:44:25 --> 00:44:29 filter reduce and then you want to pass

00:44:27 --> 00:44:31 that output to something you have to

00:44:29 --> 00:44:34 wrap the whole thing in like a console

00:44:32 --> 00:44:37 log or in a display text piping you to

00:44:35 --> 00:44:39 just continue to pipe sorry I'm

00:44:37 --> 00:44:41 wondering if Dax is talking about like

00:44:39 --> 00:44:45 go Lang style pipes or if he's talking

00:44:42 --> 00:44:48 about what's goang style goang pipes

00:44:46 --> 00:44:51 it's basically you're you're streaming

00:44:49 --> 00:44:52 data from one spot to another you're

00:44:51 --> 00:44:55 you're you pass something into a pipe

00:44:53 --> 00:44:59 and it goes in that pipe we have stream

00:44:56 --> 00:45:01 that's isn't that streams though like I

00:44:59 --> 00:45:02 think there's I I'm not going to speak

00:45:01 --> 00:45:04 on that because there's subtleties here

00:45:03 --> 00:45:09 that I'm not aware of but I know people

00:45:05 --> 00:45:11 who use go really like pipe in go oh but

00:45:10 --> 00:45:12 I don't know if that's what he's even

00:45:11 --> 00:45:14 talking about so I don't want to put

00:45:12 --> 00:45:16 words in dax's mouth but when I first

00:45:15 --> 00:45:19 read pipes I that's what I thought he

00:45:17 --> 00:45:23 was talking about NVM out of the box so

00:45:20 --> 00:45:25 that's versioning your node

00:45:23 --> 00:45:27 version I don't think they'll ever do

00:45:25 --> 00:45:30 that because that's so specific

00:45:27 --> 00:45:32 yeah they even on the um official node

00:45:30 --> 00:45:36 install page they suggest using NVM

00:45:33 --> 00:45:37 directly so oh yeah I still use N I

00:45:36 --> 00:45:39 don't use anything I just install one

00:45:38 --> 00:45:42 version globally for my whole machine

00:45:40 --> 00:45:45 and abandon old projects because they

00:45:42 --> 00:45:47 might not man I I use n a lot because

00:45:45 --> 00:45:49 like for example the typescript support

00:45:48 --> 00:45:52 dropped the other day and I quickly just

00:45:50 --> 00:45:54 did n nightly and it installed the

00:45:53 --> 00:45:58 nightly version I was able to show the

00:45:55 --> 00:46:00 typescript code running in node in in

00:45:58 --> 00:46:02 the video right away without having to

00:46:00 --> 00:46:04 like override my Global node version

00:46:03 --> 00:46:07 remove it from existence esm only

00:46:05 --> 00:46:09 honestly I think we should do this just

00:46:07 --> 00:46:11 yeah me too yeah although I don't know I

00:46:10 --> 00:46:13 know that's a that's a controversial

00:46:12 --> 00:46:15 opinion of mine yeah just I think people

00:46:14 --> 00:46:17 people say this but then they don't

00:46:15 --> 00:46:20 realize that like their nextjs is still

00:46:18 --> 00:46:24 running in in commonjs you know yeah you

00:46:21 --> 00:46:26 you author your esm but it's you got a

00:46:24 --> 00:46:29 lot of bundling under the hood and like

00:46:26 --> 00:46:31 yeah everything is supported on this one

00:46:30 --> 00:46:33 node package that hasn't been updated in

00:46:31 --> 00:46:35 12 years and

00:46:33 --> 00:46:38 it's it would totally crumble

00:46:36 --> 00:46:40 realistically that's tougher than

00:46:38 --> 00:46:43 theoretically totally yeah it's it's an

00:46:41 --> 00:46:45 ideal but that's it node is doing super

00:46:44 --> 00:46:48 well right now couldn't be more excited

00:46:46 --> 00:46:52 for the sort of JavaScript server side

00:46:49 --> 00:46:56 space in general but let's get into some

00:46:52 --> 00:46:59 sick picks yeah I got a sick pick so we

00:46:56 --> 00:47:03 had a guest on Anna paetz from one

00:47:00 --> 00:47:07 password and she sip picked a board game

00:47:04 --> 00:47:09 which was Cascadia no I'm our family

00:47:07 --> 00:47:11 isn't like you know there's like board

00:47:10 --> 00:47:14 game people who are like really into

00:47:12 --> 00:47:17 Niche board games oh yeah that's my wife

00:47:14 --> 00:47:20 she loves games and I I couldn't okay I

00:47:18 --> 00:47:22 I hate it so much games when we went to

00:47:20 --> 00:47:24 the Sentry office Sentry made like a

00:47:23 --> 00:47:26 card game and I was like I was like just

00:47:25 --> 00:47:28 so you know I hate games but I'll still

00:47:27 --> 00:47:31 win and I

00:47:28 --> 00:47:31 won yeah and that made me really mad

00:47:31 --> 00:47:33 because the whole time you're like I

00:47:32 --> 00:47:34 don't like this and then you were

00:47:33 --> 00:47:37 winning you're just like okay let's cram

00:47:35 --> 00:47:40 in here I like games I'm a I'm a game

00:47:37 --> 00:47:42 guy but I'm not like a a niche game guy

00:47:40 --> 00:47:45 but I took a chance on the Cascadia

00:47:43 --> 00:47:46 which is a game that Anna recommended

00:47:45 --> 00:47:47 because it sounded like something my

00:47:47 --> 00:47:50 kids might like and at first it was like

00:47:48 --> 00:47:51 all right I think the intended age might

00:47:50 --> 00:47:53 might have been like eight and up or

00:47:52 --> 00:47:55 something like that so it you know our

00:47:53 --> 00:47:57 kids being five and seven didn't really

00:47:55 --> 00:47:59 fit but I went for it anyway anyways and

00:47:57 --> 00:48:00 our kids really picked it up it's about

00:48:00 --> 00:48:03 like you're building kind of like

00:48:01 --> 00:48:05 wildlife habitats where you get

00:48:03 --> 00:48:08 combinations of squares for maybe this

00:48:06 --> 00:48:10 is a specific environment and the eagle

00:48:08 --> 00:48:12 can live in here and you're building all

00:48:10 --> 00:48:14 these patterns so like an eagle can't be

00:48:12 --> 00:48:15 next to another eagle and if you have

00:48:14 --> 00:48:17 two Eagles you get eight points or

00:48:15 --> 00:48:17 whatever and at the end of the thing you

00:48:17 --> 00:48:20 you tally up your points so you each

00:48:18 --> 00:48:24 have your own little environment that

00:48:21 --> 00:48:26 you're building and our kids have picked

00:48:25 --> 00:48:29 it up really really well to the point

00:48:27 --> 00:48:31 where they're having a chance at

00:48:29 --> 00:48:34 actually beating Courtney and I at this

00:48:31 --> 00:48:36 game even though it it's rules wise it

00:48:34 --> 00:48:39 wasn't that simple they just like the

00:48:36 --> 00:48:41 idea of like it's animals oh I want to

00:48:39 --> 00:48:43 build a a a row of salmon here because

00:48:41 --> 00:48:44 they're pink okay and that you know got

00:48:43 --> 00:48:46 my daughter a lot of points or I want I

00:48:45 --> 00:48:49 want this Eagle so bad all right where

00:48:47 --> 00:48:51 do I put the eagle I put it here and

00:48:49 --> 00:48:55 gosh it was just a really great kind of

00:48:52 --> 00:48:58 calming relaxing game that still

00:48:55 --> 00:48:59 involves like person competition so when

00:48:58 --> 00:49:02 we're all like trying our own strategies

00:49:00 --> 00:49:04 and trying to win it it was just a lot

00:49:02 --> 00:49:06 of fun so if you're into board games and

00:49:05 --> 00:49:08 haven't checked out Cascadia give it a

00:49:07 --> 00:49:09 try I thought it was really great or if

00:49:08 --> 00:49:11 you're just looking for something that

00:49:10 --> 00:49:15 is fun for the whole family yeah I found

00:49:12 --> 00:49:17 this to be really great oh that that

00:49:15 --> 00:49:20 seems like something I would fake in

00:49:17 --> 00:49:22 injury to try to get out of we we ended

00:49:20 --> 00:49:24 up buying it for her sister-in-law my

00:49:22 --> 00:49:26 sister-in-law um and my family really

00:49:24 --> 00:49:29 liked it too so kill me kill me that

00:49:27 --> 00:49:31 sounds awful anyways

00:49:30 --> 00:49:36 um I'm sure it's fun maybe I should give

00:49:32 --> 00:49:39 it another try I'm going to sipi a robor

00:49:36 --> 00:49:42 rock vacuum again so we probably about a

00:49:39 --> 00:49:47 year ago I se picked the robor rock S8

00:49:43 --> 00:49:51 Pro Ultra which is the like Cadillac of

00:49:48 --> 00:49:54 vacuums and it has improved our life so

00:49:51 --> 00:49:56 much because the amount of time saved

00:49:55 --> 00:49:59 like I I I think we have like 4 100

00:49:57 --> 00:50:02 hours on it and if you think if you were

00:49:59 --> 00:50:04 to even spend like a tenth of those

00:50:03 --> 00:50:07 hours yourself vacuuming that's quite a

00:50:05 --> 00:50:09 bit of time that that you save and it

00:50:07 --> 00:50:12 it's been such a GameChanger in our

00:50:10 --> 00:50:13 house it's expensive but it's been such

00:50:12 --> 00:50:15 a game changer in our house for just

00:50:14 --> 00:50:17 always having super clean floors and

00:50:16 --> 00:50:20 also not getting stressed out when the

00:50:18 --> 00:50:22 kids drop something on the ground or

00:50:20 --> 00:50:25 they spill something it's not a big deal

00:50:22 --> 00:50:26 because the little be bbot will come and

00:50:25 --> 00:50:28 suck it on up so

00:50:27 --> 00:50:32 we've had that one for maybe a year year

00:50:29 --> 00:50:34 and a half and we've been loving it and

00:50:32 --> 00:50:35 I was doing the like YouTube thing

00:50:34 --> 00:50:36 because we wanted to get one for the

00:50:35 --> 00:50:38 cottage but I was like there's no chance

00:50:37 --> 00:50:41 for spending I think it's like 1,800

00:50:39 --> 00:50:44 bucks Canadian there is another one

00:50:42 --> 00:50:48 called The robor Rock Q Revo and this

00:50:45 --> 00:50:51 one does all the things that the Pro

00:50:48 --> 00:50:54 Ultra does meaning it mops it vacuums it

00:50:51 --> 00:50:56 has a freshwater tank and a like a dirty

00:50:54 --> 00:50:57 tank and it and it has bags meaning that

00:50:56 --> 00:50:59 like you you have to just change the bag

00:50:58 --> 00:51:01 once a month you got to change the the

00:51:00 --> 00:51:04 water maybe once a week or so depending

00:51:02 --> 00:51:07 on how much you use it and this one's

00:51:04 --> 00:51:08 like a thousand bucks less and I was

00:51:07 --> 00:51:10 like okay and a lot of people are saying

00:51:08 --> 00:51:13 it's just as good as of mopping and

00:51:11 --> 00:51:16 vacuuming it just doesn't have some of

00:51:13 --> 00:51:17 the liar in it that does the sensing and

00:51:16 --> 00:51:20 I'll tell you right now the the

00:51:18 --> 00:51:22 expensive one sensing is not very good

00:51:21 --> 00:51:24 it still sucks up our cords you still

00:51:23 --> 00:51:26 got to run around and make sure there's

00:51:24 --> 00:51:28 not a not a cord on the ground because

00:51:26 --> 00:51:32 it will suck it right up so we got the

00:51:29 --> 00:51:34 qevo and it's just as good it's

00:51:33 --> 00:51:37 94% as good I feel like it sucks up the

00:51:35 --> 00:51:38 chords a little bit more than the other

00:51:37 --> 00:51:41 one the other one every now and then one

00:51:38 --> 00:51:42 in 10 times it will like be like oh I

00:51:41 --> 00:51:45 shouldn't suck up a cord and it will

00:51:43 --> 00:51:47 it'll turn away this one 100% of the

00:51:45 --> 00:51:48 time it will suck up a cord but if you

00:51:47 --> 00:51:52 keep the cords off the ground this thing

00:51:49 --> 00:51:54 is amazing and for a thousand bucks less

00:51:52 --> 00:51:57 I would probably recommend you don't

00:51:54 --> 00:51:58 upgrade to to the one it's even the the

00:51:57 --> 00:52:01 tank is bigger the fresh water tank is

00:51:59 --> 00:52:04 bigger so I wish might had a water tank

00:52:01 --> 00:52:08 I have the robo Rock 6 maybe I got

00:52:05 --> 00:52:11 Costco special yeah a few years ago and

00:52:09 --> 00:52:13 I love it the only downside of it is

00:52:11 --> 00:52:14 that it does not have a water tank so

00:52:13 --> 00:52:18 I'm like constantly having to fill up

00:52:15 --> 00:52:21 the water like almost every day yeah you

00:52:18 --> 00:52:22 just like maybe once a week once every

00:52:21 --> 00:52:25 depends on how often we run ours

00:52:23 --> 00:52:28 probably two or three times a day uh run

00:52:25 --> 00:52:29 it after breakfast and we run it just

00:52:28 --> 00:52:32 IDE after dinner and then often we'll do

00:52:30 --> 00:52:35 it I'll bring it down to my office so

00:52:32 --> 00:52:39 what you need to do Scott is bring it to

00:52:35 --> 00:52:41 your office yes I even put it in the gym

00:52:39 --> 00:52:44 the we've got these like um like rubber

00:52:41 --> 00:52:46 mats in the gym yeah and it it just does

00:52:44 --> 00:52:48 such a perfect job at scrubbing the mats

00:52:46 --> 00:52:51 and making everything feel good so I

00:52:48 --> 00:52:52 still need to get some mats for my gym

00:52:52 --> 00:52:56 because we're just rocking on carpet

00:52:53 --> 00:52:58 right now if if I felt like throwing

00:52:56 --> 00:53:00 away money I would get a second one but

00:52:58 --> 00:53:03 mine is like too functional and too good

00:53:01 --> 00:53:06 to justify it but yeah you know I I do

00:53:04 --> 00:53:08 the thing I love the most about the robo

00:53:06 --> 00:53:11 Rock system or even having that little

00:53:09 --> 00:53:13 mop dragging arm or whatever like for me

00:53:11 --> 00:53:14 it's just like a little mop pad that you

00:53:13 --> 00:53:16 have a little water tank and whatever it

00:53:14 --> 00:53:19 drags behind it the thing that it does

00:53:16 --> 00:53:21 the best for me is like kitchen sticky

00:53:19 --> 00:53:22 spots or whatever you know with kids

00:53:22 --> 00:53:27 stuff is ending up on the floor all the

00:53:23 --> 00:53:28 time and if the robot is not running for

00:53:27 --> 00:53:30 like a week because maybe it sucked up

00:53:29 --> 00:53:33 something and I haven't done maintenance

00:53:30 --> 00:53:35 on it then I noticed very clearly the

00:53:33 --> 00:53:36 kitchen floor is getting worse and worse

00:53:35 --> 00:53:38 all the time but then when it runs it's

00:53:37 --> 00:53:40 like you don't even notice it it's like

00:53:39 --> 00:53:42 wow these these floors are actually feel

00:53:40 --> 00:53:43 clean you wouldn't think that a little

00:53:42 --> 00:53:46 tiny mop dragger would work that well

00:53:44 --> 00:53:50 but it works really pretty well yeah

00:53:46 --> 00:53:52 yeah the the Pro Ultra has it vibrates

00:53:50 --> 00:53:56 it goes and oh the Pro Ultra also has

00:53:53 --> 00:53:58 two vacuum head Spinners and the C Revo

00:53:56 --> 00:54:00 has one again I haven't noticed a

00:53:58 --> 00:54:04 difference and our kids are very messy

00:54:01 --> 00:54:06 but the the qevo has spinning mop pads

00:54:04 --> 00:54:08 like it spins in circles two of them and

00:54:07 --> 00:54:11 I I feel like that's better because it's

00:54:09 --> 00:54:14 it's constantly actually moving over it

00:54:11 --> 00:54:15 and like also has like a pin feature so

00:54:14 --> 00:54:19 like if the kids drip like a or if I

00:54:16 --> 00:54:22 drip coffee I've done it too you can

00:54:19 --> 00:54:25 just open the app and pin it on the map

00:54:22 --> 00:54:26 and it will just run over there it'll do

00:54:25 --> 00:54:28 like a meter square and then

00:54:27 --> 00:54:30 back and clean itself oh that's cool we

00:54:29 --> 00:54:32 just have room I don't have like ability

00:54:30 --> 00:54:34 to pin I can just say hey go do this

00:54:32 --> 00:54:38 room real quick that's Tech the problem

00:54:35 --> 00:54:41 with tech is that I don't want my vacuum

00:54:38 --> 00:54:44 to go out of date you know my vacuum is

00:54:42 --> 00:54:47 G I don't want my car depreciate I don't

00:54:45 --> 00:54:49 want to know about any new cars anymore

00:54:47 --> 00:54:51 I have my new one I don't want to hear

00:54:50 --> 00:54:53 about any features on new ones I don't

00:54:52 --> 00:54:56 care I don't want to have to have the

00:54:53 --> 00:54:58 iPhone effect on everything in my life

00:54:56 --> 00:55:00 yeah I know that is it right all right

00:54:59 --> 00:55:03 well uh Shameless plugs check us out on

00:55:00 --> 00:55:06 YouTube syntax syntax FM on YouTube

00:55:03 --> 00:55:07 youtube.com syntax FM we post all these

00:55:06 --> 00:55:09 episodes on YouTube and sometimes we

00:55:08 --> 00:55:11 show code and uh we do a lot of fun

00:55:10 --> 00:55:13 stuff over there not only that but we

00:55:12 --> 00:55:16 are cooking up a ton of additional stuff

00:55:14 --> 00:55:17 over there CJ just released a video at

00:55:16 --> 00:55:19 the day of recording this on tree

00:55:17 --> 00:55:20 shaking so it's been really really

00:55:20 --> 00:55:23 pretty awesome I've been doing some

00:55:21 --> 00:55:24 videos on local first and we have just a

00:55:23 --> 00:55:26 ton of stuff coming down the line so

00:55:25 --> 00:55:28 follow us on YouTube If you like uh our

00:55:27 --> 00:55:30 voices and you like the way we describe

00:55:29 --> 00:55:32 things we'll give you that much more of

00:55:30 --> 00:55:37 it so check it out awesome all right

00:55:32 --> 00:55:37 thanks everybody tuning in peace peace

comments

  • @karlstenator: I'm a big fan of node SQLite, Environment and Watch. Approaching node is so much easier now for new comers with these features.

  • @cg219: Scott you're talking about Channels (Go Pipe in the Podcast). Its a concurrency primative. It would be more similar to streams in JS but 100x better. (like by 1 other users)

  • @robertbaindourov134: Great talk. Exciting to see this thing get patched together into a RAD system for embedded systems, with Typescript support! :)

  • @erikslorenz: Vitest has better assertions and such but node test is really quite good and just having no extra dependency is awesome. Plus it’s lightning fast. I don’t use many mocks but spies seem to work fine for me for the occasional use case. Yah no need for anything else except mock service worker for http testing (like by 1 other users)

  • @JTWebMan: Now we just need sqlite in browsers. I hate that it is not there as a feature. I know there are option to get it their but I never understood why browsers decided to not add it.

  • @robertbaindourov134: I just save the file as .mjs extension and it allows ESM import statements vs require statements.

  • @smallmountain0705: One annoying thing about the way they have implemented the .env support as a node.js command line option: What if you need to call something else that invokes node.js, but you need your .env to be loaded? We use sequelize, for which we have to run migrations using the sequelize CLI. Somewhere deep inside of the sequelize CLI, they invoke node.js on our migration configuration .js file. With dotenv middleware, we can load our environment within that config file. But we have no way to tell the sequelize CLI, "Hey, when you launch node.js on our migration config js file, please pass in this command line option to node.js so that our environment file gets loaded!". So this has blocked us from adopting native .env file handling. There needs to be a mechanism within your JS code to load your environment, not just a command line option. And, no, NODE_OPTIONS will not work either. That's just another environment variable we have to find a way to guarantee has been set.

  • @Stoney_Eagle: Ahhhwww but I like being next to other eagles 😢 hehe

{
"url": "https://www.youtube.com/v/8oU_TTbG-O8",
"type": "youtube",
"title": "NodeJS Evolves",
"subtitle": "Syntax\nDuration: 00:55:46\nPublished: 2024-08-21",
"description": "In this episode of Syntax, Wes and Scott talk about the latest features in Node.js, including native support for TypeScript, .env parsing, a built-in test runner, watch mode, SQLite integration, glob support, and top-level await. They also discuss some wishlist items, and experimental features like WebSocket support and the require module.\n\nShow Notes\n\n(00:00) Welcome to Syntax!\n(01:13) Brought to you by Sentry.io\n(01:37) Node.js new features\n(02:51) TypeScript\n(10:03) SQLite v22.5\n(14:35) .env support\n(16:24) Test runner\n(19:42) Watch Mode\n(21:22) Glob support\n(22:48) Top-Level Await\n(26:40) Experimental require module\n(29:39) Experimental WebSocket support\n(30:13) Async local storage\n(31:43) Single file executables\n(32:46) Wishlist\n * (32:54) Hot reload\n * (34:20) Window shim\n * (35:30) Better server\n * (35:56) Better terminal integration\n(41:36) Twitter responses\n(46:54) Sick Picks\n(54:56) Shameless Plugs\n\nAll links available at https://syntax.fm/811\n\n------------------------------------------------------------------------------\nHit us up on Socials!\n\nScott: https://twitter.com/stolinski\nWes: https://twitter.com/wesbos\nRandy: https://www.youtube.com/@randyrektor\nSyntax: https://twitter.com/syntaxfm\n\nhttp://www.syntax.fm\n\nBrought to you by Sentry.io\n\n#webdevelopment #webdeveloper #javascript",
"thumbnail": "https://i.ytimg.com/vi/8oU_TTbG-O8/sddefault.jpg"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment