Destiner's Notes

JS Ecosystem is Actually Pretty Great

1 August 2022

Javascript and its ecosystem are probably the most hated of all developer tooling. Every time an npm package is compromised, a new app is made with Electron, or a new frontend framework appears, people are mad. “It’s broken”, “why are they reinventing the wheel”, “why not use Rust/Go/C++ instead” are the most vocal complaints.

Complainers are all right. JS was a terrible language. The last few years, however, have been absolutely great for it.

The language

To start, a few notes about the language itself.

Javascript is neutral. The language is neither bad nor good. It’s a tool to do the job, simple as that.

Javascript is pragmatic. It doesn’t try to be perfect. Instead, it focuses on getting stuff done. There are many great languages with cool features that nobody cares about. Javascript is not one of them.

Javascript runs everywhere. Ironically, something that Java promised to do but ultimately failed, while Javascript is never claimed but actually achieved. Hate it or love it, but JS is used for frontend, backend, desktop, and mobile. Web ultimately won as a platform, and so did JS.

Typescript

Typescript is probably the biggest contributor to Javascript greatness. There’s been a few other attempts to add typing to the Javascript source code, and TS ultimately succeeded. As the ecosystem converged towards a single tool, Typescript become an almost default tool for writing scalable JS code.

npm

The most popular package repository, npm is absolutely a go-to resource for JS packages. Rephrasing a popular motto on mobile app stores, “there’s a package for that.”

Frontend tech

This section could easily be an article of its own. Modern frameworks like React and Vue allow developers to easily create reactive web apps. Technologies like SSR enable them to offload some of the rendering to the server. Tools like Astro make it possible to create websites that don’t deliver any Javascript by default while providing the same DX as Client-side rendered React applications.

Latest developments in web dev include edge functions and serverless applications that take care of dealing with distributed cloud infrastructure. Modern hosting providers support this tooling, providing seamless adoption of SSR frameworks, and unlocking more and more possibilities for web developers.

Speaking of hosting, services like Netlify and Vercel allow you to deploy apps to the CDN continuously on each commit, making production deployments as easy as git push.

But innovation doesn’t stop on application and infrastructure levels. There are better and faster bundlers like Vite and Rollup, package management tools like yarn and pnpm, and even JS runtimes like Deno and Bun in the works, each improving older tools with new ideas.

Finally, while not directly tied to the JS ecosystem but pretty related to it, HTML and CSS only get better each year. Ironically, this makes it possible to not use JS where previously it was a requirement.

Backend tooling

While backend development tools don’t evolve at the same cadence as their frontend counterparts, they also advance at a decent pace.

Prisma, a Typescript-first ORM, abstracts away writing SQL to create tables, query data, and run migrations. It’s still nascent, and lacks essential functionality when writing queries, but still better than previous generation ORMs.

GraphQL, while not tied directly to Javascript, provides a good alternative to REST, and has a growing ecosystem of tools like Apollo.

For those who still prefer REST, tRPC generates a type-safe client code given server schema.

Common complaints

There are a few repeating critiques regarding Javascript and web development. Let’s tackle some of them.

Conclusion

This all probably looks like an ad for JS, but it’s my honest impression of the space after working inside the ecosystem for the last 5 years. It’s certainly a mess, and it takes time to master all the tools, but it’s well worth it in my opinion.