- The cost of downloading the file on the network
- The cost of parsing and compiling the uncompressed file once downloaded
- The memory cost
If you include a framework, like React or Vue, your baseline JS build is 30kb after minifying and gzipping. That’s before writing a single line of actual code for your site. That’s just the cost of the framework.
Once you go down that path of using JS for rendering stuff, the natural progression is to use it for more and more stuff.
Eventually, you end up with a fragile site that’s painfully slow or downright unusable on all but the most modern of devices and internet connections.
Tim has some great recommendations on a path forward, but the first three are my favorite:
- Is there a lighter alternative (Preact, Svelte, etc.) that gets you 90% of the way there?
- If you’re going with a framework, does anything exist that provides better, more opinionated defaults (ex: Nuxt.js instead of Vue.js, Next.js instead of React, etc.)?
Do yourself a favor today and go read the whole thing. It’s a masterpiece!