Speeding up the JavaScript ecosystem – The barrel file debacle

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

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • jest

    Delightful JavaScript Testing.

  • It's not a secret what jest does. There are a few abstractions to jump through, but I find jest's code very readable overall. By default the `workerThreads` option is set to `false`. Then we reach their `WorkerPool` class which pools the test runs. The "Worker" in the name is not to be confused with WebWorkers or node's worker_threads. It's merely the term the jest team has chosen. Inside that and because workerThreads is set to false, we instantiate a child process here

    https://github.com/jestjs/jest/blob/00ef0ed0a03764f24ff568bc...

  • stylelint

    A mighty CSS linter that helps you avoid errors and enforce conventions.

  • The “cost of loading modules” diagram shows non-linear behaviour (though you should largely ignore the curve visible in the diagram because the x axis is way off linear):

    • 0.15s ÷ 500 = 0.3ms

    • 0.31s ÷ 1000 = 0.31ms

    • 3.12s ÷ 10000 = 0.312ms

    • 16.81s ÷ 25000 = 0.6724ms

    • 48.44s ÷ 50000 = 0.9688ms

    My own observation on a Surface Book six years ago was that in Node.js under Windows, each module had about 1ms of overhead when there was warm file system cache—that is, simply bundling with Rollup saved 1ms per file. If this sort of thing interests you, quite a lot of useful stuff came out of https://github.com/stylelint/stylelint/issues/2454 which I filed because I was unhappy with stylelint taking over a second to import. And that must have been only in the order of one or two thousand modules, when the behaviour is still close enough to linear.

  • 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
  • ava

    Node.js test runner that lets you develop with confidence 🚀

  • > In the popular jest test runner, each test file is executed in its own child process.

    Is that confirmed?

    I've been following this issue:

    https://github.com/jestjs/jest/issues/6957

    And what Jest actually does is still kind of muddy.

    In contrast to that, other test runners like AVA have a clear description what happens when:

    https://github.com/avajs/ava/blob/main/docs/01-writing-tests...

  • biome

    A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

  • Biome [0] aims to be a linter and formatter for the web techs. It already supports JavaScript, TypeScript, JSX, and soon CSS.

    [0] https://github.com/biomejs/biome

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