| ▲ | stephenr 10 hours ago | |||||||
The primary cause of JS bloat is assuming you need JS or that customers want whatever you're using it to provide. For $client we've taken a very minimal approach to JavaScript, particularly on customer facing pages. An upcoming feature finally replaces the last jquery (+ plugin) dependent component on the sales page, with a custom implementation. That change shaved off ~100K (jquery plus a plugin removed) and for most projects now that probably seems like nothing. The sales page after the change is now just 160K of JS. The combination of not relying on JS for everything and preferring use-case-specific implementations where we do, means we aren't loading 5 libraries and using 1% of each. I'm aware that telling most js community "developers" to "write your own code" is tantamount to telling fish to "just breathe air". | ||||||||
| ▲ | CoderLuii 10 hours ago | parent [-] | |||||||
160K total is impressive. most landing pages i see are shipping 2-3MB of js before the first paint. the "write your own code" approach gets laughed at but when you actually do it the result is faster, easier to debug, and you dont wake up one morning to find out one of your 200 dependencies got compromised. | ||||||||
| ||||||||