Releases: aspect-build/rules_swc
v0.21.0
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 renamedswc_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
- run bare rust CLI binary, no node by @alexeagle in #57
- feat: read swc version from package.json by @alexeagle in #135
- chore: cleanup paths example by @alexeagle in #132
- fix: map alternative ts file extensions by @alexeagle in #133
- docs: enable_runfiles is no longer required since we don't use rules_js by @alexeagle in #137
- chore: add MODULE.bazel file by @alexeagle in #138
Full Changelog: v0.20.2...v0.21.0
v0.20.2
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "814bc08efbbe4d5e238579c9b0cded519b199486fbc26709fcf6d4d47de08f50",
strip_prefix = "rules_swc-0.20.2",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.20.2.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to Bazel 6.0.0 and Aspect CLI 5.1.1 by @gregmagolan in #129
- chore: update to aspect_rules_js 1.13.0 by @gregmagolan in #130
Full Changelog: v0.20.1...v0.20.2
v0.20.1
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "9a68901c258b8a91ce721df1f9b1dc62c9dd6b2822143e31a0280396b98db543",
strip_prefix = "rules_swc-0.20.1",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.20.1.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: add swc versions v1.3.4 through v1.3.21 by @alexeagle in #124
- root_dir support by @kzadorozhny in #123
- chore: update to rules_js 1.12.0 by @gregmagolan in #126
- chore: add v1.3.22 and v1.3.23 by @gregmagolan in #125
New Contributors
- @kzadorozhny made their first contribution in #123
Full Changelog: v0.20.0...v0.20.1
v0.20.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "2c979b07bc665a9db376ee80ac31278bbb5e11776f9f076e16abd0eabe8f9ae5",
strip_prefix = "rules_swc-0.20.0",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.20.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- feat: transpiler function returns unused srcs by @alexeagle in #116
- Revert "feat: transpiler function returns unused srcs" by @alexeagle in #117
- chore: update to aspect_bazel_lib 1.8.0 by @gregmagolan in #118
- chore: use Aspect CLI 5.0.2 by @gregmagolan in #119
Full Changelog: v0.19.3...v0.20.0
v0.19.3
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "ad8e15e7714637b09a2e14e8ed3794b4de00e1da29259f93828c5bc80debb36b",
strip_prefix = "rules_swc-0.19.3",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.19.3.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to bazel 6.0.0rc2 by @gregmagolan in #114
- chore: update to rules_js 1.8.0 by @gregmagolan in #115
Full Changelog: v0.19.2...v0.19.3
v0.19.2
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "3b1d6e21d35f238b4df8f6ce772c82a3f4e801ca2d8bbd11e2ba2261a5b06729",
strip_prefix = "rules_swc-0.19.2",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.19.2.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to aspect_bazel_lib 1.16.2 by @gregmagolan in #112
- chore: update to rules_js 1.7.0 by @gregmagolan in #113
Full Changelog: v0.19.1...v0.19.2
v0.19.1
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "340043582f0ab101e6c42ec48b958f0744f039c29d9b010a0fd8e3d006140e66",
strip_prefix = "rules_swc-0.19.1",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.19.1.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- fix: handle opaque targets in swc srcs by @gregmagolan in #110
- chore: tidy comment in opaque_src example by @gregmagolan in #111
Full Changelog: v0.19.0...v0.19.1
v0.19.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "03eaf15d0d3acf1940690a6ac083ec37182ffe3b630706812788156b24b49db9",
strip_prefix = "rules_swc-0.19.0",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.19.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to rules_js 1.6.7 by @gregmagolan in #104
- chore: update to rules_js 1.6.8 by @gregmagolan in #105
- add tests, support out_dir+output_dir by @jbedard in #106
- fix: output .map files alongside .js within out_dir by @jbedard in #107
- test: remove unused test .sh script by @jbedard in #108
Full Changelog: v0.18.1...v0.19.0
v0.18.1
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "317e3b3816fa9d3d52c60aa37255b884d206e0842e41017ec861a99f95cbea16",
strip_prefix = "rules_swc-0.18.1",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.18.1.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to aspect_bazel_lib 1.16.0 by @gregmagolan in #101
- chore: update to Bazel 6.0.0rc1 and test against both 6.0.0rc1 and 5.3.2 on CI by @gregmagolan in #102
- chore: update to rules_js 1.6.6 by @gregmagolan in #103
Full Changelog: v0.18.0...v0.18.1
v0.18.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_swc",
sha256 = "a6bb53af8562b33e415206a3653dda87ef51fc79317cfc5068504ae4c6c252f7",
strip_prefix = "rules_swc-0.18.0",
url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.18.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 pre-built Rust-node binding 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,
)
# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
What's Changed
- chore: update to aspect_bazel_lib 1.12.1 by @gregmagolan in #95
- chore: update to rules_js 1.6.4 by @gregmagolan in #98
- chore: add comment about order of TOOL_VERSIONS by @gregmagolan in #99
- chore: upgrade to rules_js 1.6.5 by @gregmagolan in #100
Full Changelog: v0.17.1...v0.18.0