Releases: bazel-contrib/rules_nodejs
4.6.2
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "2644a66772938db8d8c760334a252f1687455daa7e188073f2d46283f2f6fbb7",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.2/rules_nodejs-4.6.2.tar.gz"],
)
http_archive(
name = "rules_nodejs",
sha256 = "f596117040134b9497a1049efe7a785924b4ff22557669780a0fa37e22b827bd",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.2/rules_nodejs-core-4.6.2.tar.gz"],
)
note, npm packages are tagged lts
rather than latest
What's Changed
- chore: renovate stop sending PRs for examples by @alexeagle in #3246
- fix(cypress): use depsets for runfiles and data by @mrmeku in #3240
- fix(builtin): npm_package_bin include runfiles in DefaultInfo by @alexeagle in #3261
- fix(typescript): propagate tags to validate_options by @djmarcin in #3260
- Update NodeJS Versions by @mattem in #3265
New Contributors
Full Changelog: 4.6.1...4.6.2
5.1.0
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
- @tony-scio made their first contribution in #3305
- @twheys made their first contribution in #3228
Full Changelog: 5.0.2...5.1.0
5.0.2
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
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
- Update esbuild versions by @mattem in #3271
- fix(create): add missing workspace dependency call by @alexeagle in #3272
- Update esbuild versions by @mattem in #3275
- refactor: bbrnj re-exports rules_nodejs providers by @alexeagle in #3274
- refactor: promote directory_file_path to public API by @alexeagle in #3276
- fix(builtin): prevent usage with InputArtifact directories by @alexeagle in #3278
Full Changelog: 5.0.0...5.0.1
5.0.0
🎉 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
onnpm_install
andyarn_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
torules_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 thets_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
Please use 5.0.0 instead
5.0.0-rc.1
Please use 5.0.0-rc2 instead.
5.0.0-rc.0
replaced by 5.0.0-rc.1
4.6.1
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
- fix(builtin): detect yarn 2+ berry and adjust CLI args by @alexeagle in #3195
- fix(typescript): add build_test to ensure typecheck is run under --bu… by @alexeagle in #3196
- chore: code review feedback for #3195 by @alexeagle in #3203
- Update NodeJS Versions by @mattem in #3211
- Update esbuild versions by @mattem in #3200
- docs: add diff_test note to generated_file_test by @alexeagle in #3217
- fix(typescript): filter out .d.ts before passing srcs to transpiler by @thesayyn in #3238
Full Changelog: 4.6.0...4.6.1
4.6.0
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
- Update NodeJS Versions by @mattem in #3149
- Update esbuild versions by @mattem in #3158
- Update esbuild versions by @mattem in #3161
- Update NodeJS Versions by @mattem in #3154
- fix: bump jasmine-reporters to 2.5.0 by @harsha509 in #3180
- Update esbuild versions by @mattem in #3179
- fix(builtin): js_library: propagate all default_runfiles by @alexeagle in #3183
- Update grpc-web and protobuf dependencies by @ronilichtman in #3185
- feat(typescript): allow alternative transpilers by @alexeagle in #3134
- Revert "fix(builtin): add transitive typings to runfiles provider pro… by @alexeagle in #3189
- fix(typescript): ts_project transpiler produces js_library by @alexeagle in #3187
New Contributors
- @harsha509 made their first contribution in #3180
- @ronilichtman made their first contribution in #3185
Full Changelog: 4.5.1...4.6.0