Skip to content

Releases: bazelbuild/rules_nodejs

5.1.0

02 Feb 20:31
Compare
Choose a tag to compare

Big thanks to @twheys for extending ts_project to allow filegroup-like inputs (where the outputs cannot be pre-declared by the rule)
and to @fmeum for a signficant performance fix for npm packages in the analysis phase!

Upgrade:

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "c077680a307eb88f3e62b0b662c2e9c6315319385bc8c637a861ffdbed8ca247",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.1.0/rules_nodejs-5.1.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")

build_bazel_rules_nodejs_dependencies()

and update @bazel-scoped npm packages.

For the "core" package

http_archive(
    name = "rules_nodejs",
    sha256 = "03b542b22a95c4b6591630f3f6b176294033e190e08e044bdb23883693702b6b",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.1.0/rules_nodejs-core-5.1.0.tar.gz"],
)

What's Changed

  • Update esbuild versions by @mattem in #3303
  • Add Glean as an organizational adopter by @tony-scio in #3305
  • fix(builtin): make linker aspect run in constant time per target by @fmeum in #3301
  • fix(builtin): reduce linker debug string allocations by @fmeum in #3309
  • Update NodeJS Versions by @mattem in #3308
  • Update esbuild versions by @mattem in #3307
  • Changed calculation of outs in ts_project to support using rule outputs as srcs by @twheys in #3228

New Contributors

Full Changelog: 5.0.2...5.1.0

5.0.2

27 Jan 23:30
Compare
Choose a tag to compare

Upgrade with:

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "a09edc4ba3931a856a5ac6836f248c302d55055d35d36e390a0549799c33145b",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.2/rules_nodejs-5.0.2.tar.gz"],
)

# or

http_archive(
    name = "rules_nodejs",
    sha256 = "cc747e23225cde1811ca7a001b765011e9f84598fd8f0d7dfaeb61dec6b5bc1a",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.2/rules_nodejs-core-5.0.2.tar.gz"],
)

What's Changed

  • fix(builtin): pass kwargs from node_repositories helper by @alexeagle in #3287
  • Update esbuild versions by @mattem in #3288
  • fix(jasmine): replace deprecated Jasmine APIs that have been removed in version 4 by @alan-agius4 in #3283
  • fix: use robocopy in copy_file#is_directory so we don't hit file path length limit of xcopy by @gregmagolan in #3295
  • fix(jasmine): can not reference runner when exports_directories_only=… by @thesayyn in #3293

Full Changelog: 5.0.1...5.0.2

5.0.1

24 Jan 14:20
Compare
Choose a tag to compare

Upgrade to 5.0.0 first. Then, change WORKSPACE:

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "f690430f4d4cc403b5c90d0f0b21842183b56b732fff96cfe6555fe73189906a",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.1/rules_nodejs-5.0.1.tar.gz"],
)

load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
build_bazel_rules_nodejs_dependencies()

for Core package

http_archive(
    name = "rules_nodejs",
    sha256 = "4537c08222a171bf9d7f96bab7da04daa986ca1386c035daf8a54fbeeb6abdf2",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.1/rules_nodejs-core-5.0.1.tar.gz"],
)

Then update @bazel-scoped npm packages.

What's Changed

Full Changelog: 5.0.0...5.0.1

5.0.0

20 Jan 20:20
Compare
Choose a tag to compare

🎉 Here it is, our twice-yearly major release with breaking changes and big improvements.

To upgrade, first change WORKSPACE:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "6b951612ce13738516398a8057899394e2b7a779be91e1a68f75f25c0a938864",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.0/rules_nodejs-5.0.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
build_bazel_rules_nodejs_dependencies()

or for the "core" package

http_archive(
    name = "rules_nodejs",
    sha256 = "ee6e86e76fa558f83be7c13c32a4eafac2f03a25955ce0661cec7cddec58f8c4",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.0/rules_nodejs-core-5.0.0.tar.gz"],
)

Then update @bazel-scoped npm packages to latest.

Finally, look through the migration guide at https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0. We'll continue updating this as users get through the migration.

Overview

The theme of the 5.0 release is reducing scope, tech debt, and maintenance burden of rules_nodejs, and unlocking the power of the community to build rulesets and extensions on top.

  • export_directories_only on npm_install and yarn_install is now True by default. This greatly speeds up builds by modelling third-party npm packages as directories rather than individual files, so Bazel has orders of magnitude fewer FS operations to perform in setting up a sandbox or runfiles tree. Thanks to our friends at EngFlow for sponsoring this work!
  • We're slowly renaming build_bazel_rules_nodejs to rules_nodejs by introducing the latter first as a "core" package. Most users are not yet affected. See "core" package docs.
  • The @bazel/typescript npm package is now much smaller, since the ts_library rule moved into @bazel/concatjs
  • You can now use multiple versions of Node, since we reworked our toolchains support.
  • We updated handling of --stamp to produce VCS-stamped outputs, see #3162

What's Changed

  • refactor(builtin): npm_umd_bundle no longer allows directory sources by @alexeagle in #3010
  • refactor: move ts_library to packages/concatjs by @alexeagle in #3035
  • refactor: remove nested build_bazel_rules_typescript workspace by @alexeagle in #3036
  • refactor: depend on bazel-skylib at runtime by @alexeagle in #3056
  • refactor: remove packages/angular by @alexeagle in #3045
  • refactor: remove labs package by @alexeagle in #3061
  • chore: update default nodejs version to 16 by @alexeagle in #3107
  • chore: cleanup _maybe helpers by @alexeagle in #3127
  • chore: build_bazel_rules_nodejs depends on rules_nodejs by @alexeagle in #3130
  • feat(node): use multiple versions of node, can run old and new toolch… by @dymart in #3125
  • refactor: move platform definitions to core by @alexeagle in #3131
  • chore: cleanup duplicate symbols in WORKSAPCE file by @gregmagolan in #3135
  • feat(): macros nodejs_binary_toolchains nodejs_test_toolchains input … by @dymart in #3132
  • fix(): remove node and use toolchain by @dymart in #3144
  • fix(): remove _repository_args from nodejs_binary by @dymart in #3142
  • fix(builtin): pkg_npm shouldn't assume the name of the nodejs toolchain by @alexeagle in #3129
  • chore: concatjs shouldn't rely on hardcoded @nodejs name by @alexeagle in #3163
  • feat(builtin): npm_install/yarn_install node repo by @alexeagle in #3164
  • ci: configs use new toolchain by @alexeagle in #3166
  • refactor: use new toolchain for running docs processing by @alexeagle in #3168
  • refactor: linker tests use new toolchain by @alexeagle in #3169
  • chore: always install rules_nodejs_dependencies by @alexeagle in #3170
  • refactor: use new toolchain for nodejs_binary by @alexeagle in #3167
  • refactor: deprecate node_repositories by @alexeagle in #3171
  • chore: remove soldair from codeowners by @alexeagle in #3178
  • docs: turn e2e/core into toolchain example by @alexeagle in #3177
  • refactor: remove legacy node toolchain by @alexeagle in #3172
  • refactor: split up @rules_nodjes and @build_bazel_rules_nodejs workspaces entirely by @gregmagolan in #3173
  • feat: add StampSettingsInfo and STAMP_ATTRS by @gregmagolan in #3162
  • chore(typescript): allow newer TS versions by @alexeagle in #3191
  • chore: fixup load statement in ts_project/swc/tests/bzl by @gregmagolan in #3197
  • chore: cleanup windows build & test tags by @gregmagolan in #3198
  • feat: add src patch being copied to progress message of vendored copy_file by @gregmagolan in #3206
  • chore: add --incompatible_exclusive_test_sandboxed to common and --keep_going for CircleCI by @gregmagolan in #3205
  • refactor: split ts_project.bzl by @alexeagle in #3208
  • chore: remove vendored bazel-skylib used by ts_project by @alexeagle in #3207
  • refactor: remove package_json attribute from node_repositories by @gregmagolan in #3213
  • fix: turn off preserve_symlinks in e2e/node_loader_no_preserve_symlinks test by @gregmagolan in #3216
  • fix: change all cfg=host and cfg=target executable attributes to cfg=exec by @gregmagolan in #3215
  • refactor: set symlink_node_modules default to False in yarn_install and npm_install by @gregmagolan in #3214
  • fix: use tree artifacts via copy_directory with exports_directories_only by @gregmagolan in #2996
  • refactor: remove user_managed_deps examples by @gregmagolan in #3220
  • chore: update bazel to 4.2 by @alexeagle in #2926
  • fix(typescript): better error when transpiler is used and no declarat… by @alexeagle in #3223
  • feat: set exports_directories_only default to True in yarn_install & npm_install repository rules by @gregmagolan in #3219
  • docs: update for 5.0 by @alexeagle in #3174
  • refactor: move yarn fetch to a separate external repo by @alexeagle in #3230
  • chore: remove check_bazel_version by @alexeagle in #3225
  • test: re-enable examples_webapp by @alexeagle in #3224
  • feat: default package_path to the directory of the package.json file in yarn_install and npm_install by @gregmagolan in #3233
  • refactor: remove vendored_node by @alexeagle in #3234
  • fix: create a bazel-out node_modules tree using copy_file in the external repo when exports_directories_only is True by @gregmagolan in #3241
  • chore(esbuild): remove default value of npm from the npm_repository attr by @mattem in #3268

New Contributors

Full Changelog: 4.4.0...5.0.0-rc.0

5.0.0-rc.2

17 Jan 19:52
Compare
Choose a tag to compare
5.0.0-rc.2 Pre-release
Pre-release

Please use 5.0.0 instead

5.0.0-rc.1

14 Jan 21:14
Compare
Choose a tag to compare
5.0.0-rc.1 Pre-release
Pre-release

Please use 5.0.0-rc2 instead.

5.0.0-rc.0

14 Jan 16:23
Compare
Choose a tag to compare
5.0.0-rc.0 Pre-release
Pre-release

replaced by 5.0.0-rc.1

4.6.1

13 Jan 22:20
Compare
Choose a tag to compare

To upgrade,

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e4654",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz"],
)

# new "core" package
http_archive(
    name = "rules_nodejs",
    sha256 = "1962378ca94c37cc18521c86e2fa79b3715b6bb75ac0ec43c321f92274a56e16",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-core-4.6.1.tar.gz"],
)

and update @bazel-scoped npm packages.

What's Changed

Full Changelog: 4.6.0...4.6.1

4.6.0

06 Jan 04:47
Compare
Choose a tag to compare

To update:

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "ddb78717b802f8dd5d4c01c340ecdc007c8ced5c1df7db421d0df3d642ea0580",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.0/rules_nodejs-4.6.0.tar.gz"],
)

or for the core package

http_archive(
    name = "rules_nodejs",
    sha256 = "005c59bf299d15d1d9551f12f880b1a8967fa883654c897907a667cdbb77c7a6",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.0/rules_nodejs-core-4.6.0.tar.gz"],
)

and update @bazel-scoped npm packages.

New Feature: faster TypeScript transpiles

We've added an attribute to ts_project called transpiler which lets you swap out which program is used to generate the JavaScript outputs, while still using tsc for type-checking. This pattern lets you decouple type-checking from your development loop, enabling an order of magnitude faster rebuilds, without having to create lots of boilerplate in your BUILD.bazel configs.

As an example, we've been using SWC in some large codebases and saw ~20x speedup in transpilation time. Here's a tiny working example

See the documentation for the transpiler attribute for more info on this.

Thanks to our friends at EngFlow for sponsoring this work!

What's Changed

New Contributors

Full Changelog: 4.5.1...4.6.0

4.5.1

17 Dec 03:57
Compare
Choose a tag to compare

Re-release of 4.5.0 for systems that cached wrong .tar.gz artifacts which were live for several hours.

No code changes from 4.5.0, and no npm packages for this release.

http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "f0f76a06fd6c10e8fb9a6cb9389fa7d5816dbecd9b1685063f89fb20dc6822f3",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.5.1/rules_nodejs-4.5.1.tar.gz"],
)
# OR
http_archive(
    name = "rules_nodejs",
    sha256 = "21ace31956ed2d42c4d1a71ec9bf44e88edc8d4e6d3e88f7743a56ee1fc95bb1",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.5.1/rules_nodejs-core-4.5.1.tar.gz"],
)