Skip to content

Build process rewrite #134

@brianmhunt

Description

@brianmhunt

Background

Flowing from #130 and started implementing in #111, I am revisiting the build process. The last time we looked at this the build process was very challenging for a few reasons:

  1. it required a tool with potentially lots of plugins (e.g. rollup, babel, Webpack), some of which were rather fickle
  2. the build targets were not clearly defined/definable in the Javascript ecosystem

Since that last go-round, the ecosystem has changed and stabilized. ESM is now a relatively sure-thing in modern browsers and all recent build tools, and there are alternative build tools. As well, how npm, node, and build tools export packages has increased and become more stable/standardized.

We also have Deno in the landscape, to think about.

Objectives

  • O1: Simplify the build process
    • R1: Simpler build tool
    • R2: Separate packages/ from builds/
    • R3: Test the build targets
  • O2: Clarify the build targets
    • R1: Typescript (for internal and external building)
    • R2: CommonJS (ES6)
    • R3: ESM (ES6)
    • R4: (builds only) browser.min (ES6)

Technical Design

I've landed on replacing rollup with esbuild because it simplifies the build process substantially.

I tried replacing learn with Makefiles but the interdependencies were too complex, and learn works quite well for task delegation.

The test process requires switching to use a karma-esbuild, which seems to work quite well. There's some config overlap in what's passed to esbuild on the command line for building and what's in the karma.conf.

The build process is somewhat fickle, so I'm adding tests to build/reference/spec that verify that the various processes export/import TKO as anticipated.

Alternatives considered

  • Continue using rollup, but the simplicity and speed of esbuild is compelling, and we are looking to using esbuild in a browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions