Skip to content

5.0.0

Compare
Choose a tag to compare
@alexeagle alexeagle released this 20 Jan 20:20
· 235 commits to stable since this release

🎉 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