Hacker News new | past | comments | ask | show | jobs | submit login

You do realise that 5KB is bigger than most text content you'd ever display on a webpage? You know how many things can go wrong when trying to download 5KB on flaky public Wi-Fi or overloaded cellular connection? And you're telling me it is no big deal to be loading that with no actual benefit to the user?



Sorry but 5kb is absolutely nothing for today's Internet connections, public WiFi or overloaded cellular connection or something else, especially if it's provided by a cdn. Yes, it is absolutely no big deal to be loading 5kb. Come on, be serious.


The problem is not the CDN, it's the last mile. You seriously overestimate public Wi-Fi and shit cellular networks; there are times where a simple HTTP request returning dozens of bytes of text will fail. In these moments every byte matters and personally if I'm going to make my user download 5kb of data I will make sure it's content they care about, not a JS framework.

Let's take the example of London Underground's Wi-Fi. It's only available at platforms, not while the train is travelling between stations. When the train arrives into the station it will stay there around 10 seconds. 5 seconds of those are wasted by the phone finding the network and authenticating to it, which means you've already got only 5 seconds before the train goes away and the connection drops off. During those 5 seconds you have lots of apps in the background (push, e-mail sync, background app refresh, etc) that are all fighting for around 1Mbps of bandwidth.

There's also the issue of failing gracefully. If CSS or image loading fails the browser will still display the bare HTML and the user will still have their content in a consumable format. If JS fails to load in an SPA the page is unusable and often shows just a blank screen. If SPA-initiated requests fail it's up to the developer to handle the exception and offer the user a way to retry instead of just giving up and waiting for a page reload.


As someone who used to commute through London on the tube and knows the underground wifi very well, you take on board the limitations of the connection. And you know the connection is going to fluctuate so you're not going to be doing anything serious.

Broken images and incorrectly loaded CSS can also break pages and make them unusuable so where do we draw the line?

I do get your point but on the other hand many sites are using JS frameworks for good reason and 5kb is absolutely nothing to improve the user experience. You really can't complain about the size of a 5kb javascript file in this day and age otherwise let's just revert back to HTML 2 or 3 to cater for all edge cases.


Now you're just arguing for the sake of arguing. I get the general rant against huge bulky libraries, but you're picking the wrong hill to die on for 5kb.

Google's logo, one word, 4 colors, is 14kb.

To have a library that gives you a better foundation to build a website on be 5 (actually 3) kb? In what universe is that a bad thing?


This website's favicon is 7.3kb. What kind of weird edge case are you working for?


That is less data than the logo will take up, and is also less data than, e.g., the raw text in this comments section (compressed with brotli). With proper caching policy, the code bundle also only needs to be downloaded once.


jQuery is 80kb. How is that better than 5kb?


In a lot of cases (especially in today's modern JS and browsers) you don't need jQuery either.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: