Skip to content

1.5.0

Compare
Choose a tag to compare
@gregmagolan gregmagolan released this 28 Mar 17:08

To upgrade:

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

and update all your @bazel-scoped npm packages to the matching versions.
yarn: yarn upgrade --scope @bazel
npm: there is no built-in command but you can try npx update-by-scope @bazel

New stuff

  • The ts_project rule is a simple wrapper around the TypeScript compiler, tsc. This is an alternative to ts_library but not a replacement. Read more about the trade-offs at https://bazelbuild.github.io/rules_nodejs/TypeScript#alternatives or read the API docs
  • pkg_npm can now be used as a dependency within your repo as well as for publishing to npm. It provides a LinkablePackageInfo which is our internal API to pass package name/path to downstream compilations, essentially providing the "Lerna" feature.
  • There is experimental support for Bazel's "worker mode" in rollup_bundle, which essentially puts Rollup in watch mode. Add the supports_workers = True attribute to opt-in. (Thanks contributor 👨‍💻 @jbedard )
  • Better support for pre-defined label variables like $(rootpath) and $(execpath) - we no longer recommend using $(location) at all.
  • ts_proto_library (in our labs package, so no stability guarantee) now consumes a proto_library and generates ts_library-compatible type declarations as well as es5/es6 source files. These files are generated via protoc using the protoc-gen-grpc-web plugin. Correspondingly, grpc-web compatible HTTP services are generated if the consumed proto library has an RPC service definition. See https://github.com/bazelbuild/rules_nodejs/tree/master/examples/protocol_buffers for a full example of how to use the rule, and https://github.com/grpc/grpc-web for more information about the generate grpc-web services. (Thanks contributor 👨‍💻 @mrmeku )

Features

  • builtin: add LinkablePackageInfo to pkg_npm, js_library & ts_library (1023852)
  • builtin: add support for predefined variables and custom variable to params_file (34b8cf4)
  • builtin: support $(rootpath), $(execpath), predefined & custom variables in templated_args (5358d56)
  • labs: introduce a new ts_proto_library with grpc support (8b43896)
  • rollup: add worker support to rollup_bundle (66db579)
  • typescript: add devmode_target, devmode_module, prodmode_target & prodmode_module attributes (#1687) (1a83a7f)
  • typescript: add ts_project rule (#1710) (26f6698)

Bug Fixes

  • builtin: entry point of a .tsx file is .js (#1732) (24607ed), closes #1730
  • builtin: fix for nodejs_binary entry point in bazel-out logic (#1739) (a6e29c2) (863c7de)
    closes #1606
  • jasmine: user templated_args should be passed to jasmine after 3 internal templated_args (#1743) (baa68c1)
  • typescript: fix ts_library to allow deps with module_name but no module_root attrs (#1738) (0b5ad2a)
  • typescript: pass rootDir to ts_project tsc actions (#1748) (13caf8b)

Examples

  • examples: fix angular examples prod serve doesn't work on windows (#1699) (063fb13),

Documentation