Why Is Esbuild Fast?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • esbuild

    An extremely fast bundler for the web

  • > Just the main JS parser file [0] is 12k lines

    While that is impressive, I think this is also an indication of a problem: the grammar is becoming unwieldy. For example, even for someone as prolific as Evan, he must decide between feature depth (e.g. bundle splitting) and feature breadth (e.g. implementing the equivalent to @babel/preset-flow, which is used by both flow and hegel[1] type systems)[0]

    Esbuild supporting Typescript and JSX is undoubtedly a byproduct of these grammar extensions having become popular. But supporting extra grammar extensions does add to complexity, sometimes in non-trivial ways. In Typescript, for example, you can import types using runtime import syntax, making it ambiguous whether running side-effects from a library is intentional or not. This gets problematic once you consider treeshaking and not-really-standard things like package.json's `browser` field.

    It gets even more fun when you realize that module resolution isn't even specified, meaning that as far as a bundler is concerned, something like `import 'lodash'` means completely different things for a browser vs a project installed via npm vs one installed via yarn v2...

    [0] https://github.com/evanw/esbuild/issues/79

  • swc

    Rust-based platform for the Web

  • Hey, I was trying to do this same thing for a TypeScript project I was bootstrapping. Digging around the issue tracker, I recall the maintainer stating that this is currently not in the scope of esbuild, and that swc[0] might be better suited for this.

    Personally, I wrote a crude JS script using the esbuild transform API + node-watch to compile .ts files and copy files/folders during development. This is all very recent, so I can't ensure that it's bulletproof quite yet.

    [0] https://swc.rs/

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • sucrase

    Super-fast alternative to Babel for when you can target modern JS runtimes

  • > I would say the primary motivators at this point have shifted from browser compatibility to syntaxes like TypeScript and JSX that will (likely) never be supported natively

    I suggest using a single-pass transpiler like Surcase[0] that doesn't translate to IE11-compatible syntax, and just loops through the string once, avoiding generating an AST– making it much faster– removing TypeScript annotations and desugaring JSX.

    If you additionally need to support IE11, you can use a development build with Surcase and a production build with a bundler. C/C++ developers have been doing things like this for ages: compiling files as objects during development, and compiling them into one big binary for production.

    [0]: https://github.com/alangpierce/sucrase

  • vega

    A visualization grammar.

  • For Vega, I would just use the pre-built minified ES5 version: https://github.com/vega/vega#es5-support

    Access it via a global variable.

  • fork-ts-checker-webpack-plugin

    Webpack plugin that runs typescript type checker on a separate process.

  • You may want to check out this webpack plugin [1], though I'm not sure how much it could get you there.

    [1] https://github.com/TypeStrong/fork-ts-checker-webpack-plugin...

  • esbuild

  • It is also all custom: https://github.com/esbuild/esbuild.github.io. YAML files that get converted to plain static HTML pages. It's designed to work well without any JavaScript. Even the animated graphs on the home page are done without JavaScript.

  • vite-ts-tailwind-starter

    Opinionated Vite + Vue 3 + TypeScript + Tailwind CSS starter template w/ tests and CI.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Esbuild implements the JavaScript decorators proposal

    1 project | news.ycombinator.com | 7 May 2024
  • How and why do we bundle zx?

    9 projects | dev.to | 6 May 2024
  • How to Protect State in Pinia

    2 projects | dev.to | 7 Apr 2024
  • What is JSDoc and why you may not need typescript for your next project?

    8 projects | dev.to | 22 Jan 2024
  • Nx - Highlights of 2023

    14 projects | dev.to | 28 Dec 2023