v2.0.0-rc6
github-actions
released this
02 Jul 23:20
·
101 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-rc6")
####### 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 = "a723815986f3dd8b2c58d0ea76fde0ed56eed65de3212df712e631e5fc7d8790",
strip_prefix = "rules_js-2.0.0-rc6",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc6/rules_js-v2.0.0-rc6.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
- [perf] Optimize npm_package_store by @DavidZbarsky-at in #1801
- Optimize _is_gnu_tar check by @DavidZbarsky-at in #1807
- refactor: remove optional empty depset direct by @jbedard in #1790
- perf: do not check JsInfo hasattr for always-set attributes by @jbedard in #1786
- perf: only validate deprecated js_info params when extra params specified by @jbedard in #1799
- refactor: sort lock translation action cache content by @jbedard in #1796
- perf: do not include sources,types when transitive_sources,type already included by @jbedard in #1803
- perf: reduce use of bazel_skylib paths.join by @jbedard in #1812
- Changes by create-pull-request action by @github-actions in #1809
- perf: do not double process lifecycle_hooks* attributes in bzlmod by @jbedard in #1805
- perf: change js_helpers gather_* utils to accept list, not depset by @jbedard in #1787
- refactor: change npm_import(is_gnu_tar) to system_tar by @jbedard in #1811
- perf: Allow opting out of arg/env expansion by @DavidZbarsky-at in #1810
- test: npm: dependencies by @jbedard in #1815
- perf: remove unused template vars by @jbedard in #1819
- fix: use .cjs extension for fs patches by @jbedard in #1818
- fix(pnpm): npm: aliases to packages with peer deps by @jbedard in #1824
- refactor(pnpm): strip special characters from pkg labels by @jbedard in #1821
- refactor: remove unused peer_dependencies field by @jbedard in #1826
- perf: reduce string concatenation in lockfile parsing by @jbedard in #1817
- chore(deps): update aspect by @renovate in #1631
- chore(deps): update bazel rulesets by @renovate in #1633
- Revert "chore(deps): update bazel (#1633)" by @jbedard in #1831
- Revert "chore(deps): update aspect rulesets (#1631)" by @jbedard in #1833
- test: align pnpm_workspace[_rerooted] tests by @jbedard in #1832
- refactor: cleanup npm_package_store.bzl by @jbedard in #1834
- fix: transitive js_library npm package deps by @jbedard in #1836
- perf: reduce use of starlark .split by @jbedard in #1820
Full Changelog: v2.0.0-rc5...v2.0.0-rc6