Live data from Hacker News

Esbuild – An extremely fast JavaScript bundler

esbuild.github.io

101–110 of 288 posts

Re: Esbuild – An extremely fast JavaScript bundler

#101
Why is it so fast? Mainly because:

- It's written in Go and compiles to native code. [...] While esbuild is busy parsing your JavaScript, node is busy parsing your bundler's JavaScript. By the time node has finished parsing your bundler's code, esbuild might have already exited and your bundler hasn't even started bundling yet. [...] Go is designed from the core for parallelism while JavaScript is not.

- Parallelism is used heavily.

https://esbuild.github.io/faq/#why-is-esbuild-fast

Re: Esbuild – An extremely fast JavaScript bundler

#102
I switched to it on all of my personal (TypeScript) projects after upgrading to Phoenix 1.6 (where it is required). I normally have a separate lint step during production builds so its lack of type checking isn't an issue during development as VSCode catches and highlights type errors anyway.

It is crazy fast. It feels like the Turbo Pascal 3 of web development.

Re: Esbuild – An extremely fast JavaScript bundler

#103
post #89

What’s the catch? Do they really have a secret sauce or are there limitations in esbuild to achieve these speed ups?

Some section titles from the FAQ[1]: > Why is esbuild fast? > - It's written in Go and compiles to native code. > - Parallelism is used heavily. > - Everything in esbuild is written from scratch. > - Memory is used efficiently. > Production readiness > - Used by other projects > - API stability > - Only one main developer > - Not always open to scope expansion 1: https://esbuild.github.io/faq/

I saw that, but none of that adds up to a 100x speedup.

Re: Esbuild – An extremely fast JavaScript bundler

#104

What’s the catch? Do they really have a secret sauce or are there limitations in esbuild to achieve these speed ups?

Well not being written in JS does help -a lot-. Esbuild is written in GO.

I'm sure it helps. It doesn't help 100x

Re: Esbuild – An extremely fast JavaScript bundler

#105

Work on esbuild started at the start of 2020. It is primarily authored and maintained by Evan Wallace, who, in addition to making this tremendous contribution to the JavaScript ecosystem, is the CTO and co-founder of Figma . Incredible output.

I don't understand this perspective. Everyone only has so many hours in a day, and there's only so fast you can work.

If he's writing esbuild that is taking time away from being the CTO of Figma. Either he's working a shit ton, one of the things (Esbuild or Figma) is being somewhat neglected, or his output is actually not as high as it looks.

Re: Esbuild – An extremely fast JavaScript bundler

#107
post #91

Work on esbuild started at the start of 2020. It is primarily authored and maintained by Evan Wallace, who, in addition to making this tremendous contribution to the JavaScript ecosystem, is the CTO and co-founder of Figma . Incredible output.

I came here too say this. The man authored in the neighborhood of 100k LOC in a year, just on this. There's a living 10x dev, it's not a myth. What is ridiculous is to think someone can 10x a normal developer, it's more like the difference between the top few percent and the bottom 10-20%. Evan Wallace is a beast, no doubt.

While he is certainly an excellent developer with great productivity to boot, LOC is an obtuse metric. For example there is a package-lock.json commit which is almost 20K lines. Otherwise I totally agree.

Re: Esbuild – An extremely fast JavaScript bundler

#109

Earlier quoted context omitted.

Only if a project is pretty small. Change in one place, especially if it's a reusable code, might ruin code in multiple different places and IDE will not recompile the whole project on every change, it will only watch your currently opened files and, maybe, some files in opened folders.

Did you reply to the wrong comment ? The --noEmit does not have the issue you talk about.

yes, sorry

Re: Esbuild – An extremely fast JavaScript bundler

#110
Often overlooked things when discussing esbuild here:

1. It's not just a faster replacement for a single %tool_name% in your build chain: for the vast majority of cases, it's the whole "chain" in a single cli command if you're doing it right.

That is, you don't just stick it inside, say, webpack as a faster replacement for babel (although you can). No, you look carefully through your webpack configs and its myriad of plugins, ask yourself whether you really need to inline css in jsx in png while simultaneously optimizing it for IE 4.0, realize you don't, through out the whole thing, and use esbuild instead.

I have two 50K+ LOC projects using esbuild, and I would use it even if it was slower than webpack/babel/tsc simply not to worry about the build chain breaking due to an update to some obscure dependency or plugin.

2. It is fast because it's written from scratch to do a set of particular things and do it fast, not just because it's Go and parallelized.

If you look at the commit log you will notice a lot of performance tweaks. If you look into the issues, you will find a lot of requests for additional features rejected, often due to possible negative performance impact.

3. The most impressive part about esbuild development is not just that it's one guy writing it: it is the level of support and documentation he manages to provide alongside.

The release notes alone are a good course into nitty-gritty details of the web ecosystem: all the addressed edge cases are explained in detail. To top it all off--all opened issues, no matter how uninformed they seem, find a courteous response.

Post reply on HN