Skip to content

Commit 5998dd3

Browse files
authored
build: update to nodejs v16 and update rules_nodejs to v4 stable (#23485)
1 parent 1b2dc9c commit 5998dd3

File tree

11 files changed

+101
-93
lines changed

11 files changed

+101
-93
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
# To validate changes, use an online parser, eg.
88
# http://yaml-online-parser.appspot.com/
99

10-
var_1: &docker_image circleci/node:14.16.1
11-
var_2: &docker-firefox-image circleci/node:14.16.1-browsers
10+
var_1: &docker_image circleci/node:16.6.0
11+
var_2: &docker-firefox-image circleci/node:16.6.0-browsers
1212

1313
# **Note**: When updating the beginning of the cache key, also update the cache key to match
1414
# the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching.
1515
# Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache.
16-
var_3: &cache_key v8-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
16+
var_3: &cache_key v9-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
1717
# We want to invalidate the cache if the postinstall patches change. In order to apply new
1818
# patches, a clean version of the node modules is needed. Additionally, we invalidate the cache
1919
# if the Bazel version changes. We do this because otherwise the `bazelisk` cache folder will
2020
# contain all previously used versions and ultimately cause the cache restoring to be slower.
21-
var_4: &cache_fallback_key v8-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
21+
var_4: &cache_fallback_key v9-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
2222

2323
# Settings common to each job
2424
var_5: &job_defaults

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.16.1
1+
16.6.0

WORKSPACE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88
# Add NodeJS rules
99
http_archive(
1010
name = "build_bazel_rules_nodejs",
11-
sha256 = "5c40083120eadec50a3497084f99bc75a85400ea727e82e0b2f422720573130f",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-beta.0/rules_nodejs-4.0.0-beta.0.tar.gz"],
11+
sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"],
1313
)
1414

1515
# Add sass rules
@@ -44,7 +44,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "node_repos
4444
check_bazel_version("4.0.0")
4545

4646
node_repositories(
47-
node_version = "14.16.1",
47+
node_version = "16.6.0",
4848
package_json = ["//:package.json"],
4949
)
5050

@@ -96,6 +96,6 @@ load(
9696

9797
_dev_infra_browser_repositories()
9898

99-
load("@npm//@bazel/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
99+
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
100100

101101
esbuild_repositories()

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"license": "MIT",
1111
"engines": {
12-
"node": ">=14.0.0 <16.0.0",
12+
"node": ">=14.0.0 <17.0.0",
1313
"yarn": ">= 1.0.0",
1414
"npm": "Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/"
1515
},
@@ -85,15 +85,15 @@
8585
"@babel/traverse": "^7.13.0",
8686
"@bazel/bazelisk": "1.9.0",
8787
"@bazel/buildifier": "4.0.1",
88-
"@bazel/concatjs": "4.0.0-beta.0",
89-
"@bazel/esbuild": "4.0.0-beta.0",
88+
"@bazel/concatjs": "4.0.0",
89+
"@bazel/esbuild": "4.0.0",
9090
"@bazel/ibazel": "0.15.10",
91-
"@bazel/jasmine": "4.0.0-beta.0",
92-
"@bazel/protractor": "4.0.0-beta.0",
93-
"@bazel/rollup": "4.0.0-beta.0",
94-
"@bazel/runfiles": "4.0.0-beta.0",
95-
"@bazel/terser": "4.0.0-beta.0",
96-
"@bazel/typescript": "4.0.0-beta.0",
91+
"@bazel/jasmine": "4.0.0",
92+
"@bazel/protractor": "4.0.0",
93+
"@bazel/rollup": "4.0.0",
94+
"@bazel/runfiles": "4.0.0",
95+
"@bazel/terser": "4.0.0",
96+
"@bazel/typescript": "4.0.0",
9797
"@firebase/app-types": "^0.6.1",
9898
"@material/animation": "13.0.0-canary.0a9069300.0",
9999
"@material/auto-init": "13.0.0-canary.0a9069300.0",

src/cdk/testing/private/e2e/asserts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function expectLocation(element: FinderResult, {x, y}: Point) {
4040
* Asserts that one element is aligned with another.
4141
*/
4242
export async function expectAlignedWith(element: FinderResult, otherElement: FinderResult) {
43-
await getElement(otherElement).getLocation().then((location: Point) => {
44-
expectLocation(getElement(element), location);
43+
await getElement(otherElement).getLocation().then(async (location: Point) => {
44+
await expectLocation(getElement(element), location);
4545
});
4646
}

src/material-date-fns-adapter/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_test_library", "ng_web_test_suite")
2-
load(":esbuild-amd.bzl", "esbuild_amd")
2+
load("//tools/esbuild:index.bzl", "esbuild_amd")
33

44
package(default_visibility = ["//visibility:public"])
55

src/material-date-fns-adapter/esbuild-amd.bzl

Lines changed: 0 additions & 40 deletions
This file was deleted.

tools/esbuild/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exports_files(["esbuild-amd-config.mjs"])

tools/esbuild/esbuild-amd-config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
globalName: "__exports",
3+
banner: {js: 'define("TMPL_MODULE_NAME", [], function() {'},
4+
footer: {js: 'return __exports;})'},
5+
};

tools/esbuild/index.bzl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
load("@npm//@bazel/esbuild:index.bzl", "esbuild_config", _esbuild = "esbuild")
2+
load("@npm//@angular/dev-infra-private/bazel:expand_template.bzl", "expand_template")
3+
4+
def esbuild(**kwargs):
5+
_esbuild(**kwargs)
6+
7+
"""Generates an AMD bundle for the specified entry-point with the given AMD module name."""
8+
9+
def esbuild_amd(name, entry_point, module_name, testonly, deps):
10+
expand_template(
11+
name = "%s_config" % name,
12+
testonly = testonly,
13+
template = "//tools/esbuild:esbuild-amd-config.mjs",
14+
output_name = "%s_config.mjs" % name,
15+
substitutions = {
16+
"TMPL_MODULE_NAME": module_name,
17+
},
18+
)
19+
20+
esbuild_config(
21+
name = "%s_config_lib" % name,
22+
testonly = testonly,
23+
config_file = "%s_config" % name,
24+
)
25+
26+
_esbuild(
27+
name = "%s_bundle" % name,
28+
testonly = testonly,
29+
deps = deps,
30+
minify = True,
31+
sourcemap = "inline",
32+
platform = "browser",
33+
target = "es2015",
34+
entry_point = entry_point,
35+
config = "%s_config_lib" % name,
36+
)
37+
38+
native.filegroup(
39+
name = name,
40+
testonly = testonly,
41+
srcs = ["%s_bundle" % name],
42+
)

0 commit comments

Comments
 (0)