
Ask HN: How to avoid JS/CSS bloat? - sfilipov
In the thread today about the size of Doom compared to a modern webpage [1], it was mentioned a number of times that including jQuery, Bootstrap, etc. even for the smallest of websites one of the reasons why downloading and rendering modern webpages is so slow.<p>I could not find an acceptable solution. It was mentioned that pointing to a CDN increases the chances that the resource is cached, but that is not always the case.<p>What is the alternative? Using smaller libraries? Not using libraries? Are Zepto and Skeleton good enough for small websites? What are other libraries&#x2F;frameworks of similar size that you have used and liked? Are we at a point where using vanilla JS and CSS is good enough?<p>[1] https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11548816
======
namuol
The problem has less to do with the frameworks chosen by the main website's
developers, but rather the countless third party services which are mandated
by marketing/business realities.

Think Facebook pixel, google analytics (et al), Optimizely, Mixpanel, various
"widgets", etc...

In other words: you probably don't really have this problem unless you're
working with a large team and for profit.

Easiest way to win these battles is to show real-life "Before"/"After"
examples of your site with and without bloaty services to whomever is
advocating for their importance.

~~~
smt88
This might help with some of the bloat:
[https://segment.com/](https://segment.com/)

~~~
namuol
Unfortunately, most of segment's supported integrations still require the JS
lib to be loaded on the client. This is less a limitation of Segment and more
a limitation of the aforementioned integrations.

