Google Knows Best

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is ben and i have a confession to make i am a modern web developer who enjoys using bloated javascript frameworks and installing large npm packages like moment.js or low dash so i don't have to write any utility functions myself put simply i like my websites like i like my hamburgers thick my hobbies include watching people download a lot of javascript and ruining the web as we know it in my youth i used to hand craft static artisan html pages which would load in your browser in under an hour but alas those days are all gone but you already know this if you follow me on twitter but you don't follow me so i just wanted to fill you in on my tinder bio so that way we're on the same page now that you have some context on exactly what kind of developer i actually am let's talk about the new feature that google is adding to lighthouse for those of you that haven't heard about lighthouse it is a diagnostic tool that you can run on your website to get a score based on how fast it loads and a few other metrics the main use case for this tool is when you're first setting up your blog and you're using a hype framework and you don't have any content on there yet but you run the tool you score a 100 you take a screenshot and then you flex on social media that you're a beast at web development besides just giving you a score it also gives you tips on how to improve the speed of your site if that is something you're interested in if you want to give this a try for yourself open up chrome and i usually like to do this in an incognito window that way i don't have any extensions messing things up and then go to the website that you'd like to run it on so i'm going to go to new.red.com for the second time in my life and i'm just going to right click inspect and this will open up dev tools and we can come over here to lighthouse so this is where we can run it there's a few settings here you can toggle and then we can generate a report and it'll run and do its thing we can see the scores for the different categories that lighthouse uses and we can see when it comes to performance new reddit does not do quite so well but if we are a red developer what we can do is we can scroll down and we can see what metrics we're not doing so well on and we can even scroll down further and we can see what google suggests that we do to improve our site so we can see here that it recommends removing some unused javascript and we can see what those bundles are and then maybe we can review this and be like you know what i don't need chat governance i'm just going to remove that on this page or something like that back to the new feature that is being added to this tool adi from the google chrome team recently tweeted that if javascript libraries are proving costly replace them with smaller alternatives lighthouse and chrome dev tools now recommend smaller libraries that improve bundle size and then they showed a screenshot where moment.js was taking 70 kilobytes and they were showing that you could potentially save a bunch of kilobytes by switching to djs date functions or luxon and a bunch of people are not happy with this new feature paul says i'm someone who always recommends lightweight library alternatives and i don't like this i think this hurts the open source community it shames libraries without any context and discourages people to search for alternatives themselves which hurts lesser-known libraries from what i've seen most people aren't really upset about this specific suggestion like replacing moment.js with djs or luxon or date functions most people would agree with and even moment.js has documentation on hey you probably don't even need to use us a little bit after the lighthouse feature was announced moment put out a project status and a few key points from this number one they address chrome devtools and they said they started showing recommendations for replacing moment for this size alone we generally support this move that we recognize that many existing projects may continue to use moment but we would like to discourage a moment from being used in new projects going forward and probably the most important part we now generally consider moment to be a legacy project in maintenance mode it is not dead but it is indeed done but what people are upset about is the general idea of google suggesting one library over another library just based on the size of them because on size alone that doesn't tell the whole story of whether one package is better than another package or which one you should be using an example of where this gets dicey is now when i run lighthouse on well any react website is it now going to be like hey you got this super large thing called react on your website have you heard of preact and by the way it may or may not be sponsored by google because if that's the case i 100 agree with rich here whenever i run lighthouse on any website that uses angular or firebase you better believe i want to see an alternative just for kicks i figured we'd search up angular and see how big we're really talking here so search angular and bundle phobia and hmm you know what i don't know which one of these we're actually supposed to do because i'm still pure so i'm gonna go ahead and guess we need angular core i'm gonna go on a limb here and let's see what we got oh my 86.9 kilobytes minified and g-zipped now just for reference let's go get moment uh-oh that's only 70.4 kilobytes hmm are you guys like see are are you saw that right that wasn't just me like yeah yeah i'm i'm not gonna say anything but you saw that right so um yeah i'm just gonna like extend the logic a little bit here if google is doing us a service by giving us alternatives to moment think of how much good google would be doing by giving us alternatives to angular i'm just looking out for the best interests of the web although now that i think about it if google did do that that might be kind of problematic we'd have a shortage of carrots i'm actually a little bit too scared to pull up firebase right now i don't know how fat firebase is but i'm a little bit scared to look right now and i don't want google getting too mad at me so we'll just brush that one under the rug anyway google giving alternatives to libraries is not really so simple how does google decide what is an alternative for what library how do i get my library which may not be very popular onto that list should it be on that list is it based on the number of github stars that a library has that shows up as an alternative or is it only based on like how small your library is the smallest library is at the top then it comes into well how much functionality should overlap what happens is my library is very small but it can't do everything the larger library can do which is why the larger library is so big and then you also run into problems well hey that library didn't just get large for fun it's because that library has a lot of functionality or has something so does that mean these alternative libraries are now going to get bombarded with a bunch of new users that are asking for new features because they're missing some functionality later on addie tweeted there are a few good ideas in the thread that we can follow up on number one soften the language number two explore a column dock listing feature differences between alternatives size is just one factor and three make it clear that recommendations are based on bundle phobia short term focused on moment and low dash if it ends up being something for just moment and low dash it's kind of like whatever and i think that's totally fine but if they're trying to expand this to a bunch of other packages i think they're gonna get more backlash and i just don't think that's a good way about it i think the solution is very simple and i even saw somebody tweet at him about it and that is to remove the alternatives altogether i think it's fine if you want to point out hey your website has 80 kilobytes of moment on it or whatever but i just don't think you need the alternative part at the end of the day the purpose of lighthouse is to give you tips on how to improve the performance of your website and well having a bunch of javascript on the page is going to slow it down so i do think it is good that they have stuff like this that is like hey look you got these three packages that are super fat that are slowing down the load time but i think it is just problematic trying to give alternatives to those three packages you
Info
Channel: Ben Awad
Views: 156,589
Rating: undefined out of 5
Keywords:
Id: KfU2mPwVE8E
Channel Id: undefined
Length: 8min 37sec (517 seconds)
Published: Fri Sep 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.