Google Knows Best

Поделиться
HTML-код
  • Опубликовано: 25 авг 2024
  • Google is introducing a new feature to lighthouse that'll detect large javascript packages and suggest alternative ones you can use instead to decrease the size of your bundle.js
    #benawad #google
    ----
    Checkout my side projects:
    If you're into cooking: www.mysaffrona...
    ----
    Join the Discord: / discord
    ----
    Patreon: / benawad
    ----
    Follow Me Online Here:
    Twitter: / benawad
    Twitch: / benawad
    Medium: / benawad
    GitHub: github.com/ben...
    Facebook: / benawad97
    LinkedIn: / benawad
    Instagram: / benawad97
    TikTok: / benawad ​

    ----
    Follow me online: voidpet.com/be...
    #benawad

Комментарии • 458

  • @AmitDubey-hi2sw
    @AmitDubey-hi2sw 3 года назад +239

    Other: Put girls for clickbait
    Ben: Angular

  • @LetterSignedBy51SpiesWasA-Coup
    @LetterSignedBy51SpiesWasA-Coup 3 года назад +949

    “Size is just one factor.” That’s going on the Tinder bio.

  • @aberdeener
    @aberdeener 3 года назад +955

    Respect to the momentjs team for handling it like that.

    • @RoyRope
      @RoyRope 3 года назад +7

      Agreed

    • @xadasol8692
      @xadasol8692 3 года назад +27

      I personally think they let themselves down by addressing it on their website, they shouldn't have cared what Google says, just because Google doesn't seem to like them, it doesn't mean they should stop doing all the good work they've been doing!
      What a total waste from Google Chrome team, I'll be uninstalling my Chrome and use alternatives!

    • @adammoussa7295
      @adammoussa7295 3 года назад +27

      @@xadasol8692 I think momentjs have been doing that before Google started recommending smaller libraries

    • @matthewcullum2455
      @matthewcullum2455 3 года назад +11

      @@adammoussa7295 Yeah, I think people saw this coming. I'm a long-time Moment user but had started moving on to smaller and simpler libraries long before Google or the Moment team started recommending other options. Mad respect to the Moment team for handling it the way they did.

  • @noahnolte7288
    @noahnolte7288 3 года назад +238

    "Put simply, I like my websites, like I like my hamburgers. *thick*"
    - Ben Awad 2020

  • @udaysamsani5599
    @udaysamsani5599 3 года назад +304

    It would be even fun if lighthouse gives us an alternative to lighthouse itself😎

    • @FunctionGermany
      @FunctionGermany 3 года назад +24

      lightlight.js

    • @lusac3419
      @lusac3419 3 года назад +8

      lighthut

    • @pmartin
      @pmartin 3 года назад +11

      Happy to announce yal, stands for "Yet Another Lighthouse"

    • @ahmadmuslih
      @ahmadmuslih 3 года назад +14

      Litehouse

    • @udaysamsani5599
      @udaysamsani5599 3 года назад

      @@ahmadmuslih very well lite indeed 😂

  • @vutesaqu
    @vutesaqu 3 года назад +216

    Not going to lie, would like to see what sort of "lightweight alternatives" Google would show to Angular

    • @FunctionGermany
      @FunctionGermany 3 года назад +52

      jquery

    • @honor9lite1337
      @honor9lite1337 3 года назад +3

      @@FunctionGermany isn't that dead?

    • @antoniostipic4920
      @antoniostipic4920 3 года назад +11

      @@honor9lite1337 By Lighthouse's logic, doesn't matter. Just needs to be smaller.

    • @honor9lite1337
      @honor9lite1337 3 года назад

      @@antoniostipic4920 understood.

    • @RexGalilae
      @RexGalilae 3 года назад

      @CPP.MASTER
      Vue is enough tbh. It combines react, react-dom, react-router and more while having a way smaller package size and using tree-shaking

  • @MeatCatCheesyBlaster
    @MeatCatCheesyBlaster 3 года назад +112

    Did you just say "Hole everyone"

    • @chantz2400
      @chantz2400 3 года назад +2

      @@randerins I mean he's pretty handsome. I'm down. 🤠

  • @yoooyoyooo
    @yoooyoyooo 3 года назад +341

    Comparing moment to angular is like comparing apples and planets.

    • @BleedingCode
      @BleedingCode 3 года назад +16

      Agreed. I also felt it was a bit unfair to compare Angular to Moment. (Edit: I was informed to "hear beyond what I heard" in that quote, as it was just playful mocking of Angular)

    • @bryanoverbey
      @bryanoverbey 3 года назад +28

      Its a joke bro. Ben just doesn't like angular so he was joking and saying google should suggest to remove angular

    • @Xenas2127
      @Xenas2127 3 года назад

      Looks the same to me

    • @BleedingCode
      @BleedingCode 3 года назад

      @@bryanoverbey Hmm ok fair enough. Being newish to his channel I didn't catch that.

    • @BleedingCode
      @BleedingCode 3 года назад +2

      @@internet4543 👍 😎 - I'm a huge React fan. In defense of Angular I made the decision to go with React when Angular was still V1.2. I actually have no idea how Angular now compares.

  • @Nerketur
    @Nerketur 3 года назад +32

    As an Angular dev, I can absolutely agree that angular is BIG.
    However, that's why you use the angular CLI and webpack (by default) to shrink the code and make it smaller.
    (It will still be big to develop with, but the actual size of the webpage is rather small in comparison to how big it is with developing)

    • @angelbythewings
      @angelbythewings 2 года назад

      its still bad, too big and compilation times take a hit on larger applications

  • @vivek4634
    @vivek4634 3 года назад +58

    While not supporting the move by Google ,
    Angular is a whole ass frame work . Not a utility library.

    • @n8guy
      @n8guy 3 года назад +1

      That's why I keep asking the Moment team to add templating, state management, DOM interaction, and routing.

    • @infiniti2011
      @infiniti2011 3 года назад

      @@n8guy ha lol

  • @nerdophile6945
    @nerdophile6945 3 года назад +57

    Don't you think its pretty dumb to compare a bundle size of moment js (date library) to angular framework .

    • @wazbat1
      @wazbat1 3 года назад +8

      @@internet4543 nice copypasta

    • @nerdophile6945
      @nerdophile6945 3 года назад +17

      @@internet4543 you are questioning my IQ where you can't understand the difference between a good or bad joke, and you defending a dumb joke. You are kind of a normie who like Amy Schumer's stand up just because she is famous.

    • @nerdophile6945
      @nerdophile6945 3 года назад +7

      @@internet4543 I m using react in production for past 2 years and I never used angular framework in my life. So you think I m just arguing for angular that's pretty dumb tbh

    • @chrismanning5232
      @chrismanning5232 3 года назад +1

      @@internet4543 found Ben's 2nd account. Defending his stupid takes in every comment thread.

    • @DavidJJJ
      @DavidJJJ 3 года назад +3

      I agree, it's a bit stupid to compare the two. Angular isn't a browser based bundle, it runs on the local machine, whereas moment has to be downloaded by the client.

  • @MarvinTurner
    @MarvinTurner 3 года назад +69

    To be completely fair, you should have pulled up react & react-dom in bundlephobia. Although roughly half the size of moment.js, react-dom was larger than I expected.

    • @RexGalilae
      @RexGalilae 3 года назад +14

      Throw in more essentials like react-router and a state management library too if you want a fair comparison with angular tbh.
      Imo, Vue does it best by combining a relatively small package size, the holistic framework-level functionality of Angular and has tree shaking out-of-the-box.

    • @pulga961
      @pulga961 3 года назад +3

      preact have all functionality as react but its just 8kb with react-compat. removed syntetic event, removed old code from 2013-2015 that react is keeping for backwards compatability

    • @mthf5839
      @mthf5839 2 года назад

      @@RexGalilae Svelte with 0kb...
      I guess you were just trying to compare the biggest three.

    • @RexGalilae
      @RexGalilae 2 года назад

      @@mthf5839
      Yep, I was. I haven't used svelte

  • @samrathchauhan1271
    @samrathchauhan1271 3 года назад +4

    Google Interviwer: Can u optimize this algo a bit more
    Me who watch ben: U can't ask me that u guys don't even optimize angular.

  • @3151415182181519
    @3151415182181519 3 года назад +28

    "I'm going to go the new reddit for the second time in my life" 😂 hilarious

  • @RoyRope
    @RoyRope 3 года назад +6

    Comparing libraries just by size is silly, but warning for large libraries is a good thing. So I agree with you mostly.

  • @BleedingCode
    @BleedingCode 3 года назад +17

    I love these little gems. I didn't even know about Bundlephobia until this video. Thanks for that 👏.

  • @Ajay-km8br
    @Ajay-km8br 3 года назад +1

    Lol this guy just never stops. It is so much fun watching someone make an idiot out of themselves again. And again. And again. And again

  • @pantanom18
    @pantanom18 3 года назад +75

    back in the days programmers were trying to reduce programs size and improve O time

    • @edwingarcia5043
      @edwingarcia5043 3 года назад +1

      this happenes all the time

    • @pulga961
      @pulga961 3 года назад +5

      the biggest problem is when is loaded...Most of the time all code is loaded on initial load it can be splitted for example using webpack dynamic import

    • @vishalasthana8998
      @vishalasthana8998 3 года назад +18

      And yet in interviews they expect you to write a sorting algorithm that works in linear time. No matter how slow their actual products are lmao

    • @troy856
      @troy856 3 года назад +2

      @@vishalasthana8998 "sorting algorithm that works in linear time"
      HMMMMMM

    • @vishalasthana8998
      @vishalasthana8998 3 года назад +2

      @@troy856 That was the point of the joke in case you missed it

  • @MrSupdup
    @MrSupdup 3 года назад +4

    Moment - A couple of simple utilities
    Angular - An all-in one web framework
    Who compares these two things next to each other? Obviously the lighthouse team would never flame you for using an 80kb framework, it's about using a util library that takes up as much space as an entire framework.

  • @paulngisiro1842
    @paulngisiro1842 3 года назад +82

    I've used Angular and React, and I've watched so many of Ben's videos bashing Angular. Not even him can convince me that React is better than Angular.

    • @kenocvr
      @kenocvr 3 года назад +29

      It's a meme at this point or he doesn't know what he's talking about. He even conflates Angular with Angular.js.

    • @compton8301
      @compton8301 3 года назад +11

      That's the truth. Frameworks are just tools, Ben acts like Facebook is paying him for this pathetic marketing.
      It's called "unconscious bias".

    • @wazbat1
      @wazbat1 3 года назад +18

      @@kenocvr I'm convinced it's the latter here. If you're going to repeatedly bash something, at least educate yourself on it. People watching these videos treat him like some front end expert and just form their opinions as copies of this

    • @laoblue9302
      @laoblue9302 3 года назад +8

      its hard for him to convinced users which know on what areas Angular is better than React, because he's offending those users somehow. i like using Angular, but it's funny to listen to him, it keeps me entertaining.

    • @ahahn928
      @ahahn928 3 года назад +1

      @@laoblue9302 Name one area where Angular is better, I'll wait.

  • @ikeo8666
    @ikeo8666 3 года назад +1

    * microsoft has entered the chat
    microsoft: have you ever heard of blazor?

  • @nt4f04und
    @nt4f04und 3 года назад +4

    6:40 it's based on how good tree shaking works l o l.
    like the problem of moment as it does not handle it at all, while other libs do, which means they don't necessarily have less functionality at all

  • @antoniostipic4920
    @antoniostipic4920 3 года назад +38

    Comparing javascript library dedicated to date and time manipulation vs one of the leading web frameworks and bashing it because it is only 10kb larger? Yeah, big brain time.

    • @06kellyjac
      @06kellyjac 3 года назад +15

      Ignoring the fact Ben is very sarcastic and is happy to unfairly bash Angular for the sake of comedy? Yeah, big brain time.

    • @ashutoshkaushik9118
      @ashutoshkaushik9118 3 года назад +1

      Antonio Stipić Go on and try to compare angular with react. That’s 84kb vs 2.4Kb so uhm...

    • @antoniostipic4920
      @antoniostipic4920 3 года назад +5

      @@06kellyjac Well just like the lighthouse is suggesting using smaller libraries without any real reason and it results in people using inferior libraries, same thing is happening here where Ben is "sarcastically" bashing Angular without any real evidence which causes people to "use inferior libraries instead". Iykwim

    • @antoniostipic4920
      @antoniostipic4920 3 года назад +9

      @@ashutoshkaushik9118 You forgot to count tens of other packages react needs to barely have all functionalities Angular has with that single package.

    • @divyayk9960
      @divyayk9960 3 года назад +2

      I agree with Ben here when he says size shouldn't be the only factor to compare but I also agree with @Antonio Stipic because even though bashing angular is for the sake of sarcasm, it pretty much seemed like butthurt act when he concluded the video with "no, thank you for the alternatives"

  • @CardinalHijack
    @CardinalHijack 3 года назад +8

    Google wants to speed up the web to serve more ads, its as simple as that. Their team are masking this as Google caring about the web (which is also true) however its primary goal is to serve more ads. Eventually, there was going to be a conflict of interests between appearing to care about the web, and wanting to speed up the web to serve more ads.
    This is that intersection I think. This move harms the web, however it speeds up the web to serve more ads.

  • @megapixeler
    @megapixeler 2 года назад +12

    I've been kind of forced to adopt Angular in my workplace if I wanted to stay in the projects that I've been working on for more than 8 years now (Basically I started them when they hired me, the projects grew, so they hired more devs which thought including Angular into the most recent ones was a great idea without asking my opinnion first)... Long story short, the developers that adopted Angular for said projects have left for other jobs, and I had to continue their development/support... The result is that I hate with a passion the big, fat, ugly beast that Angular is. If you are new and wondering if Angular is a good choise, please stop considering it, even more so if you are thinking of using it along angular material or some other big dependency like that. Do yourself a favor, choose to be happy, use anything else.

    • @IronJmo
      @IronJmo 2 года назад +1

      Are they going to replace the dev that left? Maybe you can keep it going for a few weeks then get back to doing something you enjoy.

    • @dipanjanghosal1662
      @dipanjanghosal1662 2 года назад

      Damn bro

  • @nelsonking
    @nelsonking 3 года назад +41

    I don't think the point of this video was to take shots at Angular.
    I've done a lighthouse report on my Angular and React websites and the react websites largely did better. There doesn't seem to be any bias against React so ya'll need to chill.

    • @ashutoshkaushik9118
      @ashutoshkaushik9118 3 года назад

      yeah its a meme video anyway i s'pose

    • @offensivebeefroast5407
      @offensivebeefroast5407 3 года назад +2

      @Vizman216 if your website is built on that framework ( I know react is not a framework ) what's the point in suggesting an alternative ?
      Are you gonna rework it just because of a light house score. You picked the framework for a reason right ?

  • @jonathanzhang53
    @jonathanzhang53 3 года назад +2

    for those wondering, firebase is 791.3kb minified and 219.9kb minified + gzipped

  • @pkcc9381
    @pkcc9381 3 года назад +36

    Seriously I didn't expect you to be that silly to compare moment with Angular

    • @pkcc9381
      @pkcc9381 3 года назад +14

      @@internet4543 I am not saying Angular is better but it is a Senseless comparison & Sarcasm is different from stupidity. Btw I am a Contributor to the React library.

    • @pkcc9381
      @pkcc9381 3 года назад +3

      @@internet4543 In the lighthouse Suggestions we can clearly see it is suggesting alternatives based on overlap of Functionality. If you don't wanna consider them then dont, no one is forcing you to use the alternatives.

    • @ufufu001
      @ufufu001 3 года назад +6

      @@internet4543 bro when this many people can't tell whether someone is being sarcastic or not, there's a high probability they're not the problem. maybe the other party is just not that good at sarcasm...

    • @ufufu001
      @ufufu001 3 года назад +1

      @@internet4543 also major props for the funny ass joke. you should try replying every single comment about angular with it. it's just that good of a joke. i can't get enough of it

    • @ufufu001
      @ufufu001 3 года назад

      @@internet4543 oh i can't. Facebook is not welcome in this house

  • @bakkks
    @bakkks 2 года назад

    The jokes cracked between the lines are life expectancy increasing

  • @hermanlit560
    @hermanlit560 3 года назад +3

    Sooo 70kB for the library from which you're using up to ~10 methods VS 87kB for the core that allows your entire web app to run. A bit different things imo.

  • @FauzulChowdhury
    @FauzulChowdhury 3 года назад +37

    Waiting for the day when Ben actually reads up and uses angular and faces reality. 😂

    • @a12356ut
      @a12356ut 3 года назад +15

      I dont think he has worked with large teams, or at least a company that works on multiple different products that share the same tech stack. Angular as an all in one framework for environments like that are truely invaluable in quickly getting everyone to work off of the same page.

    • @FauzulChowdhury
      @FauzulChowdhury 3 года назад +2

      @@a12356ut just moved my team to nx monorepo and we are doing react. Getting the powerful angular CLI and a very nice consistent architect.

    • @tonskreee6213
      @tonskreee6213 3 года назад +5

      his IQ cant handle it.

  • @adriannlara
    @adriannlara 3 года назад +33

    you can't compare a date library with a framework

    • @amritanshurai4428
      @amritanshurai4428 3 года назад +7

      Yeah! He is talking as if he uses react alone in the production and doesn't add any mandatory routing and state management libraries.

    • @seanghay_yath
      @seanghay_yath 3 года назад +6

      React alone is just way too useless

    • @wazbat1
      @wazbat1 3 года назад +3

      @@internet4543 Holy hell I keep finding more of your comments I scroll down
      Imagine being a simp for a frikin' JS framework, like damn

    • @seanghay_yath
      @seanghay_yath 3 года назад +1

      @@internet4543 Hey! I've been working with React since 2017.

  • @ChristopherCricketWallace
    @ChristopherCricketWallace 3 года назад +3

    I think that, while problematic, suggesting (presumably vetted) alternatives saves me research time. People can use their judgement and choose something else. It was a SUGGESTION.
    I understand the politics of the features; but I think we have MUCH bigger issues in our industry then influence suggestions from a developer tool.

  • @GlennMartin
    @GlennMartin 3 года назад +2

    Wow didn't know Angular was that small almost the size of MomentJS.
    He must have a lot of fan bois to be able to produce this content.

  • @amguruprasath8037
    @amguruprasath8037 3 года назад +3

    Comparing Angular framework which is a full-fledged application development framework to Moment.js classic move bro.

  • @fabienliegard7038
    @fabienliegard7038 3 года назад +7

    Angular vs Moment ? Not a fair example

    • @joeldeleon6470
      @joeldeleon6470 3 года назад

      Discouraging Moment due to size but not discouraging Angular -that is OBVIOUSLY bigger- was his point. It was not a comparison between libraries.

    • @lachlancresswell6074
      @lachlancresswell6074 3 года назад

      Joel de Leon yes but Lighthouse doesn’t recommend any old smaller lib, it recommends smaller libs offering the same functionality and moment and angular do not offer the same functionality

    • @DavidJJJ
      @DavidJJJ 3 года назад

      @@joeldeleon6470 Angular core isn't even a browser based library though, it's a local development library. It's like comparing the source code of the VS Code application to a web page, they are totally different things.

  • @inasuma8180
    @inasuma8180 3 года назад +1

    i like that ben is a fully aware meme lord

  • @PaulSebastianM
    @PaulSebastianM 3 года назад +1

    Ben, Google did give us an alternative to Angular. It's Polymer and it's even bigger.

  • @jonesbbq307
    @jonesbbq307 2 года назад

    Bruh. Lighthouse is just giving devs info. It’s not like they force you to do it. It is up to the devs to decide for themselves which package to use.

  • @benaloney
    @benaloney 3 года назад +1

    Lighthouse is slowly turning into Microsoft Clippy...
    "Hey there, look's like you're trying to write a web app!
    want me to help choose a performant package?"

  • @sbrugby1
    @sbrugby1 3 года назад +6

    Dan Abramov's ears are burning

  • @ismannyb8148
    @ismannyb8148 3 года назад

    Flutter is the future angular is was just a stepping stone

  • @misha130
    @misha130 3 года назад +1

    It's not @angular/core it's core and 7 other angular packages + zone.js & rxjs

  • @khaledmaruf5813
    @khaledmaruf5813 3 года назад +2

    How can you compare Angular-Core library (which is a full blown front end framework) size with moment (which is only a datetime utility).
    IMHO, Angular-Core being 80 kbs shows much better in size than moment being 70 Kbs.

  • @pokefreak2112
    @pokefreak2112 3 года назад +2

    It would be better if they'd only complain when you use a fraction of a bloated library. Encourages people to make their library tree-shakable. Suggesting alternatives is fine by me but it would need to be intelligent and only suggest libraries that actually have the features you need

  • @shadowbanned3136
    @shadowbanned3136 3 года назад

    Google: This product isn't good for you. Please replace it with our product. Trust me bro.

  • @vinayakshahdeo7578
    @vinayakshahdeo7578 3 года назад

    The lighthouse joke was gold pure gold

  • @KyleLanmon
    @KyleLanmon 3 года назад

    I think the problem with removing recommendations altogether is that people will say, "yeah lodash is huge, but it is the only option". google are not saying "though shalt use X library", but just saying that there are more options.

  • @jvcmarc
    @jvcmarc 3 года назад

    google: hey, momentjs may be a bit too big for this project
    momentjs: guess I'll die

  • @MikeNugget
    @MikeNugget 3 года назад

    A long ago I decided than Angular is more suitable for inner corporate projects only where the bundle size is not the criteria

  • @trophieboi1820
    @trophieboi1820 3 года назад +12

    the bundle size of my angular app with firebase in production is 1.4mb!!!
    *I'm switching to svelte.*
    yes. I tree-shaqed and used all of the compiler techniques like --prod and shit like that.
    the development build is around 7mb.
    it takes around 5-10minutes to compile on i3-2100.

    • @yeicore
      @yeicore 3 года назад

      10 min to compile? What the heck have you been doing?! Even for Angular it's toooooo much...

    • @AlexAegisOfficial
      @AlexAegisOfficial 3 года назад +2

      i3-2100 and you're wondering. My 4 year old PHONE has almost twice the performance of that.

    • @trophieboi1820
      @trophieboi1820 3 года назад

      @@yeicore its just a slow PC.
      and angular just complements it. also npm is slow so... it just adds up.

  • @9997eman
    @9997eman 2 года назад +1

    How can you compare a framework to a npm package that doesn’t make sense.

  • @saqlainalvi3333
    @saqlainalvi3333 3 года назад +1

    What about pulling up react on the bundle phobia too? Throw in the react dom and routing and I doubt the size will smaller than angular

  • @DiegoArcega1
    @DiegoArcega1 3 года назад +5

    I disagree with your opinion here. Showing alternatives doesn't do any damage. The developer will take a look at the alternatives and see if it suits their needs, if not, then just continue using what they are already using. It is just a recommendation...not enforcement

  • @Vaaaaadim
    @Vaaaaadim 3 года назад +2

    "Recently, Chrome Dev Tools started showing recommendations for replacing Moment for the size alone. We generally support this move."
    Moment: *Thumbs up crying cat meme*

  • @rohitsingh-zj2ut
    @rohitsingh-zj2ut 3 года назад +1

    Wouldn't @angular/core bundle be tree shaken after enabling Ivy?

  • @n.kh.l
    @n.kh.l 3 года назад +2

    Wow, love the coordination! Red shirt for an angular video.

  • @ladanski
    @ladanski 3 года назад +1

    Comparing @angular/core to moment.js is like comparing optimus prime to a toy lawnmower.

  • @JuanPablodelaTorre
    @JuanPablodelaTorre 3 года назад +2

    What's an actual alternative to Angular?
    No other framework really compares.

  • @alison.aguiar
    @alison.aguiar 3 года назад

    Angular core don't go to production ,after build is created chunks files. Very very smalls.

  • @skyyconnected
    @skyyconnected 3 года назад +1

    Can you explain your Ajani picture in the background? And if you are into magic, can you talk a bit about your magic exposure/experience?

  • @metropolis10
    @metropolis10 3 года назад

    Maybe it could be an opt-in system? For packages that know they are just in maintenance mode and that more modern alternatives exist?

  • @youneszadi2332
    @youneszadi2332 3 года назад

    i think we should keep the alternatives and let it to the développer's duedeligence to decide what to do

  • @bestergester4100
    @bestergester4100 3 года назад +2

    Just use Svelte. Checkmate

  • @newcomer4220
    @newcomer4220 3 года назад

    I use vanilla for everything for client-side operations and C++ and PHP for server-side...so I don't care what lighthouse recommends and I also don't have any love for a particular library.

  • @nikilk
    @nikilk 3 года назад

    Lighthouse detects application created using Microsoft Blazor. Lighthouse illustrates a shipwreck and gives up!

  • @varunrajput8083
    @varunrajput8083 3 года назад +2

    HOLE BEN!!!! 0:00

  • @sidneyduncan-steele2792
    @sidneyduncan-steele2792 3 года назад

    The trick is to use lodash, but in electron so file size isnt an issue ;)

  • @udaysamsani5599
    @udaysamsani5599 3 года назад +15

    Thanks ben for info. Google is trying to mass hypnotize us the developers who are in coffee addiction 😂

  • @vishalsundararajan1228
    @vishalsundararajan1228 3 года назад

    i would suggest all browsers should come with most popular libraries built in with their browser so that we don't need to download them in the first place.

  • @ajdeu3pm
    @ajdeu3pm 3 года назад +1

    Worst part here is that those values are not correct. they are based on bundlephobia and do not acurately reflect on size of package that has been tree-shaken by webpack

  • @limlam22
    @limlam22 3 года назад

    I literally opened this video with a lighthouse score of 6, 8, 100, 5 sitting on my other monitor

  • @tiedye001
    @tiedye001 3 года назад +1

    What's wrong with Angular?

  • @fernandolener1106
    @fernandolener1106 3 года назад

    Google want to reduce javascript payload so their robots use less bandwidth

  • @rachellejanssen2655
    @rachellejanssen2655 3 года назад

    me: *punches keyboard to try to modify and display 1 single date* fuck it, I'm installing moment.js!

  • @romanhimmes171
    @romanhimmes171 3 года назад

    To reject frameworks in general does not mean that you should not use utility libraries..

  • @TeddyBearItsMe
    @TeddyBearItsMe 3 года назад

    I woupd rather have that kind of analyze on security, if a library has a vulrnability in a version you are uaing it will motivate maintainers and developers to fix/update the libraries. Which is gonna make the web a safer place overall, which is much more important than half a second wait time for downloading 100kb library.

  • @arupdash5904
    @arupdash5904 3 года назад +1

    Just did a fair comparison :
    Angular - (core + common + router + platform-browser-dynamic) ~= 142KB.
    React - (react + react-redux + redux + redux-saga + react-router) ~= 60KB.
    Let's have a moment of silence for all the "Angular" guys reading this comment 😜

  • @rand0mtv660
    @rand0mtv660 3 года назад +1

    Lighthouse is nice and Google likes to promote "best practices" and so on, but the funniest thing is that most of the time you check that "Remove unused JavaScript" section it's Google's libraries that are top offenders. Google Analytics and Maps are often at the top of that list because they are huge JS bundles and because they are widely used libraries this problem occurs on many many websites.
    Btw, maybe you should change your channel name to "Ben Awad Comedy", because judging by your comments people really don't realize that you are sarcastic most of the time with what you do.

  • @markdlp
    @markdlp 3 года назад

    Well I'd guess that generally speaking the more a library follows the Unix philosophy, the better.

  • @josecelvinrivas
    @josecelvinrivas 3 года назад +5

    You are comparing a library vs the framework, and the size are almost the same, BTW Reactjs is too big to be a library

    • @lgiorgos1
      @lgiorgos1 3 года назад

      React is not big at all. React-dom and react-router are big. Also it is not a framework. But create-react-app is a framework in my opinion

  • @injokermeowmeow8252
    @injokermeowmeow8252 3 года назад

    It's like Angular was made by your ex that may be has been bullying you, and you hate it so much.

  • @collinslagat3458
    @collinslagat3458 3 года назад

    I personally didn't know dayjs existed. I was complacent with momentjs. The recommendations are fine by me. Although, it may create a tunnelling effect where people only focus on THOSE packages without doing research.

  • @ShahidFoy
    @ShahidFoy 3 года назад

    Not a good example to compare the size of the angular libs... You know those are just tools angular provides to help developers create the frontend app. In the end you BUILD and COMPILE your code into static files. You don't deploy the soucecode into the server you fool just the compiled result of the angular build. your production build.. which turns out to be relatively small

  • @chuangcaiyan7114
    @chuangcaiyan7114 3 года назад

    but the function of angular and moment.js are different..moment are just for manipulate times on js and angular it's a entire framework

    • @DavidJJJ
      @DavidJJJ 3 года назад

      I know I facepalmed when he compared the two bundle sizes, as if the whole angular core loads in the browser!

  • @Jonathan-ee4rn
    @Jonathan-ee4rn 3 года назад

    Maybe I’m missing something but why hasn’t anyone built a tool to recompile these libraries with only the functionality you’re using in a particular project. Just map the package as a DAG and cut any branches that don’t link to a function your project uses. That way if you’re only using two functions in react, that’s all that gets loaded.

    • @doc8527
      @doc8527 3 года назад +1

      The thing you are saying is called Tree shaking, it's used to reduce the bundle size on production. But you are underestimating the size of some core frameworks and libraries. They are large on fundamental not just because of functionalities but also compatibility, stability, etc. Moment.js, jQuery will be long-live for same reason.
      Many "new" libraries claimed that they beat XXX in term of size but often lack of compatibility overall and you have to figure out how to fix their own problems and could end up creating something as large as the old one you are using.
      That's why good developers always try to figure out some new solutions based on the old one.

  • @mr.somebody6368
    @mr.somebody6368 3 года назад +2

    euhm... just search for angular instead, like you did with moment. I don't like angular either but I saw what you did there. :)

  • @eliya.c
    @eliya.c 3 года назад

    That's not a real comparison... When your compile angular framework, you get a tree shaked bundle with only the deps you need (a few kb). While moment, isn't tree shakeable at all. Your whole point is lead by misconception about angular. They probably have made a mistake giving specific alternatives, but they sure did right when they suggested one.
    PS, I'm developing both on React and Angular and I'm not a lib/framework fanatic. In case you were about to call me "Angular fan".

  • @thepickicool97
    @thepickicool97 3 года назад +10

    I actually think that this is a good idea from Google. I don't understand your point here.
    I love to have suggestions on how to optimize my websites.

    • @offensivebeefroast5407
      @offensivebeefroast5407 3 года назад +6

      He just doesn't like google or angular for the matter.
      So he is just taking a stab at google and nothing else. This video is just a funny meme and nothing else
      TBH I liked that feature as well, but I agree with one thing he said. Like just discouraging people to stop using a library just because of size alone is not a good thing.

    • @gnack420
      @gnack420 3 года назад +1

      @Ian Bentley in what way does Google benefit from you using dayjs instead of momentjs?

  • @zakuro8532
    @zakuro8532 3 года назад

    "I have a confession to make: I am a web developer. (...)"
    gulag.

  • @rishabhanand4270
    @rishabhanand4270 3 года назад

    In my opinion I don't think Google ever intended to shit upon libraries. The smaller the bundle size the easier your website will do in general on 2g or 3g connections. It's always been up to the developers to choose what libraries they need (unless you're under bad mgmt). Usually people pick libraries by popularity which makes sense as there is going to be more trust and safety and if Google starts promoting libraries for smaller bundle size, I think it will promote people reducing their bundle size of their libraries which is a good step. Atleast that's what I think. If you're using lodash, you might not need the trillion things that come along with it, use the seperate libraries for each of those functions.
    Using bundle splitting, tree shaking, analysing source maps, it's all part of the development cycle to get the right optimized website.
    I don't think people should make the open source community feel competitive, if I write a big library that runs on any platform there is, and one boi copies it and makes another library super performant for safari, let it be. It's a positive step and the open source community got better.

  • @bandosbandos
    @bandosbandos 3 года назад +1

    Just change it to: we noticed you are using this package to achieve this goal. This package is larger than similar packages. It might be worth it to consider an alternative.

    • @bandosbandos
      @bandosbandos 3 года назад

      I should watch till the end before I comment

  • @brtk7
    @brtk7 3 года назад

    Is it possible to analyze code and bundle only part of a library that we really used? 🤔

  • @GiulioZelante
    @GiulioZelante 3 года назад +1

    You're comparing an entire framework (Angular) vs a date library (moment.js) size? Are you serious? I'm not saying Angular is lightweight, but it's a framework at least, it handles EVERYTHING (or almost). At the same time I'm the one who is alson considering experimenting with Svelte.js + Supper.js combo to see if there are benefits

  • @RangaPrakashs
    @RangaPrakashs 3 года назад

    Google should replace itself with a smaller version of a company, because its too large.. We suggest duck duck go.

  • @ZachMeador
    @ZachMeador 3 года назад

    currently respecting the very dense amount of wit in this video

  • @AlecHalePletka
    @AlecHalePletka 3 года назад

    I miss the days when Ben openly dunked on Angular. *shakes fist at sky* Damn you Dan Abramov

  • @dilshanliyanage
    @dilshanliyanage 3 года назад +6

    How can you compare the bundle size of Angular core and moment? Moment is about dates while angular is a whole framework 😂

  • @migueldomingos4570
    @migueldomingos4570 3 года назад +1

    Btw firebase is 219kb...

  • @Mia12946
    @Mia12946 3 года назад

    webpack is 600mb and 100,000 files with all its deps.