over 4 years ago Syntax Podcast
Potluck - enums, WASM, Lighthouse, Redirects
- 02:33 Google Chrome measuring user experience beyond page load
- 03:13 Lighthouse scores useful but don't blindly follow
- 04:13 Figma uses Rust via WebAssembly for performance
- 05:03 Tools over rules for performance metrics
- 08:16 Naming functions vs boolean variables
- 10:20 Enums vs string unions in TypeScript
- 13:19 Enums useful for populating dropdowns
- 14:03 WebAssembly allows other languages in browser
- 15:13 Figma uses C++ via WebAssembly
- 24:27 GraphQL allows batching requests
- 25:21 Throttling/debouncing requests
- 34:51 302 redirects change POST to GET
- 35:04 307 redirects maintain verb
- 35:18 301 redirects are permanent
- 42:52 Conventional commits for organized messages
- 50:34 REST most popular web data transfer
- 51:25 GraphQL describes data needs in requests
- 51:48 RPC/gRPC good for low power situations
WebAssembly allows other languages in browser
Wes Bos
They run it rid. If you accidentally set a permanent redirect,
Wes Bos
rid in WebAssembly and they use JavaScript to actually interface with it. And another example is we had, like one thing that one of our sponsors does, Sentry, And, in almost every case, I was just like, well, Because of Wasm,
Wes Bos
They you think, oh, it's written in JavaScript and CSS, and it's amazing.
Wes Bos
in
Wes Bos
is that Figma, Next question we have here from Andrew.
Wes Bos
you know, Figma, the
Wes Bos
Most of the, like, heavy lifting of Figma is written in c plus plus. Mhmm. And then they use JavaScript.
Wes Bos
other languages, whatever language is equivalent of an object is. It's all interesting. Yeah. It's very interesting. Alright. I think that is it for the questions. Thank you for submitting them. Please keep them coming because, we love doing it. Go to syntax.fm.
Wes Bos
where you're able to run literally any language you want, Rust, c plus plus,
Wes Bos
Node. Js in a container with WebAssembly.
Wes Bos
to run
Wes Bos
So, like, you can kind of think, like, okay,
Wes Bos
the browser
Figma uses C++ via WebAssembly
Scott Tolinski
plus plus or whatever people are using.
Scott Tolinski
I had 1 laptop, and if that thing went down or went away, I would have nothing to get my work done on, so I bought it a a cheaper
Wes Bos
you have to send off, I don't know, 6 or 7 requests to an API for a whole bunch of stuff. How do you batch those together? Rid So there's a there's a couple, like, different ways you can sort of look at this is I've got to make 7 requests right now. How do I do that? Well, if the API doesn't support batching, in. You are kinda out of luck.
Wes Bos
but they also have stacks. So if you wanna get, rid.
Scott Tolinski
and it's
Scott Tolinski
you know what? There's a lot of upsides to Linux, but there Has been a lot of trouble. And
Scott Tolinski
you know what? They're not going to be things that you really need to worry about. And oftentimes, what we're seeing with many of these things is that the tooling or the people who write this stuff,
Wes Bos
a whole bunch of stuff rid To run your server, so they have all of the popular control panels out there. So you want cpanel or Plesk,
Scott Tolinski
Just hit me up on on Twitter. We can work out a price or something for it. It's in perfect condition. I just hardly ever use it. So, that's where it's at. Backup machine got up to be a backup machine,
Wes Bos
You have a MongoDB, own browser. Maybe they have an extension that's blocking it or something like that. I had somebody the other day. We were trying to debug it, and it turns there was no sound. And, picture in picture the folks from like, runs it for however long, which is rid. Security issue in itself, I guess, but they were on, like, 20 versions behind to I'm just I just searched Figma Rust. It says, we wrote our multiplayer server in Rust and saw a dramatic server side performance improvements.
Wes Bos
syntax. That's gonna get you double the free usage tier.
Scott Tolinski
So, yeah, it's okay.
Scott Tolinski
Probably PHP. By the way, Figma is also using Rust for quite a bit of stuff too. Oh, via via, WebAssembly, I'm assuming? I I don't I'm not entirely positive, but, yeah, they have some really interesting blog posts about their usage of Rust and why they rid. You gotta get them on the show. I think that would be such an interesting show is asking them, like, how do you
Scott Tolinski
Honestly, now that, I've gotten this new computer and my wife has now gotten my 6 my other MacBook Pro,
Wes Bos
rid. Other languages are very good at doing data processing and doing it very quickly. So often, that's why people will reach for their languages to do that.
Scott Tolinski
I had 1 laptop in the house and 1 laptop only. My wife did not have a computer. She didn't have a laptop.
Wes Bos
how do you actually write c plus plus. And then You know what, Wes? I did do,
Scott Tolinski
It is not Mac OS. I I will tell you that. It's it's not
Wes Bos
I guess you could run Node. Js in Wasm, though. I have not done any WASSoming, but,
Scott Tolinski
Super cool. Alright. Next question is from Will Adams. He says, you recently did an episode on the MacBook Pro. I'm curious as to what happened from, University of Michigan gymnastics coach. He was, like, super famous, And I used to go over to his house once a week and help him with his computer. And he he was so funny because we we got him up on Firefox because he was using some old version of IE, of course.
Wes Bos
Let's talk about one of our sponsors, Linode. I've talked about Linode a lot. I'm gonna focus on their marketplace today. So Linode is a Linux host, and You can you can do literally anything you want on these servers, but they have this thing called the marketplace, which allows you to install, booleans with is or has, and I really like this convention.
Wes Bos
There's a huge repo of it in one of the they're they're probably a little slower to update, but this is not, rid. Like, 10 years ago, this was awful with IE, understand
Scott Tolinski
The machine's fine, but, you know, there's driver issues occasionally.
Scott Tolinski
Sanity.
Wes Bos
Express, React.
Wes Bos
I was like, I bet there's an awesome Wasm repo, and there is. There's a huge,
Wes Bos
that powers better digital experiences.
Scott Tolinski
76 laptop,
Wes Bos
rid. Wabuzio, and are on all these silly frameworks that you thought were pretty popular at the time and rid. Didn't work out, and, some of them are still running on Gulp and ask me how I know.
Wes Bos
Cyberpanel. You name it. You can install that and get these control panels for managing it, I'm going to but that is permanent. So,
Scott Tolinski
for the cheapest MacBook Air or something like that because, honestly,
Wes Bos
If I recall.
Wes Bos
rid and compressing your images, you name it. Sanity, every it makes everybody happy. I think that they should put that on their website. What is Sanity? It makes everybody happy. Yeah. It makes you happy.
Scott Tolinski
a used You know, Oh, I am doing pretty good. Got my, workout in this morning. I don't often, like, workout before work, but On the days that, like, Courtney has to go to work super early you know, she works in the school.
Wes Bos
videos for Figma at some point and got a lot of contacts over there. So Pick up Phone, mister Chielinski. We gotta get them on. Let's do it. Yeah. An awesome an awesome, renaming the function get is sick, but that is just sad.
Scott Tolinski
different question.
Wes Bos
to edit your data and to relate it and to make custom workflows. You got rid People have to get it approved by the lawyers. The lawyers are gonna love
Scott Tolinski
it's it's not the same experience as you get working on
Scott Tolinski
Pop!OS Linux laptop as a backup instead of going with, like, a Mac. But To be honest, I should have gotten, like, a MacBook Air,
Wes Bos
you get to write just plain old JavaScript or TypeScript
Scott Tolinski
fluent with the command line or used to using the command line to do anything, Honestly, that computer is almost dead in the water just because
Wes Bos
logging in and, on
Scott Tolinski
I I think I would like to sell this Linux machine because I'm just not going to use it. So honestly, if if anyone likes it, maybe I'll put it up for sale. We can talk about this right now. If you are interested in a, and and that's, like, could be seen as a barrier to entry. But if you have an extension which is referencing So it can charge your Your watch, your AirPods, and your phone all in one stand off of 1 cable. And it's pretty minimal.
Scott Tolinski
Pop!OS,
Scott Tolinski
That's an odd abbreviation. If I recall, he's from
Wes Bos
Rid But pretty, pretty cool. That's I'm I would like to do some WASM myself
Scott Tolinski
Linux in general,
Scott Tolinski
for their Compass app, which is very good. They offload a ton of their heavy processing of their data into WASM specifically. There's a really good conf talk on it, But, you're gonna want to check out this course. This course is for you, and Amy makes it nice and easy. And she has a ton of experience with this stuff, so, she's just a phenomenal resource. So If you want to check it out, it's at leveluptutorials.com.
Scott Tolinski
I was like,
Wes Bos
Everybody that uses Sanity is gonna love it. Why? Because you, the developer, And again, and this is just how they do it. You have a team that works on React, And you have another team that works in Svelte and they all they both use the same APIs. There's another team that builds the APIs, rid we don't have an answer for you. Sometimes unions and sometimes enums.
Wes Bos
super quickly. So check it out. They're gonna give you a $100 in free credit When you go to linode.comforward/syntax.
Scott Tolinski
You know, they write it, and then you could take advantage of it and use these things. There there are some situations where it would really come in handy. I know that,
Wes Bos
the marketing people on the other side, once you've built this thing in Sanity, the marketing people are gonna rid using it because there's amazing UI
Scott Tolinski
fine. But it's by no mean competing with this machine whatsoever. I'm very curious if you could hack wrecked. Because It's like, older folks.
Scott Tolinski
Rid. I I RC, he switched to Pop!OS a while back. Okay. So here's the status of my Linux laptop. Linux is Fine.
Scott Tolinski
rid. A Mac, but I didn't buy it as a production machine. And what I did is the reason why I bought that machine is because at that time, Safari being Safari and Apple being Apple, They only update Safari with OS updates, which, like, come on, in 2021 you're updating Safari with an OS update?
Wes Bos
webadmin,
Wes Bos
And the fact that you could run that in web assembly is pretty nifty. Some one of the comments was I hadn't said nifty in a while, so I Try to bring that back. Pretty nifty. Hey. You know what else is nifty? One of our sponsors. What's nifty? Sanity.
Wes Bos
one of the Wasm packages they have, which is jq. It's a JSON processing tool, slamming the APIs.
Scott Tolinski
I just don't think the experience is very good on Pop!OS
Scott Tolinski
Oh, if I recall correctly. Oh, if I recall correctly. Yeah. I was like, recall? Two words? What?
Scott Tolinski
You know, some people definitely get concerned about it taking over their jobs and and things like that. I mean, there's always a concern with stuff like this, especially because these languages that are Primarily being used for Wasm performance wise, like Rust and and c, rid no data when I really need it. Yeah. Yeah. I mean, like, yeah, I think you've covered all your bases here.
Wes Bos
In MERN 4? No JS, obviously.
Wes Bos
and approving this thing, and It's just a awesome everybody everybody's happy when you use Sanity because it's just a it's from writing the actual code to using the UI,
Wes Bos
to define your schemas for your data. You can say, alright. I have rid. I have a person. That person has a name and a photo, this is always about tools over rules. And you should you should always Think about the person using your website and not just,
Wes Bos
MERN.
RPC/gRPC good for low power situations
Wes Bos
Usually, yes, but but not always. It's some I've When I worked with, Rid 3 o twos will change post to get, or it will it will change every whatever verb you send to it, post, put, get, delete, it'll always make it into a get. Rid. 3030307 What if I'd like to redirect from post to get, for example?
Wes Bos
or,
Wes Bos
arrest request,
Wes Bos
in the show It's very much how they are in real life.
Scott Tolinski
And don't forget to subscribe in your podcast player
Scott Tolinski
Sick pics. I let's see. I do have a sick pic here. I'm trying to think. There's there's been so many cool things in my life lately.
Scott Tolinski
Head on over to syntax.fm
Scott Tolinski
It doesn't have a lot of annoying LEDs. There's some, rid Some light ones, but not really. So if you're worried about it taking up some light space. This is a nice little stand, and, it's a little expensive. But it does all 3 things, and it does them very well. I've been really liking having 1 thing on my dresser that I can just put all my stuff on rather than having, like, 4 cables that I'm trying to wrangle and, You know, take up a whole much outlet space.
Wes Bos
And then finally, webhooks is kind of like opposite rid Shodar Khada, add feature,
Scott Tolinski
for a full archive of all of our shows,
Wes Bos
We're like, when we got ours initially, we're like, oh, amazing. It'll we just run it in the middle of the night, and it's, like, so loud. He can't do it. Yeah. I can't do it.
Scott Tolinski
the magnet on the back or even just any phone with Wes's magnet thing that he talked about or his Piece of metal that you can use to wirelessly charge. This is a great stand, and it's a 3 in one stand.
Scott Tolinski
Rid I'll give that a try. I think I saw it in the, the trending. Oh, yeah. Yeah. It's a good one.
Wes Bos
Rid In the top right hand corner, it says ask a potluck question.
Scott Tolinski
And you can check out not only Amy's And and just if there is anything where users are hitting a snag or it's taking too long or there's one particular section of your site, maybe it's not cached correctly, rid So it's always loading or causing some sort of errors or something, but you can see all of that visibility My name is Scott.
Wes Bos
rid power to JSON stringify something before they send it. So they just they send it as, like, a new line or a tab delimited
Wes Bos
Wednesday or Monday. Monday. Monday. Monday.
Scott Tolinski
This is the TETCHI 3 in one stand for wireless charging.
Wes Bos
Rid. And they
Wes Bos
Pi or Oh, interesting. Some sort of controller.
Scott Tolinski
You know, of I went from REST to GraphQL, and I don't I don't know if I need another data transport in my life. I think those are they're pretty fine. Rid I I don't think that it's, like, a thing for web. I think it's, like, if you were, like, interfacing with a Raspberry
Wes Bos
go on. And what they do is they just take
Scott Tolinski
Peace.
Wes Bos
Shameless plugs, west boss .comforward/courses.
Wes Bos
Rid. Alright. Thank you so much for tuning in. We will catch you
Scott Tolinski
And so for me, it's like I I feel like I I got to, focus apps. I've talked about using a focus app for my Mac. I have, I've never used rpg or pc before.
Scott Tolinski
Yeah. I know. It it actually has been very nice to to run the thing. Although we ran it in the middle of the night, and it woke both of us up. It was Just bumping into the front door, like, going, like, dump, dump, dump. And we're like, what is that noise? Yeah. We tried to do that, too.
Wes Bos
rid of a, and it drops down a whole bunch of
Wes Bos
Let's move into some sick pics.
Wes Bos
Put type into the box, hit the submit button, and we will answer it on the on the episode.
Wes Bos
somebody buys something on your website
Wes Bos
the way that they act rid. URL structure over time. And it's it's really funny how often I get emails
Wes Bos
when I worked with the drone, like, these, like, low power things don't necessarily have the
Scott Tolinski
in particular, I I'm sorry. I'm stick picking something for iPhones only, but this is a Satechi
Scott Tolinski
She did an amazing job, and I'm so excited to have this course on our platform. If you're interested in learning about accessibility on the web, which is something every single developer should really have in their toolkit,
Wes Bos
because your webhook
Wes Bos
there are a bunch of It's Always Sunny in Philadelphia podcasts out there, but this is one that really hurt the user experience. So they're trying to figure out how do you,
Scott Tolinski
Sick. I'm going to shamelessly plug the latest rid course on level up tutorials.com, which is accessibility for everyone by Amy Kaepernick.
Wes Bos
a blog post is updated or
Scott Tolinski
I recently got a robot vacuum, although I'm not gonna sick pick that just yet. I want some more Oh, man. That looks awesome.
Scott Tolinski
Just amazing creators and some more amazing creators on the way as well. So check it out level up tutorials.com.
Scott Tolinski
It rules. It's it's pretty awesome if you have an iPhone with the, children for,
Wes Bos
commas in between every piece of data, and then you have to just parse it out yourself.
Wes Bos
Always Sunny podcast.
Scott Tolinski
The TETCHI.
Wes Bos
sick pick, Often they will be standards like RPC, then the server will ping you it will Ping most likely it will ping another server with a URL and some data and you can do what you want with it. Word. Yeah. You know what? It's funny.
Scott Tolinski
or drop a review if you like this show.
Wes Bos
a a pod they take a show, and then they just sort of talk rid through it, and then they just go on these hilarious rants. And,
Wes Bos
Rid
Scott Tolinski
Okay. I'm gonna stick pick a a really neat little thing here for phones if you have an iPhone, One of the properties in the enum directly and not just an arbitrary string,
Figma uses Rust via WebAssembly for performance
Wes Bos
speed analytics based on just when you redirect someone in Express,
Wes Bos
How do you gauge the experience of somebody actually using your website and not just loading your website? And I I think this is great. And it probably will, rid. Make a few people upset, will be able to,
Wes Bos
they provide you
Wes Bos
Stuff that happens on the page, like, if clicks are very slow or, is not Super common in the web development world.
Wes Bos
And they say they get 100 on Google page speed score. Yeah. Right. Yeah.
Wes Bos
when there is arbitrary interaction on the page Mhmm.
Wes Bos
Those are things that can really,
301 redirects are permanent
Scott Tolinski
I don't wanna I don't wanna say too many things other than, you know, just pay attention to what systems are are working for you in terms of, like, what's being able to keep you focused and and keep track of that. You know, some some simple things for me, it's as simple as like going to a coffee shop and putting on headphones And get me into a place of mind where I'm not, a good way to be very, since it's a custom platform,
Scott Tolinski
a a massive amount of large tests and essentially, like, you know, like a couple of rid Like a 2 day long test, and that's, like, one of the things she does to to understand and learn these things. But for me, Hey. Only recently started listening to the podcast during my night shifts. Rid.
Scott Tolinski
Okay. Next one here is
Scott Tolinski
Thomas.
Wes Bos
gets a new computer or something like that.
Wes Bos
you are kinda pooched until the bra the user because usually, what I'll do is I won't just rid. Say resolves issue number. I'll usually And I was just been howling listening to it. So it is super, super funny. The Always Sunny podcast.
Wes Bos
Be diagnosed in high school. I could've gotten extra time for tests and stuff, especially because I'm also dyslexic. So, like, you know, that would've been great. I would've had some time. I got rid. To go into a different room and do my tests in high school. I didn't I wasn't the the teachers just knew. Like, yeah. You're freaking crazy. So, You know? Like, I don't I I wish I could, like, remember. Like, how did that even come up? But, like, yeah, I had a hard time concentrating on on doing my test. But, like, also, like,
Wes Bos
Rid. And then, so just be very, very, very careful with 3 zero one redirects again. Ask me how I know.
Wes Bos
will maintain the verb. A 301 will not maintain it. So, again, back to the original one, So with the most delicious tasty treats about web development rid Out there today, we've got a potluck for you. This is where you submit the questions.
Wes Bos
And then a three zero eight is the equivalent of maintaining the verb, But it is permanent again. So, always kinda side on a temporary redirect until you absolutely know. And it's it's you usually only use permanent redirects rid. For, like, SEO reasons,
Scott Tolinski
rid. Necessary to be worked on, but there are necessary sections that I I should be spending my time on. It's just like things like that where it's like, yeah. I Really wish I could have a little bit of focus sometimes, and and there is some, like I said, personal responsibility there. You know, I have the ability to control myself. It's just it's just not easy. Right? And And I'm sure a lot of people feel that way as well. Next question we have here is from Yosef.
Scott Tolinski
I personally think that we should get Kordion, who is my wife, she's a doctor of psychology to talk about ADHD and some strategies for dealing with it. Because I know a lot of people have similar issues. And for me, the things that keep me,
Scott Tolinski
but,
Wes Bos
say, the new page. I have lots of these in my application because I've changed around the you could rid. Send in GraphQL, you can send as many requests as you want in a single GraphQL request, rid I I we talk to a lot of people who work in big companies,
Scott Tolinski
She was just like, I don't know why I didn't see it for so long.
Scott Tolinski
You definitely have ADHD.
Scott Tolinski
rid am returning any status code. I feel like I have to Or,
Scott Tolinski
consuming any different things. Because I I even tweeted out the other day that, like, having multiple monitors It's sometimes like a net negative for me concentration wise because I'm looking around all the time. I got too many windows open. It's it's not like focus mode. So there's a there's a lot of stuff there around focus, and I'm sure I'm sure just in in general, In my opinion, no. This is like this is a situation where you have a team
Scott Tolinski
I would I would pretty much fail on. So I definitely have ADHD. I I'm super fidgety. I'm always looking around. I'm always doing something. I'm always consuming, like, 8 different Dreams of information.
Scott Tolinski
And because of that, like, yeah, that's that's how I was diagnosed, or Satechi. I don't I don't know how they pronounce it. Thanks, Satechi.
Wes Bos
The number, these HTTP codes when you redirect in your frameworks, including Express and Koa. Yeah. Whenever I
Scott Tolinski
focused are, like,
Scott Tolinski
have the table in front of me just so I can make sure that I'm utilizing the right one because you do. You wanna use the right one.
Scott Tolinski
You know, focus settings on my phone set up so that I can open certain apps at certain times. Kind of like building in these tools However, if you have an enum, you could say,
Scott Tolinski
It is
Wes Bos
because you you wanna tell Google now this this this article has moved forever
Wes Bos
explanation of what it is because that helps me when I'm doing git log in the terminal rid As well as link up to the the actual issue.
Scott Tolinski
but it you know, the diagnosis doesn't really do anything for me. I'm not gonna get on medication Or it just helps me understand and and be able to research a little bit better ways on how to deal with it, so to say. It would have actually been dope to, minutes or 30 minutes and find out that it's actually something with the user's
Wes Bos
My,
Scott Tolinski
Found yours soon after and has been my go to and now keeps me entertained and has gotten me through some tough times. So I wanted to massive say a massive thank you. Well, thank you, Thomas.
Scott Tolinski
Again, I think Courtney would be really great to have on because I know she would you know, she knows a ton more about ADHD than I do, considering she's doctor of psychology. So if I wasn't As in you can do comparisons.
Scott Tolinski
she's testing
Wes Bos
there will be a lot of techniques. Rid. How did you get diagnosed with initially? Because my wife says that all the time to me. She's like, you for sure have ADHD because I'm I'm all over the place and have a hard time focusing sometimes and and whatnot. So so Courtney kinda
Scott Tolinski
maybe I wasn't great at concentrating or any of that stuff. I always do bad on standardized tests despite being, like, a 4 not a not a 4 point student, but almost a 4 point student. You know? I had good grades in or in high school and in most part for college, but, like, the the classic things that you would say, like, oh, yeah. This person has a learning disability,
Scott Tolinski
switch to flip because I I come up with An absurd amount of ideas, but it's always when I'm trying to think about something else. Or, like, you know, I start working on a feature in the site that's, like, not When when she has to go to work super early and I'm all I'm woke up, I'm like, you know what? I might rid. A workout before we get going for the day, and it's always nice. So go Astro. But if you need, You know, that that server response and that dynamic server data to come back, then you're gonna need a a more you know, an actual full stack node node as well as or Server side platform as well.
Wes Bos
like, golden retriever attitude, let's talk about that again, is has gotten me into some good good spots in life as well. So Part of me is just like, I kinda maybe just leave that alone. Yeah. Yeah. I know. It would be really nice to have a a a
Scott Tolinski
And one of you said that you have ADHD, And I wanted to ask you how you deal with it in the combination of being a developer. How does this impact your ability to stay concentrated on a single project in a general starting and finishing projects? Turns out his headphones were broken. Yeah. So, hey, that kind of stuff happens. Things like that happen. Yeah. It is funny because you do occasionally get a comment saying, like, oh, I cannot play Any of your videos on my on my browser. I'm like, well, let's restart the browser. Let's update it and close it. Oh, that fixed it. Okay. Yeah. Rid
Scott Tolinski
extremely obvious.
Scott Tolinski
So far within 2 weeks, I've gone through a massive amount of episodes. I can't remember what episode it was, but it got me thinking if you could make an episode on being a developer with rid. And then tonight, I heard an episode about a t shirt shipping on the 21st April.
Wes Bos
Don't don't take what I'm saying for it. Look it up. But yes, that's you can specify
Scott Tolinski
learning disabilities or autism or whatever. And she has done
Scott Tolinski
diagnosed you with it? That's, like, what she does For her job. Not specifically ADHD,
Wes Bos
to this new URL.
307 redirects maintain verb
Wes Bos
trying to save something to a database and you change that URL end point, then you need to use a different redirect. And that's where a 3 0 3 or 3 o sevens come in. You can also do a 3 zero one redirect, which is permanent.
Enums useful for populating dropdowns
Wes Bos
in an enum, you could loop over that enum and and automatically populate the drop down, which is pretty cool. So, rid Stackblitz on, parse. Doing that in the browser would probably crash the browser. It'd be very, very slow. You you have to do it with streams and buffers and all that stuff. And,
Wes Bos
Rid what is web assembly? Thank you, Linode, for sponsoring. Next question we have here is from
Wes Bos
What problems will it solve? What are the benefits for whom?
Wes Bos
Next one we have here is from Yorn.
Wes Bos
Rid. When is it coming, or is it already here? What must I learn? What can I forget? Is that even learned yet? Alright. WASM, web assembly. We've talked about it, Quite a bit on this show.
Scott Tolinski
So don't don't sweat it too much. Yeah. It really depends on the context for me, and they are very similar in their usage.
Wes Bos
I don't know if we've done a full show on it, but we've, we've just, like, kind of, like, have we? Let's look it up. We've done so many shows now. Know if we have done a PhoWasm show.
Throttling/debouncing requests
Wes Bos
this is a good question. When you are redirecting somebody, I guess it kinda is an Express question. Because,
Wes Bos
Rid So, Scott, are you gonna rebuild your entire,
Scott Tolinski
And and there's even ways in GraphQL To Scott using Linux, I I what is I IRC?
Scott Tolinski
Easy to do that stuff if you gotta spend the time on it.
Wes Bos
So I put a redirect in there. Anyways, Express handles,
Scott Tolinski
why you would use a micro front end system. Right? A system to control and wrangle multiple front end frameworks and or versions within 1 project. But what that means is really that's not something that The majority of developers are going to hit. Like, if if leveluptutorials.com system like, big big three money
Wes Bos
And, usually, all of these are the answer to,
Scott Tolinski
No. I will not. And not because Astro is not good. Astro is fantastic. I really liked it. Here's the deal. It's not the same thing. SvelteKit is an like an application
Scott Tolinski
Besides just
Wes Bos
rid realm of what our company has. So we are going to build something totally separate.
Wes Bos
and then they just rid. Dish out the data and then each team is allowed to sort of pick their own tech. And and honestly, at the end of the day, they're much more efficient rid Because that team is is able to do it. So,
Wes Bos
Rid. I use Vimeo API a lot. And when every single request that you send them, they'll send you back a header that tells you how many requests you have left. Mhmm. So I've done some some parsing of that header just to make sure that I'm not going over my limit and then and Linode, I've ever interfaced with WebR or sorry, RPC or gRPC.
Scott Tolinski
It would only be a just for fun thing. It wouldn't be anything serious. But either way, you're comparing Sveltekit to, a lot of things there for me.
Scott Tolinski
Rid. Rafael says, lately, I keep hearing about micro front ends. What is it? What's the benefit? What are the cons? Okay. Micro front ends are the idea that you can use multiple front end frameworks or versions of a front end framework in 1 codebase and have them all play somewhat nice together.
Scott Tolinski
and static primarily, to help me along and concentrate and not get Too distracted.
Wes Bos
Is that when these 301, 302, 307,
Scott Tolinski
not only, Sick pics.
Scott Tolinski
and more. You can see all of that right next to your issue tab, Your releases, user feedback, a lot of great dashboard
Wes Bos
business and livelihood in Astro? No.
Scott Tolinski
things that are telling you just how fast any individual The only reason I tend to use enums more than string unions
Wes Bos
because this is not a specific Nope. We probably should. So web assembly is rid. The ability
Wes Bos
My understanding is that redirects Carry the same method across from the original endpoint.
Wes Bos
question to express.
Wes Bos
expand this and saying redirects In literally every server framework ever, However, if you have a function like is sick and you want rid. Just set a variable to the results of the function.
Wes Bos
the existing
Scott Tolinski
A YouTube channel that I occasionally watch that does, like, speed running for video games, and they always go, you absolute legends. And then I'm like, I don't know,
Wes Bos
You just say, like, response redirect forward slash,
Wes Bos
a golden retriever of JavaScript frameworks,
Scott Tolinski
Static and maybe server first
Wes Bos
or 308 come in handy? I can't find any good reasons or is this to understand this. Thanks again. So,
Wes Bos
bureaucracy, How I Met Your Mother. I just I just saw the clip, and I was like, I've never rid. I've never seen this show before, so it's it's one of those things that has escaped its original,
Scott Tolinski
There's people in different sections working on different parts of the site, and they have different tech requirements or different tech. Maybe somebody built something in Svelte. Somebody else build something in Angular. You want them to play nice together. Right? So that's Memory, things like that aren't good. I never remember what the pattern is for conventional commits,
Wes Bos
I I don't know. Like, they're rid I had people
Wes Bos
rid. Meaning that we can't move fast enough and then I have podcast host, is when something happens,
Scott Tolinski
I guess when, when the paycheck's there, it's
Scott Tolinski
Now every single time I go on to Sentry, rid. I I feel like there's a some something new or or great or something for me to check out,
Wes Bos
Thank you. Can you please shed some light on redirects and express slash Koa? I'm gonna,
Scott Tolinski
because there's too many meetings, and I can't get done what I wanna do. Yeah. Totally. I mean, I did run into a situation where this would have been handy when I worked at Ford because there were multiple Teams. In fact, since when I worked at Ford, they they agencied out a whole bunch of stuff to many different agencies. Yeah. And oftentimes those agencies would come with their own their own system. Right? In fact, I always laugh like one of the
Wes Bos
yeah, it's a kind of a fancy word for just saying let people work up by themselves Rid. Okay. So that is probably not Yeah. Not web Yeah. That's probably not running in the actual Figma app. That's a server that runs somewhere to talk to one to another.
Wes Bos
from somebody who's, like, 6 years old or 77 year old email they're applying to. Like, oh, this link doesn't work anymore. I'm like, oh, yeah. I gotta I have to still support the links I sent out 7 years ago.
Wes Bos
but also half serious.
Wes Bos
use, and it's just made its way into the mainstream. Anyways, thank you For calling us legendary.
Wes Bos
Same thing with like, Vimeo.
Wes Bos
Thanks for all you're doing. You are both Legends. Thank you. What was that? What was the movie where people were saying everything was legendary for a while? I don't know. But there's a
Wes Bos
being returned,
Scott Tolinski
stuff that you can get if you have one of the business accounts, but just endless amount of cool tools. So If you wanna check all this out and have some awesome exception and error handling and performance tracking tools, head on over to century. Io. Use the coupon code tasty treat. That is a tasty started using multiple front end frameworks, please take it out back.
Wes Bos
idea
Scott Tolinski
Just Yeah. Oh, yeah. I did that. Yeah.
Scott Tolinski
and the team is large. There's If you sign up to become a pro, you can sign up for the year and save 25%.
Scott Tolinski
Take it out back. Just leave it on the side of it or whatever. Get rid of it. It is that that size of website or project does not need a microfinance solution. Yeah. And it's gonna make things terrible. Rid. So it's it's really funny. I've I've heard this this
Wes Bos
treat, all lowercase, all one word. You'll get 2 months for free. Well, well, well worth your time. Next question we have from Otis, this one's for Scott. I'll read it. I'll let you answer. Since Astro seems so amazing, aren't you tempted to rebuild your site now in Astro and SvelteKit?
Wes Bos
inside
Wes Bos
or we can't build what we wanna build,
Scott Tolinski
Astro is fantastic if you're thinking
Scott Tolinski
Whether or not there's lots of bugs or no bugs or whatever, you'll see it, But you'll also see performance tracking metrics with a user misery score, Hope it makes sense. Thank you again for being here during my night shifts and getting me through some tough times. Thank you, Thomas. Yeah. So I do have ADHD, and it was something that, I did I guess I didn't know for too too long in my life. I just felt like, rid Can be, this string or this string or this string or this string and nothing else. So on the surface, those seem like they're very, very similar, and they are they're very similar use cases.
Scott Tolinski
And, Wes, I'm glad you brought up Century earlier at their performance metrics because that's a A feature of Sentry that I use all the time. This episode is also sponsored by Sentry at century. Io.
Wes Bos
man. What's that? Is that How I Met Your Mother? But you could call it get sick status, What do you name? That variable. You can't use is sick or you'll get a name collision in the functionality.
Wes Bos
Rid I am. And I think this is half joking because Scott is 18 different websites that are need maintaining
Scott Tolinski
Outside of the GraphQL spec where you're saying, hey. Just perform
Wes Bos
Rid and now it is called micro front ends.
Scott Tolinski
one of the guys one of the guys on one of the teams that they, like, contracted out rid Use some of that that precious, Do not just run sudo whatever be not because, you know, installing Sass that way is bad, but
Scott Tolinski
in a web building framework where you can build a ton of different types of sites. And my site is primarily a dynamic site. Right? There's a lot of User based things where that just does not make sense to be a static site. Astro is a static site generator.
Google Chrome measuring user experience beyond page load
Wes Bos
Or is this not as big of a deal as I think it is? So I actually haven't taken a look at this Have you seen this, Scott? And what's the end in what's the n in, items, then rerun the accessibility.
Scott Tolinski
they're they're only as, like, useful as the person that's, like, reading it or consuming that data.
Scott Tolinski
my opinion about any of these tools, whether it is Lightroom or or Lightroom, Lighthouse or, one of these, You know, performance trackers
Scott Tolinski
I haven't done a a super deep dive, but I think my answer is not going to change regardless.
Wes Bos
is it back to the drawing board?
Scott Tolinski
or SEO trackers, outside of a package,
Scott Tolinski
So if you're if you're kind of just running lighthouse and blindly accepting the scores you know, not everybody's doing that, especially if you're a UI designer. As a UI designer or developer, you're building UIs, react, or whatever.
Transcript
Wes Bos
but can keep the verb? Some pretty nerdy ones.
Wes Bos
the podcast Thank you, Sanity, for sponsoring. Sick.
Wes Bos
C h ttpcolon//github.comforward/ I just rid. Came aware of an initiative over at Google Chrome to start measuring user experience beyond the complete Rid. But honestly, I I've I've gone back and forth redirects, rid For video player, it resolves issue number whatever. So I'll do a quick no. They they they link to a, A GitHub issue where it says,
Wes Bos
What is the difference between gRPC, rid The REST, RPC, GraphQL, and webhooks.
Scott Tolinski
Did you use your, what's it called, tonal? Is that what you're still using? Yeah. The tonal, dude. It's incredible. I'm on a 7 week streak. I I work out maybe 5 days a week on the tonal. And, man, it's amazing. I never even think about how much weight I'm lifting. I just show up. I push the button and it auto sets everything for me, and it tells me what to do. And I say, yes. Yes, Tonal. Yes, sir. Thank Will do. GitHub Copilot for Working out. It really is. If if it doesn't do the lift for you, that would be sweet. Oh, yeah.
Wes Bos
page load.
Wes Bos
Wow. That's rid. Cool. Alright. Let's
Wes Bos
Oh my goodness. Some good ones today. We are sponsored by 3 awesome companies, Sanity,
Wes Bos
Welcome to Syntax, With me as always is mister Scott Talinski. How are you doing today, Scott? It is. Hey. Sanity is rid. Super, super nifty. Sanity is a unified content platform
Scott Tolinski
That's awesome. Feeling feeling ready to go even though I, And I did need a little bit of caffeine to get me going, but it's all good.
Wes Bos
error and exception tracking,
Wes Bos
get into the questions. First1 we have here is from Felicia.
Wes Bos
We provide the answers. We haven't done a potluck in, I don't know, maybe 6 weeks or so. We've got all kinds of really, really good questions about, And if you have, I don't know, a 1000000 records that you have to rid. JSON it will change it to a get.
Wes Bos
Variables and Astro and Express and Koa and How do you handle redirects
Wes Bos
Sentry,
Announcer
You're listening to Syntax, the podcast with the tastiest web development treats out there. Strap yourself in and get ready. Here is Scott Talinski and Wes Boss.
Wes Bos
they they detail what it is.
Conventional commits for organized messages
Scott Tolinski
for a whole year or since we last talked about it. And I have, Do browsers automatically update automatically? And he called he only called it Foxfire, and I I it was the cutest thing in the entire world. I love it. He'd be like, so I just click on Foxfire? these multiple queries and it will go off and send them as an array rather than a Just a single string of 1. So that that's totally doable depending on how your server handles it as well. But yeah. Yeah. I think you nailed it. Next question here is from Rafael.
Scott Tolinski
on how you do it, but this is a good, Union types seems simpler, but also seem to be a matter of preference. I was wondering if you guys prefer 1, Golang.
Scott Tolinski
no. Not all people, but it means that most people will Because it's it's kind of hard to run a really old version of Chrome or Edge or whatever unless you're almost intentionally running a very old version of it. So, for the most part, And only use the is or has or the boolean itself. That that's just how I do it. Alright. Next question is from Ben Lammers.
Wes Bos
somebody that worked for a Canadian government contact me, and something wasn't working on my website. And I was like, what the heck? Rid. And then he gave me the he gave me the actual error message, and this is before we had our sponsor, which was Sentry installed on the website. Mhmm. And we finally figured out that, which does Linux cloud hosting will talk about all of them partway through the episode.
Wes Bos
So they had to contact So that's that.
Scott Tolinski
There are people who just, like, do not update their browser and will never close it, but When you do close it, Chrome's gonna be like, I will update now.
Scott Tolinski
For example, when I see a feature that's supported by Chrome, the latest version, does that mean that all Chrome users have this feature?
Scott Tolinski
So that was always really, really fun for me. But okay. So the second part of this question is, I haven't worked on a real project before, and I wonder When you work on maintaining a big project, what do you do in a daily 8 hours? I mean, is there always bugs and apps?
Scott Tolinski
You know what? Why that should have a built in updater.
Scott Tolinski
That's specifically for conventional commits. It forces you into, That's it.
Wes Bos
And the second part of the question is JSON the standard formats for data slash content transfer. Rid. REST is probably the most popular one, out there in the world, and the what that is is it's a endpoint on your server that you hit, What do you call it? The design program.
Scott Tolinski
So a a lot of browsers, Chrome, Edge, Firefox, they all update themselves, and they've gone into a way where it's just kind of Being done behind the scenes, almost like Edge as it gets out of date. There's just like a little green arrow in the top right corner, and if you click that, it Refreshes it with the new version.
Scott Tolinski
like, consultations for,
Wes Bos
IT and whatever and get it updated. But, yeah, most people get the the updates. Even with rid. The Canadian government just pegs Chrome on a certain version and then, You can see a list of all of my courses, Master Gatsby, Beginner JavaScript, Full Stack, Advanced React, and GraphQL, and a whole bunch rid more. Check it on out. Use the coupon code syntax for $10 off.
Wes Bos
rid. Even with people's iPhones and and Safari, they will eventually
Scott Tolinski
was it just
Wes Bos
next question we have here from Dylan. This is the last one. Can you help break down and explain the jargons between RPC, REST, rid gRPC and GraphQL. And I'm gonna throw webhooks into that as well.
Scott Tolinski
So it doesn't mean that all people MongoDB
Scott Tolinski
And, the things that I typically work on, that structure. Now I don't know honestly if there is things in here for mono repos, but I figured it's a good way to at least have an eye on what your commit messages could be like. I would imagine there's something with monorepos in here specifically Quest greetings. Noob question alert.
Wes Bos
which is, like, 3 years old version of Chrome they were running.
Scott Tolinski
what we do as developers. We get to hack around on things, and Sometimes it's really important features like adding a form so that the user can update their stuff or their credit card or anything like that. But, typically, you're just adding, working on features. Bugs are a part of it, but maybe not a major part of it or hopefully not a major part of it if I'm fixing a couple bugs per week.
Scott Tolinski
a lot of modern browsers do. Unfortunately,
Wes Bos
and then it will send some data back to you. So that's what REST is.
Scott Tolinski
rid mainline, but I also have an extension for it within Versus Code that allows me to easily do conventional commits because let's face it. As we just talked about my, Astro is is not a super good idea because they have very different use cases.
Scott Tolinski
We were looking at our Black Friday sales and wondering, like,
Scott Tolinski
And one of the guys I did was, like, this, like, famous,
Scott Tolinski
Like, yep. Foxfire.
Wes Bos
where, like, you would you would just have to wait for people to buy a new computer, rid before they would update their version. Of course, you could update it, but there was no auto updater built in. There was no software update built into Windows rid. That would do it. So you pretty much just had to wait for people to because I just rid hearing about really cool stuff. The problem is I don't know any other languages.
Scott Tolinski
Rid.
Scott Tolinski
I do. Well, the reason why I went to monorepos, route on your site is.
Scott Tolinski
Hey, Scott and Wes. I really enjoy listening to your podcast while exercising. I have 2 questions.
Scott Tolinski
It means that most people get those features. Yeah. Like, I wouldn't even know how to stop If if if maybe if my site was written in Gatsby, I might think, oh, it would be kinda cool to rebuild this in Astro just for fun. But
Scott Tolinski
I both have, like, an alias in my
Scott Tolinski
rid regimented about your commit messages in a way that keeps everything organized, allows you to have oh, wait. This person this person wasn't talking about mono repos. No. But you you use a monorepo.
Wes Bos
rid and you you you either send data to it,
Wes Bos
before they would update it. But there was remember that there's this huge, huge push of People installing Firefox on their, like, family members' computers?
Wes Bos
Chrome from auto updating. I did I did hit it once where, how do you batch requests in Node. Js to an API? That's a kind of interesting question. So, rid And it runs in WebAssembly because I'm assuming it's written in some other language.
Wes Bos
Scott just posted this conventional commits here.
Scott Tolinski
It's good now. I had a a con when I was in college, I did a computer, because there's so many great features in this thing. But, again, the performance met tracking metrics Is really one of the coolest things on this and it's one of the newer features on Sentry. So Sentry is an error and exception handling tool that allow you to See exactly how your application is functioning.
Scott Tolinski
So
Wes Bos
because you wanna you you need to give some data to it to save or or to filter,
Scott Tolinski
yesterday, I added a Edit button to any page of a content that will take you automatically to the form.
Scott Tolinski
And sometimes You get bug reports, and you investigate them for 20:20
Wes Bos
buy a new computer,
Scott Tolinski
I wanna say yes.
Scott Tolinski
how does this compare to previous Black Fridays? I don't know. We don't normally take metrics like that. Oh, let's build in a chart. So I built in a chart. Love building charts. That's exactly,
Scott Tolinski
we had another question about commits and monorepos in the in the, Hotlucks. I started reading this one, and I just or I I listened to this one and just assumed it was the same question. Either way, conventional commits be a good solution for that. Alright. Next question is from Joseph again, same guy.
Scott Tolinski
So, hey, here's a tutorial page. I wanna edit this specific one. Now there's a little edit button on that rid. Page. I just click the button, and it automatically zooms me to the admin form. Things like that. Right? These are little features. People are gonna be working on the site. They're gonna be editing content, authors, creators, whatever. You wanna make sure that's easy for them, build a nice little utility. Or how about this?
Naming functions vs boolean variables
Scott Tolinski
But just like UI usually prefix a get or a set or update or something, If I recall.
Wes Bos
Rid I usually end up, We did a show on it, like, a year ago, And we both said that we were going to take this conventional commit seriously, and I have not started using it. Have you? Yeah. Yeah. We did it,
Wes Bos
that would that would be good as well, but I don't I don't see anything wrong with that. Yeah. I I do something very similar, but like and that is related to a person. And then I can link all these things together. And then, especially these people that have a one h one tag on their website,
Wes Bos
Indicator to help us out. Label. Yeah. An indicator to to what it is.
Scott Tolinski
I don't ever name a I I never name a function is something. Right? I would name just the bully in that. So that's kind of what I got out of this is if you have a function named is sick, but I would never do that. The function would be get is sick or get sick depending on how I'm feeling that day.
Scott Tolinski
rid Like this person saying, to write tests for the CSS for a prototype That was only gonna be shown in 1 meeting. And you're just like, why? Why? Why? Why are you writing CSS tests for this? I could I Like, why are you even writing JavaScript tests for this? This is not production code.
Scott Tolinski
is kind of like an object where it has properties
Scott Tolinski
enum writing all of your your values inside of the query, there you can even do batching in a lot of the GraphQL libraries
Scott Tolinski
Ben says, hey, Scott and Wes. Hope you're doing well. Recently, I had a few scenarios where I debated between using an enum as versus a union type in TypeScript.
Wes Bos
So, it this is a little easier with TypeScript because you can just hover over top of it and see Mhmm. The type That it returns. The reason why we have these is or has in front is just sort of as a, So
Scott Tolinski
and values or just values that are are there.
Wes Bos
what do you call that? A a notion,
Scott Tolinski
And a I also wonder, do you always Work on adding new features or just maintaining. Okay. So, this is a good question for me. I'm working on a project. I'm largely coding all day on it if I'm not recording or doing a podcast.
Wes Bos
Tell me there's a better way. Rid. PS, I love the show.
Wes Bos
I was gonna say before I even finish reading this is that I usually just pop a get in front of it. I'm just looking at some code I'm writing right now, and I have get rid stream, get object list, and get session.
Scott Tolinski
or maybe some of the benefits of them. Thanks. Okay. So an
Scott Tolinski
a nice little identifier there on the function I I honestly don't know too much about what languages people are using for Wasm besides Rust. But,
Tools over rules for performance metrics
Scott Tolinski
How can I ensure that I am executing npm commands safely? I know that you shouldn't execute npm as root. I am am I a root user on a Mac if I have admin rights? Question mark. I think Mac disables root user by default. I In pseudo things, so is that a yes? Okay. So Mike is basically adding asking, hey. If you run an NPM Script or a node script on your computer, how can you be sure that this thing isn't either, you know, maliciously adding or removing files from your computer? And the answer to that is You You have to go to the command line to do a whole bunch of stuff. A lot of the applications are half assed.
Scott Tolinski
truth, so to say. Next question here is from Mike.
Scott Tolinski
rid Global if you if you do want to install things globally, which there are some things that are are good to install globally,
Scott Tolinski
You want to make sure that you do not run
Scott Tolinski
sudo npm or n p x, whatever the command is, because sudo is going to give that admin
Scott Tolinski
Missing tags, SEO tags, whatever. But, yeah, don't don't follow them as the the word of, Yeah. You don't need to really know anything about Wasm other than the fact that it is. Look what it is. It's WebAssembly in the browser. Or Here's here's another good example. Rid. I just went to the awesome Wasm.
Scott Tolinski
Noob question alert.
Scott Tolinski
either way, don't don't just arbitrarily run global scripts on your machine if You're not exactly sure what they're doing. If you wanna be safe about it, it's good to know what sudo is doing on your computer.
Wes Bos
Because there's more there's more to it than than load time. And this is good.
Wes Bos
oh, I need to defer loading of a font and then and then it's amazing website.
Scott Tolinski
Right? And it could cause some malicious behavior. So if you ever see a Stack Overflow p question where somebody says, I ran npm install hyphen g Sass or whatever, And you're telling me I don't have permission.
Wes Bos
Because for a lot of people, that's just what you have to type in front of the thing to make it work. Oh, yeah. And it's it's kind of unfortunate, and you have to You should probably dig a little deeper into how how to properly fix that. I even I forget what package it was. It was a couple months ago. I globally installed something, and I just popped a sudo in front of it, and it's like, we don't support installing it via sudo. And I was like, that's okay. Good job. Thank you. That's cool. Thank you for catching me on that.
Scott Tolinski
opens you up to to running things on your computer that you don't know what it is, and it is something that you wanna be cognizant of. And I think you can just change the permissions on NPM itself, and that will fix those errors. But
Scott Tolinski
Rid Yeah. Totally. Hey. And I I agree. Again, it like,
Wes Bos
Next question we have here is from the viewer. You guys have talks about prefixing
REST most popular web data transfer
Wes Bos
from it rid Is that, you describe the task at hand, of making small isolated rid. Versions of an app or a website has has popped up, I think, 3 times now in my career. It was called MiniSites initially, and then it was called the MicroSites.
Wes Bos
and you send the entire task. So what I understand is that, rid. RPC and gRPC, I'll tell tell you the difference in just a second, is that you do all of the, the other part of the question is JSON is standard format?
Wes Bos
rid Work in in building the instruction on the client, and then you send that over to the server or to the actual device. And, apparently, it's very popular in, rid. Low power situations.
Wes Bos
That's the next one is, rid. GraphQL, you sort of describe
Wes Bos
Quite honestly, I don't even know if I've ever is that but essentially that will only allow you to run them once every however
Wes Bos
IoT is is a big user there. That that kind of reminds me of GraphQL.
Wes Bos
The best I can sort of podcast to have them on. But it it's really interesting The actual actors of It's Always Sunny in Philadelphia
Enums vs string unions in TypeScript
Scott Tolinski
status dot active,
Wes Bos
rid TypeScript that are compiled into your JavaScript at the end of the day. The rest of TypeScript is stripped out, but enums can are actual values. They're they're And you can use those And then before you know it, you've got rid What will this do to our cherished best practices of deferring scripts, rid. Filesheets, images, and fonts,
Scott Tolinski
this, to me, becomes easier to debug when you're updating things or need to change any of those values.
Scott Tolinski
Right? you wanna run these tests and look at the results and act accordingly. But there is an eye iTest component, and you do wanna, you know, make sure everything feels and looks nice while you're using it. But again, you know, these things are good for Is this something that the majority of developers will ever need to worry about?
Scott Tolinski
usually, this is used if you wanna say something is one of these potential values. It is one of these values within this enum, but not outside of this enum. So that way, if the inside of the enum says status as a string or something,
Wes Bos
You have rid. Active, inactive, or canceled in a,
Wes Bos
the using an enum property And interface with them with JavaScript. So a really good example Structured content, CMS,
Scott Tolinski
I don't I don't know if it matters too much. I think it is more of a A preference thing, but I do like that feature of enums in TypeScript. This reminds me of in in Redux where you have your actions, and people would rid. Take a string of the action, like, incremented,
Wes Bos
rid To check something and just using a plain string. And I find that sometimes even with the enum, I have to look. Okay. What was the enum set to? Mhmm. So I can look it up. But the the benefit of like Scott said, the benefit of using enum, also is that enums are the only thing in in So go to sanity.ioforward/ So they they rid. Basically, you click it, and you will automatically have MongoDB Express, React, and Node. Js and their firewall installed for you. And you can get up and running
Scott Tolinski
So if you were using a string union and doing a comparison, you'd be hard coding a string in there. Like, thing is equal to a string
Wes Bos
values even to do simple things like populate a select drop down.
Scott Tolinski
If thing is equal equal equal to
Scott Tolinski
is because with an enum, you can actually use it in your JavaScript code,
Scott Tolinski
of active.
Scott Tolinski
Then if you don't have even the capitalization correct on that status, it's going to fail because it's not the same property. And string unions are very similar where you're saying, hey. This type or Linux for that matter.
Wes Bos
and then they would just, like, make a variable called incremented it's like a like a juicy, beefy computer. Right? Not really. I got I got, like, I went more portable with it. I think Oh, okay. Yeah. Rid. You didn't get super juicy. Okay. Alright. Well, we'll start the bidding at $1. $1.
Wes Bos
and then put a string in there, and then they'd use that variable everywhere instead of an actual string.
Wes Bos
refactoring a bit easier because,
Wes Bos
rid is an actual type, and it's variable. And you can reference those things very easily versus just doing, like, a finder place on a string.
Scott Tolinski
And I I just kinda like the way it makes few things feel, like, secure. It's not like, hey. Here's the the string that needs to meet the requirements. It's like It's using physically one of the actual chunk requirement types.
Wes Bos
I get it, rid But, like, you're just you're just typing the same thing without quotes around it Yeah. At the end of the day. And, like, maybe that makes, This RPC, gRPC
GraphQL allows batching requests
Wes Bos
is, you can throttle or debounce them. We've Gone over the difference many times in this podcast what the difference is between the 2,
Wes Bos
That's kind of what GraphQL Rid. I mean, should I repeat the name of the issue on the commit or just resolve's issue number issue number? Rid. Because at GitHub, when you have a commit, you can put in an issue number in the commit, and GitHub will automatically link it up and and mention it in the issue. So you can see that there was a commit against that specific issue. I know it's a silly question, but I am very confused as to what to do. So, and there will be some sort of package available that will allow you to parse it out into
Wes Bos
and then the server that is running the API However many seconds and that will stop you from
Wes Bos
Run all the database requests and fulfill all of that that data and then send it back in a single request. That that's rid Huge benefit to using GraphQL. The other thing you can do is you can, like, throttle or debounce your requests. So that's not necessarily batching them, Hi, guys. I heard Wes saying that he uses GitHub issues for managing features of his projects, and I started doing so. But I have a small project which is linking commit messages with issues. It's good a good good idea.
Wes Bos
totally, and they are running, the
Wes Bos
rid.
Wes Bos
but What that will allow you to do is if you're worried about sending a request too often to an API,
Lighthouse scores useful but don't blindly follow
Wes Bos
page loads and then you get your score at 2. Rid. Okay. Well, as the user uses it, like, if they click click a menu, with,
Wes Bos
like a very simple
Scott Tolinski
is interpret the results. Right? It it's running these these tests on your site regardless of what they are. And then so it's back to you, the data, and it's up to you to interpret whether or not that's good or not. Like, not all sites that have a 100 on light Like, I can probably say light box, light whatever. Not every site that has a 100 score on lighthouse is any good, and there are plenty of sites that don't have that score That are also very good. So again, they're all about how you interpret this information, I suppose. And it it gives you a road map. So what they're doing is they're expanding the lighthouse score from just being,
Scott Tolinski
or saying that that's like some sort of definitive proof, I I would say that's not probably a great strategy, and what you wanna do
GraphQL describes data needs in requests
Wes Bos
rid. You send over that entire request, and it brings it brings it on back to you. Oh, I forgot to say,
Wes Bos
RPC, sort of a set of framework standards.
Wes Bos
a little bit more what you are doing and what data you would like back from it, and then you send over that entire,
Wes Bos
RPC g RPC. So gRPC is like a framework built around
302 redirects change POST to GET
Wes Bos
So if you are
Wes Bos
as a 302, which means that if you post something to a URL,