4 ms·
From the JavaScript ecosystem, I'm frustrated by Babel's popularity. Whenever I discuss it with developers, everyone agrees that it's not worth it, and yet peop
by cryptica 7y ago
From the JavaScript ecosystem, I'm frustrated by Babel's popularity. Whenever I discuss it with developers, everyone agrees that it's not worth it, and yet people still use it! It's as if we have no choice in the matter!
The whole point of Babel was to allow us to use the latest JavaScript syntax so that we wouldn't have to update our own source code when the new syntax finally became broadly supported by browsers and other engines.
IMO, the Babel project is a failure because:
- Babel itself is always being upgraded to support newer ECMAScript syntax, so people still need to upgrade their own code whether they use Babel or not. The only benefit is that using Babel allows you to use these features before other people.
- Instead of just worrying about how JavaScript syntax changes affect your code, with Babel, you also need to worry about how Babel upgrades will affect your code. The babel plugin dependencies often change and break over time (even if you don't change your own code) and you always have to support both ecosystems.
So when you consider the big picture, Babel doesn't save you from having to upgrade your own code (as per its original promise). When you evaluate the pros and cons, the cons greatly outnumber the pros:
Pros:
- You get to use the newest language features before other people.
Cons:
- You need to maintain your code for compatibility with two ecosystems instead of just one. Keeping up with both ECMAScript + Babel is a lot of work. I would even argue that staying up to date with Babel is more work because dependencies keep changing underneath your project.
- It forces you to use a build step so you lose the benefits/iteration speed that an interpreted language brings to your development flow.
- Adds a lot of bloat and unnecessary, hard-to-describe dependencies to your project which can open up security vulnerabilities and make your code more opaque and brittle.