Tip for anyone who's been put off building stuff with JS due to the terrifying array of build tools and packages and framework choices you have to make these days

You don't have to use any of that stuff!

A few years ago I gave myself permission to ignore it all and just use default browser environments... and it turns out to be a really fun, productive, dare I say delightful environment to work in

Now that we can ignore IE compatibility modern JS and browser APIs are really nice to work with!

The one big catch is that almost every piece of open source JS code you might want to use assumes you have a build system and can npm install it, which is frustrating because you then have to figure out how to use them without a build step

I often find unpkg.com can help with that, though I prefer to host my dependencies locally rather than via a CDN so i usually try to mirror that version using a few curl commands

If like me you miss the jQuery days it's useful to know that between Array.from(document.querySelectorAll(...)) and fetch() a lot of the conveniences you used to use jQuery for can be done without a library at all now

Also AI tools like GitHub Copilot and ChatGPT are really good at helping avoid have to look up less ergonomic DOM methods when you need them - like el.parentNode.insertBefore(otherEl, el)

Follow

@simon

I agree. I am more and more convinced that most of JS tooling is already obsolete if you only support evergreen browsers and HTTP/2. If you use ES modules, you have most of the good without any of the bad. Babel is a crutch we don't need anymore.

Libraries are indeed the main hurdle. But searching for "nameoflib cdn" works fine for most of the main ones.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.