Live data from Hacker News

Esbuild – An extremely fast JavaScript bundler

esbuild.github.io

171–180 of 288 posts

Re: Esbuild – An extremely fast JavaScript bundler

#171
post #124
post #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…

How is the integration with things like a dev server and tools present in create-react-app like react-fast-refresh? Also, in case of working on an Electron project: How well does it handle main/render/preload compile targets and handling of native modules and linking? Electron-forge is, for instance, the recommended toolchain for building Electron apps and the Webpack stuff is a particular pain in the ass.

You can use vite for that, which is an enhanced wrapper for esbuild. I use it on all of my projects except the ones I'm forced to use webpack on for legacy reasons.

Re: Esbuild – An extremely fast JavaScript bundler

#172
post #157

Earlier quoted context omitted.

We're using Vite and enjoying it, would you say much of Vite could be replaced with pure esbuild? I guess Vite provides a nice development experience but is built on esbuild.

I guess it depends on your project and workflow preferences. Personally, I'm not a big fan of HMR and the bundling times are negligible even without "pre-bundling" npm dependencies (as Vite puts), so I see little reason for Vite.

We switched over to Vite some time back and it's been pretty life changing. We're using react and tailwind too, so the HMR works really well for us.

The config is beyond minimal. If you're using webpack you may want to look away now :-)

    import { resolve } from 'path'
    
    import { defineConfig } from 'vite'
    import reactRefresh from '@vitejs/plugin-react-refresh'
    
    
    export default defineConfig({
      plugins: [reactRefresh()],
      build: {
        rollupOptions: {
          input: {
            index: resolve(__dirname, 'index.html'),
          }
        },
        sourcemap: true
      },
      esbuild: {
        jsxInject: `import * as React from "react"`
      },
      resolve: {
        alias: [
          { find: '@', replacement: '/src' },
        ]
      },
    })

Re: Esbuild – An extremely fast JavaScript bundler

#174
post #136
post #113

You know you are getting old when you watch the arrival of the fourth JavaScript build tool of your career. I still remember when everyone was waving goodbye to Gulp in favour of Webpack. Webpack was going to save us all from the hell of massive convoluted gulp.js files. Fast forward five years and it's the same mess it was supposed to avoid. Slow, bloated and confusing. I just switched to esbuild on our main project…

5 if you include grunt. 6 if you include bash/make for using manual scripts to productionize your yui / jqueryUi / mooTools code with uglify/browserify/gcc/etc

Don't forget bun and swc

Re: Esbuild – An extremely fast JavaScript bundler

#176
post #91

Earlier quoted context omitted.

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.

I really wish people would stop idolising so called '10x' developers. Anyone that is comfortable and familiar with their toolset (e.g. go, .NET, Java, C++) and has a deep understanding of a problem (and has likely solved it once already), can churn out code far, far, faster than an onlooker.

Ehhh no I don’t think it’s that simple.

I’ve found that in any tech company, while there are many people that write good code and do a great job, there are always a handful (even at a place like Apple) that truly push the industry forward and in certain directions, partly because of how they see years ahead, partly because they are supremely talented, and partly because they attract other really good talent just to work with them.

And we know many of their names. Folks like Brian Cantrill, Yehuda Katz, Fabrice Bellard, John Carmack, Bret Taylor.

They aren’t just good programmers. They’re constantly dwelling in uncharted territory.

I’m not advocating worshipping them, just stating that their talent and output is hell of a lot more than even 10x.

Re: Esbuild – An extremely fast JavaScript bundler

#179
post #56

See also SWC, something similar to esbuild but written in Rust. NextJS uses SWC as well as Deno. Rome is also being rewritten in Rust, it's more of a complete set of packages that subsume Webpack, Babel and all the other parts of the JS / TS development experience.

The announcements from NextJS has been really confusing. I don't think they are using SWC yet. They are just working on it. The reason for the confusion is because they write about the progress in the release notes, making it look like they are using it.

SWC in NextJS is still in canary with experimental settings, but it took me 3 lines of code yesterday to make it work on a fairly large app ( https://labelflow.ai ). Hot reload times instantly went from 10s to 1s. Twitter discussion here https://twitter.com/vlecrubier/status/1448371633673187329?s=...

Overall I’m pretty bullish on Rust tooling and integration within the JS/ Wasm ecosystem !

Re: Esbuild – An extremely fast JavaScript bundler

#180
post #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…

> 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.

And the one guy writing it is Evan Wallace, co-founder and CTO of Figma. I don't know how he has the time!

Post reply on HN