v2.0.0-rc5
github-actions
released this
17 Jun 18:08
·
129 commits
to main
since this release
Important
See #1671 for list of BREAKING CHANGES in rules_js 2.0. We'll copy over the list of BREAKING CHANGES to these release notes soon.
Many companies are successfully building with rules_js.
If you're getting value from the project, please let us know!
Just comment on our Adoption Discussion.
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc5")
####### Node.js version #########
# By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
# Optionally you can pin a different node version:
bazel_dep(name = "rules_nodejs", version = "6.2.0")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "16.14.2")
#################################
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
use_repo(pnpm, "pnpm")
Using WORKSPACE
Paste this snippet into your WORKSPACE
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_js",
sha256 = "3bad4ab669d4d38d0d137275b946a46ce6f8f17fecc6c7affba64966a9054246",
strip_prefix = "rules_js-2.0.0-rc5",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc5/rules_js-v2.0.0-rc5.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains")
rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
npm_translate_lock(
name = "npm",
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()
What's Changed
- Changes by create-pull-request action by @github-actions in #1779
- fix: fix issue with bzlmod toolchain registration by bumping minimum rules_nodejs to 6.1.2 by @gregmagolan in #1780
- chore: fixup pattern for try-import of user.bazelrc by @gregmagolan in #1789
- perf: do not put files_runfiles in files + transitive_files by @jbedard in #1782
- perf: avoid cloning data_files when not copy_data_files_to_bin by @jbedard in #1783
- perf: avoid large temp arrays, use single loop by @jbedard in #1784
- perf: avoid js_info param validation on default values by @jbedard in #1785
- chore: bump minimum rules_nodejs to 6.2.0 by @gregmagolan in #1792
- chore: fixup load statement ordering in generated bzl by @gregmagolan in #1795
- fix: handle malformed npm packages gracefully in extract action by @gregmagolan in #1794
- perf: minimize cost of checking bazel version by @dzbarsky in #1800
- perf: use string.elems for char iteration by @DavidZbarsky-at in #1802
- Changes by create-pull-request action by @github-actions in #1804
New Contributors
- @DavidZbarsky-at made their first contribution in #1802
Full Changelog: v2.0.0-rc4...v2.0.0-rc5