• 3 Posts
  • 18 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle




  • A few things to note:

    JavaScript is not a “batteries included” language - if you need math functions or cryptography or any kind of utility, you need to load it along with your script (usually from npm).

    Loading a lot of small files is slower than streaming one big combined file, so tools like webpack will stitch all the files in your node_modules directory and minify it, so it’s not unusual to have big files like this.

    Does the site actually need all this code? Probably not! The ridiculous part is that every one of those npm dependencies has it’s own list of dependencies, so just grabbing a small handful of libraries can result in huge trees of files!

    Even more insane is that many of these probably have shared dependencies, but very slightly different versions, so multiple almost identical packages get downloaded.

    Worst of all is that is most packages probably don’t use 90% of the code in the dependencies that they do need - e.g. if you want a “sin” function from a math library then you’ll be downloading “cos” and “tan” too.

    There are tools like tree-shaking and pruning that help to remove unused packages during the bundler step, but I rarely see them used. It’s a lot of extra configuration and setup when mostly the products aren’t affected by a few extra KB or MB.

    Anyway that’s why js and node and npm suck to both work with and to use. The site probably doesn’t need all that extra code, but there is no easy way to prove it so you get everything “just in case”.



  • Yeah, this isn’t supposed to be a silver bullet, it’s more about democratizing the internet more.

    I think that

    • Low barrier to entry
    • Focus on users owning their own content
    • Privacy is more important than advanced functionality

    I.e. if you want to start a blog, it should be easy own it and host it yourself rather than surrending your content to Twitter and Facebook. Make it accessible to others who also want to surf the web without being targeted and tracked.


  • I have a vision of starting a <noscript> community.

    Basically building a set of tools to help people host content with just plain HTML and CSS, using static personal hosting and organically sharing links like the pioneer days of the web.

    I think that the shift to client-side scripting, like tracking pixels, algorithmic content, infinite scrolling, targeted advertising, etc is how we ended up with the monoculture we see today.

    Just disable JavaScript on your browser and 99% of those things go sway and we can support people building personal homepages again.