Skip to content

v0.21.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 07 Jan 05:00
· 146 commits to main since this release

This release uses the "swcx" CLI: https://github.com/swc-project/swc/discussions/3859

Thanks to help from @realtimetodie, the latest release of swc (v1.3.25) has fixes needed for us to run the "pure-rust" CLI, and avoid any node.js process running. This makes it much faster to launch many small processes. Note, our TS benchmarks in https://blog.aspect.dev/rules-ts-benchmarks already used this patch, now that it's released you should get similar performance.

BREAKING CHANGES:

We are getting close to 1.0, so this is the chance to make disruptive changes before entering a semver guarantee.

  • Minimum version of swc is now v1.3.25
  • An explicit version now has to be given to swc_register_toolchains; we don't silently default to latest
  • the term "transpile" is not typically used in swc, so the underlying rule swc_transpile has been renamed swc_compile matching the "compile" command

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "71bff4030067e3898a98a60918745a168b166256393d1ea566f72b118460d4ef",
    strip_prefix = "rules_swc-0.21.0",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.21.0.tar.gz",
)

###################
# rules_swc setup #
###################

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")

rules_swc_dependencies()

# Fetches a SWC cli from
# https://github.com/swc-project/swc/releases
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "LATEST_VERSION", "swc_register_toolchains")

swc_register_toolchains(
    name = "swc",
    swc_version = LATEST_VERSION,
)

What's Changed

Full Changelog: v0.20.2...v0.21.0