Blog2015 ≫ This website is much faster than it used to be

Ditch your bloated javascript libraries now, you don't need it! I should have done this years ago. I saw a talk on this about seven or eight years ago and I thought it was madness, imagine. I'm going to try and carry this through to work now too. Have mentioned it a bit and I think I'll have plenty of support.

Here's my jquery replacement1, kind of. It does all the library things I need to do but then more than half of it is doing the things specifically for this website and folkestonegerald.com such as the star ratings, and admin things for me. I might split it out so I have one file for the library stuff, another for the site specific things, and then another for the admin things. That library would be tiny then. Doesn't look super tiny I know but a lot of that is commented out here's the file without all the unneccessaries...

There are a few dangers here. One; am I reinventing the wheel by writing my own library to do something? yes, a bit, but it's more like building a wheel out of something round I had lying around instead of having an expensive wheel providing service constantly billing me. Two; as I add more and more features am I not in danger of my library becoming bloated? Yes I am too, but it's a long way off yet. Mine is less than 4k at the moment and about half of that is custom code that I would not find in another library anyway. So I'm good to go. By comparison the latest jquery is more than twenty times the size.

js: Programming language of the web, mostly how I earn a wage.

⬅️ :: ➡️

Paul Clarke's weblog - I live in Hythe near Folkestone. Wed to Clare and dad to 2, I am a full stack web developr, + I do mostly javascript / Node, some ruby, python, php etc. I like pubbing, parkrun, restaurants, home-automation and other diy stuff, history, family tree stuff, TV, squirrels, pirates, lego, + time travel.