Skip to content

Releases: bazel-contrib/rules_nodejs

0.18.4

08 Feb 21:13
Compare
Choose a tag to compare

MAJOR CHANGE

This is the first rules_nodejs release that uses a distribution artifact.

You should no longer fetch the entire GitHub repository with one of

git_repository(
    name = "build_bazel_rules_nodejs",
    remote = "https://github.com/bazelbuild/rules_nodejs.git",
    tag = "0.18.0"
)
# or
http_archive(
    name = "build_bazel_rules_nodejs",
    urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"],
    strip_prefix = "rules_nodejs-0.16.8",
)

Instead, fetch our distribution tar.gz file:

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

We did this for a few reasons:

  1. It's wasteful for users to download all our tests, examples, and any large files we vendor into our repo.
  2. We cannot trust the sha256 produced by the GitHub frontend to be stable.
  3. We want to start authoring our files in TypeScript, but you should only get JavaScript files. Bazel support for transitive dependencies is weak and hard for users to manage.

Note, this is not a breaking change, you could still fetch the entire repo, emulating a monorepo scheme across multiple repositories, and building everything from source. However we discourage that since it exposes our transitive development-only dependencies like TypeScript.

Other changes

** Breaking change **: if you depended on our internal file, @build_bazel_rules_nodejs//internal:node.bzl, this has been removed. You should now depend on individual files which were re-exported from there.

We have updated our examples. There is a new example of using Parcel.js, to illustrate using an arbitrary npm library in your toolchain. There is also an example of building a web application with Rollup, and injected script and link tags in the index.html.

0.16.8

06 Feb 00:03
Compare
Choose a tag to compare
  • @bazel/bazel now checks for a local installed copy, so it's safe to install globally. It exposes an index.js so that Angular schematics and other tools can locate the binary with require.resolve('@bazel/bazel')
  • Restored earlier behavior that the yarn.lock or package-lock.json in your project is updated by Bazel when running a build.
  • Fix the npm_package rule to copy binary files correctly

0.16.7

01 Feb 16:10
Compare
Choose a tag to compare
  • Deprecate rules_nodejs_dependencies(), this now produces a warning. A later minor will remove the function.
  • Preparation work for installing "hybrid" npm packages that contain bazel workspaces
  • yarn_install and npm_install now default to quiet again, since Bazel 0.21 produces logging output as these run

0.16.5

09 Jan 18:36
Compare
Choose a tag to compare

Update CI to perform format and lint checks, and minor bugfixes

0.16.4

18 Dec 22:33
Compare
Choose a tag to compare

Introduce web_package rule for inserting script tags and link tags into html.

0.16.3

04 Dec 21:03
Compare
Choose a tag to compare

Minor bugfixes

Bugfixes, improved npm/yarn install flow

20 Nov 17:43
Compare
Choose a tag to compare

New behavior of npm_install and yarn_install rules:

  • instead of symlinking the package.json file into bazel, we now copy it. This means Bazel will no longer make edits to your lock file.
  • the output from the command will be streamed to your terminal. Instead of bazel silently saying "analyzing" you'll now see the install progress. Set quiet to True in the npm_install or yarn_install rule to get the previous behavior
  • the exclude_packages attribute filters out @bazel/bazel from being installed again under Bazel.
  • we no longer omit test and .bin directories from the generated BUILD file
  • set the --network-timeout option when running yarn install since we saw a lot of timeouts

0.16.1

16 Nov 15:57
Compare
Choose a tag to compare

Minor bugfixes

Performance fix: remove globs

13 Nov 21:26
Compare
Choose a tag to compare

Builds should now be faster because Bazel doesn't need to scan directories during the analysis phase. Previously we created BUILD files under the Bazel-managed dependencies when using yarn_install that contained glob
https://docs.bazel.build/versions/master/be/functions.html#glob

Note the new included_files option to yarn_install https://bazelbuild.github.io/rules_nodejs/npm_install/npm_install.html#yarn_install which lets you further trim the files needed as inputs to Bazel actions.

BREAKING CHANGE:

  • yarn_install and npm_install no longer generate "lite" targets like @npm//node_modules/glob:glob__lite

yarn cache

16 Oct 21:08
Compare
Choose a tag to compare

Should improve performance of repository rule yarn_install by using the global yarn cache on your machine.