Fabr 0.3.0 released

The headline feature for this release is incremental compilation on two levels - firstly, recompilation is narrowed to the actual files that the build references (so unrelated dependency changes don't force a rebuild), and secondly the tsc compilation[0] is also now incremental within each target.

The core language now exposes guards on global and target properties - these look much the same as constraints but on the other side:

VERSION<BUILD_TYPE=release> = 5.0.0
VERSION<BUILD_TYPE=debug> = 5.0.0-RC

js_package mylib {
deps = foo bar;
deps<JS_TARGET=es2015-*> = corejs;
}

String properties must resolve to a single property, file properties will union. We also now have backtick expressions, which behave exactly like the shell version including pipes etc, except that the commands must be runnable fabr targets rather than native commands:

TSC_VERSION = `@pkg:typescript:tsc --version`

After that, this release also includes cache GC, full sass+css modules support, vitest support, and many many bugfixes.

Full changelog

@fabr-build/core:

  • Add support for guarded properties.
  • Add xz archive support.
  • Add positional backrefs in rename templates.
  • Add backtick command expressions.
  • Add 2>&1 stream duplication to command pipelines (and its 1>&2 mirror).
  • General optimizations, especially for cache-hits.
  • Fix package aliases not working in catalogs.
  • Add discovered dependencies + incremental state support.
  • Add source index to reduce startup hashing.
  • Add first cut of cache garbage collection (30-day)
  • Fix strict resolution checking to apply at the collection point.
  • Fix build file reloading orphaning running processes.
  • Add env property to generate + serve targets.
  • Fix rule selection ignoring default and declared globals (only explicit overrides counted).
  • Add targetProperties to rule registrations, selecting a rule on the target’s own properties.
  • Fix a dependency cycle through something a rule reads (a tool global naming a target that needs the reader) hanging the build instead of being reported.
  • “required by” chains now name the target whose rule read a global (a tool setting), in start lines and in error notes; they used to stop at the global.
  • Fix local packages added to a catalog.
  • Fix aliased package resolution.
  • Add the patched target: a published package (or plain files) with a patch applied, retaining its shape.

@fabr-build/cli:

  • Live progress display on terminal with progress bars and test status (suppressed with -q)

@fabr-build/js:

  • BREAKING: TSC property has changed to TYPESCRIPT without the bin; TSC=@npm:typescript:5.4.5:tsc becomes TYPESCRIPT=@npm:typescript:5.4.5.
  • BREAKING: the test runner is chosen by a test_framework / framework property instead of test_runner.
  • Add Yarn PnP resolution support, enabled currently for our owned tools.
  • Rewrite module-specifiers for ESM targets where required.
  • js_bundle now requests ESM format inputs regardless of target.
  • Add exports option for js_package.
  • Add support for dual-format js package output.
  • Add incremental TSC support.
  • Add js/node_globals flag for bundling w/ node process/Buffer globals.
  • Add postcss for more correct css-module processing.
  • Rewrite __dirname/__filename globals for ESM targets and vice-versa for import.meta in CJS targets.
  • Rewrite self-package imports into relative imports.
  • Split css_compile into separate sass_compile (lowering) + css_postcss steps.
  • Add sass-pnp-importer
  • Add yarn’s package extensions.
  • Fix provided package resolution to avoid forking.
  • Node_modules (when used) now follows pnpm tree conventions
  • Add vitest as a supported test framework (JS_TEST_FRAMEWORK = vitest)
  • Add support for Jest environment docblock declarations.
  • Add snapshot assertions (t.assert.snapshot) to the native test runner, updated with fabr test -u.
Close-up of a water droplet creating ripples, captured in motion with dramatic reflections.

Photo by Adapix on Pexels

Photo by Adapix on Pexels