Live data from Hacker News

Esbuild – An extremely fast JavaScript bundler

esbuild.github.io

1–10 of 288 posts

Re: Esbuild – An extremely fast JavaScript bundler

#2
ESbuild is getting fantastic traction. It’s the default in Phoenix from 1.6 and comes as a default option in the current alpha of Rails 7, which you can get with a simple

rails new your_app -j esbuild

The only sort of issue I’ve had with it so far is you can’t use it with Inertiajs[1] as it does not support dynamic imports out of the box. Although I’m hesitant to call it an issue if its not in the scope of the project. Perhaps there are plugins I can use.

[1] - https://inertiajs.com

Re: Esbuild – An extremely fast JavaScript bundler

#5
post #4

Isn't the browser also an extremely fast Javscript bundler? How many scripts does a site need to make it feel faster when bundled? When I visit websites that are rendered serverside, they usually feel instant to me. Even when they load a dozen scripts or so.

> How many scripts does a site need to make it feel faster when bundled?

Depends on what you're building. If you have many nested dependencies, you need to bundle them, and not rely on the browser to resolve them at runtime and do dozens of roundtrips to the server to fetch them.

Re: Esbuild – An extremely fast JavaScript bundler

#6
esbuild is fast but it has a lot of place you have to figure out yourself and get into your way of doing thing.

1. dev server: you have to write a bit of code for this server to act as webpack dev server 2. scss: need to install plugin, and plugin cannot use from command line then you need to write a bit of JavaScript 3. global function: if you do `process.env` now you need to inject into build script 4. node package: if the package use node stuff you have to define thing like `fs/stream` into package.json

very quickly it get into your way of doing thing.

However, once you get past that base line, the cost is constant, the complexity just stop right there and not adding up.

Plus, the speed is amazing.

Re: Esbuild – An extremely fast JavaScript bundler

#7
post #5
post #4

Isn't the browser also an extremely fast Javscript bundler? How many scripts does a site need to make it feel faster when bundled? When I visit websites that are rendered serverside, they usually feel instant to me. Even when they load a dozen scripts or so.

> How many scripts does a site need to make it feel faster when bundled? Depends on what you're building. If you have many nested dependencies, you need to bundle them, and not rely on the browser to resolve them at runtime and do dozens of roundtrips to the server to fetch them.

That contradicts my experience and what I just described. In my experience, sites do feel instant even if they load dozens of scripts.

Re: Esbuild – An extremely fast JavaScript bundler

#9
post #7
post #5

Earlier quoted context omitted.

> How many scripts does a site need to make it feel faster when bundled? Depends on what you're building. If you have many nested dependencies, you need to bundle them, and not rely on the browser to resolve them at runtime and do dozens of roundtrips to the server to fetch them.

That contradicts my experience and what I just described. In my experience, sites do feel instant even if they load dozens of scripts.

There will definitely be an inflection point, and it's very dependent on many factors: number and size of scripts, how much of the initial content is SSRed, network bandwidth and latency etc.

Re: Esbuild – An extremely fast JavaScript bundler

#10
post #7
post #5

Earlier quoted context omitted.

> How many scripts does a site need to make it feel faster when bundled? Depends on what you're building. If you have many nested dependencies, you need to bundle them, and not rely on the browser to resolve them at runtime and do dozens of roundtrips to the server to fetch them.

That contradicts my experience and what I just described. In my experience, sites do feel instant even if they load dozens of scripts.

Browsers are good at caching JavaScript files, so it depends if the scripts are already cached or not.
Post reply on HN