I was recently asked this question, which sparked a lot of thoughts.
Where do you find these new technologies to use in our projects?
New technologies arise in the JavaScript world more often than other fields in software engineering. For example, Java developers don’t use 8 different file extensions for their code files. Go developers have a great, opinionated built-in formatter, and don’t care about code style configurations. Rust developers don’t use 6 different package managers. Python developers don’t use 10 different runtimes to run their code. And I can go on.
# Node.js (and npm)
Node.js was the standard for running JavaScript outside of browsers for a long time. Node.js shipped with npm , a package manager that runs in approximately an hour.
yarn and pnpm are two alternatives for npm. They both solve different set of issues with npm. They have been here for a pretty long time as well. I personally preferred using pnpm.
However Node.js didn’t have any alternatives for a long time, until 2021. That is when Deno was announced. It was created by one of the creators of Node.js, to “fix” issues with Node.js and its ecosystem. The big hurdle in switching to Deno is Node.js incompatibility.
After about 2 years, Bun was announced by Oven. Bun is the best of both worlds. Compatible with Node.js and the goodies from Deno. Bun is also a faster alternative to npm. And it’s fast as hell. Bun is quite stable now.
The sweet part of Bun is, it is also a package manager. There is no going back
when you try bun install on a project.
# ESlint + Prettier
ESlint and Prettier are used to format JavaScript (and co) files into a specific style. Prettier says its a formatter, and ESlint is a linter; however I have no idea what’s their boundaries. Frankly speaking, It’s mentally hurting to setup both in a project. They both try to override each other’s formatting styles. We have to carefully craft their configurations to work in harmony.
We had to live through this until Biome came to the rescue. Biome is like a combination of eslint and prettier, and at least 30x faster. I switched to it as soon as I heard of it. It has been great using it. I don’t have to mess around with multiple configurations. Biome has all the goodies of Eslint and Prettier, and even more features.
# React
React is currently thought to be the de facto standard of building frontends.
Although there are about at least 10 great alternatives for React and its meta frameworks, developers outside of Twitter seem to not care about them. Outside the tech Twitter bubble, developers just go all in on React for every frontends. Even for static landing pages.
I think I understand why. They have experience working with React. Companies like to work with React developers. React is great when we omit SEO and performance. However, React adds more than 36 KB to website’s JavaScript bundle.
A quick solution to un-bloat a React website is Preact . It’s like 11x smaller compared to React and compatible with React. We can just alias react and its submodules to preact, and be done. This change alone reduces our bundle size by about 30 kB!
# Express
Express is The React of Backend. Unlike React, it’s very stable. Express’s latest major version was released 10 years ago. And it’s still working great. I would say it is the most used backend library in Node.js. Express has a huge community and a ocean of resources.
The single issue with Express is, performance. New backend libraries are more performant, and are built on web standards. My most favorite alternatives are Hono.js and Elysia .
# The catch
Now you might think that I am trying to encourage you to migrate away from old technologies to new technologies in your stack. I am not.
Nothing is bad just becuase its old;
Nothing is good just because its new.
Old technologies tend to be more stable and battle-tested. They usually have a huge community of developers, and plenty of learning resources. While new stuff seem to be shiny and great, they may not provide the best DX in terms of documentation or the community.
# Examples
I want to explain my personal experiences related to this post.
- The ecosystem
I recently migrated one of my side projects from Node+Express to Bun+Hono. I was using socket.io with Express; but couldn’t figure out how to do that in the Hono world. I completed the migration by dropping socket.io (as it was only an enhancement). Fast forward a few months, I wanted to integrate an APM. I have no clue how I am going to do this in Bun. All providers seem to be supporting Node.js but not Bun.
# The takeaway
Re-evaluate the building blocks of your stack.
In any of your small side projects, try to test any new alternatives and see if it suits you. If you plan to migrate to a newer stack in any of your serious or big projects, research around its features and community.
For your fun side projects, you can try PHB — Postgres, Hono, Bun instead of MERN. See what I did there? 😄
# Missing anything?
If you believe I am missing out a tool in the above list, please let me know. I want to keep this list as informative as possible.