Skip to content

Commit 5fb022f

Browse files
jelbourngregmagolan
authored andcommitted
chore: update master to angular version 8 beta (#15392)
This allows us to cherry-pick @kara's static query updates from the `ivy-2019` branch. This change includes: * Adding missing dependencies for various Angular subpackages * Add umd assets where they are now necessary * Configure bazel to target ES5 output as a workaround for angular/angular#29107 * Updates most npm dependencies to the @npm// workspace * Updates general workspace setup, RBE config, ngcontainer * Update to rxjs 6.4.0 (building from source no longer needed) * Added rxjs_shims for ts_web_test and ts_devserver targets * Removed index.bzl and angular_material_setup_workspace (not needed anymore since material won't be built from source) * Use browser_repositories() from @npm_bazel_karma which have pinned browsers that work on all platforms * Change dgeni processor functions from arrow function to `function` to work around `@npm//di` not supporting arrow functions Co-authored-by: Greg Magolan <[email protected]>
1 parent 4704653 commit 5fb022f

File tree

104 files changed

+1009
-1615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1009
-1615
lines changed

.circleci/base-rbe-bazelrc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ build:remote --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jd
3434
build:remote --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
3535
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
3636
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
37-
build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain
37+
build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/default:toolchain
3838
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
3939
# Platform flags:
4040
# The toolchain container used for execution is defined in the target indicated
@@ -44,7 +44,7 @@ build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
4444
# "extra_toolchains" to be selected (given constraints defined in
4545
# "exec_compatible_with").
4646
# More about platforms: https://docs.bazel.build/versions/master/platforms.html
47-
build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/cpp:cc-toolchain-clang-x86_64-default
47+
build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/cpp:cc-toolchain-clang-x86_64-default
4848
build:remote --extra_execution_platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
4949
build:remote --host_platform=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
5050
build:remote --platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604
@@ -104,7 +104,7 @@ build:results-local --bes_results_url="https://source.cloud.google.com/results/i
104104
# with the rbe-ubuntu16-04 container. Use of these flags is still experimental.
105105
build:docker-sandbox --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
106106
build:docker-sandbox --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
107-
build:docker-sandbox --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain
107+
build:docker-sandbox --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.22.0/default:toolchain
108108
build:docker-sandbox --experimental_docker_image=gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:9bd8ba020af33edb5f11eff0af2f63b3bcb168cd6566d7b27c6685e717787928
109109
build:docker-sandbox --spawn_strategy=docker
110110
build:docker-sandbox --strategy=Javac=docker
@@ -118,7 +118,6 @@ build:docker-sandbox --experimental_enable_docker_sandbox
118118
# across machines, developers, and workspaces.
119119
build:remote-cache --remote_cache=remotebuildexecution.googleapis.com
120120
build:remote-cache --tls_enabled=true
121-
build:remote-cache --experimental_strict_action_env=true
122121
build:remote-cache --remote_timeout=3600
123122
build:remote-cache --auth_enabled=true
124123
build:remote-cache --spawn_strategy=standalone

.circleci/bazel.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
66
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
7-
build --experimental_repository_cache=/home/circleci/bazel_repository_cache
7+
build --repository_cache=/home/circleci/bazel_repository_cache
88

99
########################################
1010
# Remote Build Execution support on CI #

.circleci/config.yml

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

10-
var_1: &docker_image angular/ngcontainer:0.7.0
10+
var_1: &docker_image angular/ngcontainer:0.10.0
1111
var_2: &cache_key v2-ng-mat-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}-0.7.0
1212

1313
# Settings common to each job
@@ -367,8 +367,10 @@ workflows:
367367

368368
integration_tests:
369369
jobs:
370-
- e2e_tests:
371-
filters: *ignore_presubmit_branch_filter
370+
# Temporarily disable e2e tests until https://github.com/angular/angular/issues/29123
371+
# is resolved.
372+
# - e2e_tests:
373+
# filters: *ignore_presubmit_branch_filter
372374
- prerender_build:
373375
filters: *ignore_presubmit_branch_filter
374376

WORKSPACE

Lines changed: 56 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
55
# Add NodeJS rules (explicitly used for sass bundle rules)
66
http_archive(
77
name = "build_bazel_rules_nodejs",
8-
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.16.5.zip",
9-
strip_prefix = "rules_nodejs-0.16.5",
10-
)
11-
12-
# Add TypeScript rules
13-
http_archive(
14-
name = "build_bazel_rules_typescript",
15-
# Explicitly depend on https://github.com/bazelbuild/rules_typescript/pull/327 which fixes the devserver
16-
# for windows. Once this has been reviewed and merged, we can switch back to a normal release.
17-
url = "https://github.com/bazelbuild/rules_typescript/archive/2e761b53ca465a140c4a265cb80887e7bcf61eb9.zip",
18-
strip_prefix = "rules_typescript-2e761b53ca465a140c4a265cb80887e7bcf61eb9",
19-
)
20-
21-
# Add Angular source and Bazel rules.
22-
http_archive(
23-
name = "angular",
24-
url = "https://github.com/angular/angular/archive/7.2.1.zip",
25-
strip_prefix = "angular-7.2.1",
26-
)
27-
28-
# Add RxJS as repository because those are needed in order to build Angular from source.
29-
# Also we cannot refer to the RxJS version from the node modules because self-managed
30-
# node modules are not guaranteed to be installed.
31-
# TODO(gmagolan): remove this once rxjs ships with an named UMD bundle and we
32-
# are no longer building it from source.
33-
http_archive(
34-
name = "rxjs",
35-
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
36-
strip_prefix = "package/src",
37-
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
38-
)
39-
40-
# We need to create a local repository called "npm" because currently Angular Material
41-
# stores all of it's NPM dependencies in the "@matdeps" repository. This is necessary because
42-
# we don't want to reserve the "npm" repository that is commonly used by downstream projects.
43-
# Since we still need the "npm" repository in order to use the Angular or TypeScript Bazel
44-
# rules, we create a local repository that is just defined in **this** workspace and is not
45-
# being shipped to downstream projects. This can be removed once downstream projects can
46-
# consume Angular Material completely from NPM.
47-
# TODO(devversion): remove once Angular Material can be consumed from NPM with Bazel.
48-
local_repository(
49-
name = "npm",
50-
path = "tools/npm-workspace"
8+
sha256 = "5c86b055c57e15bf32d9009a15bcd6d8e190c41b1ff2fb18037b75e0012e4e7c",
9+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.26.0/rules_nodejs-0.26.0.tar.gz"],
5110
)
5211

5312
# Add sass rules
5413
http_archive(
5514
name = "io_bazel_rules_sass",
15+
sha256 = "f71709f4c2d39e81c9b452e00f22e554b26d7beacaedc5b85d61f771fd01268d",
5616
url = "https://github.com/bazelbuild/rules_sass/archive/1.16.1.zip",
5717
strip_prefix = "rules_sass-1.16.1",
5818
)
5919

60-
# Since we are explitly fetching @build_bazel_rules_typescript, we should explicitly ask for
61-
# its transitive dependencies in case those haven't been fetched yet.
62-
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
63-
rules_typescript_dependencies()
64-
65-
# Since we are explitly fetching @build_bazel_rules_nodejs, we should explicitly ask for
66-
# its transitive dependencies in case those haven't been fetched yet.
67-
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
68-
rules_nodejs_dependencies()
69-
70-
# Fetch transitive dependencies which are needed by the Angular build targets.
71-
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
72-
rules_angular_dependencies()
73-
74-
# Fetch transitive dependencies which are needed to use the Sass rules.
75-
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
76-
rules_sass_dependencies()
77-
78-
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
20+
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
7921

8022
# The minimum bazel version to use with this repo is 0.18.0
8123
check_bazel_version("0.18.0")
@@ -87,32 +29,67 @@ node_repositories(
8729
yarn_version = "1.12.1",
8830
)
8931

32+
yarn_install(
33+
name = "npm",
34+
package_json = "//:package.json",
35+
# Ensure that the script is available when running `postinstall` in the Bazel sandbox.
36+
data = [
37+
"//:tools/npm/check-npm.js",
38+
"//:angular-tsconfig.json",
39+
],
40+
yarn_lock = "//:yarn.lock",
41+
)
42+
43+
# Install all bazel dependencies of the @ngdeps npm packages
44+
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
45+
install_bazel_dependencies()
46+
9047
# Setup TypeScript Bazel workspace
91-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
48+
load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace")
9249
ts_setup_workspace()
9350

51+
# Fetch transitive dependencies which are needed to use the karma rules.
52+
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")
53+
rules_karma_dependencies()
54+
55+
# Fetch transitive dependencies which are needed to use the Sass rules.
56+
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
57+
rules_sass_dependencies()
58+
9459
# Setup the Sass rule repositories.
9560
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
9661
sass_repositories()
9762

98-
# Setup Angular workspace for building (Bazel managed node modules)
99-
load("@angular//:index.bzl", "ng_setup_workspace")
100-
ng_setup_workspace()
63+
# Setup web testing. We need to setup a browser because the web testing rules for TypeScript need
64+
# a reference to a registered browser (ideally that's a hermetic version of a browser)
65+
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
66+
web_test_repositories()
10167

102-
load("@angular_material//:index.bzl", "angular_material_setup_workspace")
103-
angular_material_setup_workspace()
68+
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
69+
browser_repositories()
10470

105-
# Setup Go toolchain (required for Bazel web testing rules)
106-
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
107-
go_rules_dependencies()
108-
go_register_toolchains()
71+
# Temporarily add Angular sources and its dependencies to consume the ts_api_guardian,
72+
# remote-build-execution, and protractor stuff.
73+
# TODO(jelbourn): remove this once we can do all the same stuff via @npm//@angular
74+
http_archive(
75+
name = "angular",
76+
sha256 = "a542f00adf5cafbcad24268d69da8e4746c22619699f29c3b3b0259d0ce52974",
77+
url = "https://github.com/angular/angular/archive/8.0.0-beta.6.zip",
78+
strip_prefix = "angular-8.0.0-beta.6",
79+
)
80+
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
81+
rules_angular_dependencies()
82+
load("@angular//:index.bzl", "ng_setup_workspace")
83+
ng_setup_workspace()
10984

110-
# Setup web testing. We need to setup a browser because the web testing rules for TypeScript need
111-
# a reference to a registered browser (ideally that's a hermetic version of a browser)
112-
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories",
113-
"web_test_repositories")
11485

115-
web_test_repositories()
116-
browser_repositories(
117-
chromium = True,
86+
# Bring in bazel_toolchains for RBE stuff.
87+
http_archive(
88+
name = "bazel_toolchains",
89+
sha256 = "109a99384f9d08f9e75136d218ebaebc68cc810c56897aea2224c57932052d30",
90+
strip_prefix = "bazel-toolchains-94d31935a2c94fe7e7c7379a0f3393e181928ff7",
91+
urls = [
92+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/94d31935a2c94fe7e7c7379a0f3393e181928ff7.tar.gz",
93+
"https://github.com/bazelbuild/bazel-toolchains/archive/94d31935a2c94fe7e7c7379a0f3393e181928ff7.tar.gz",
94+
]
11895
)

angular-tsconfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Workaround for https://github.com/angular/angular/issues/18810
2+
// This file is required because when using the Angular NPM packages and building
3+
// with AOT compilation, NGC needs the "ngsummary.json" files.
4+
{
5+
"compilerOptions": {
6+
"lib": [
7+
"dom",
8+
"es2015"
9+
],
10+
"experimentalDecorators": true,
11+
"types": []
12+
},
13+
"include": [
14+
"node_modules/@angular/**/*"
15+
],
16+
"exclude": [
17+
"node_modules/@angular/bazel/**",
18+
"node_modules/@angular/compiler-cli/**",
19+
"node_modules/@angular/**/testing/**"
20+
]
21+
}

e2e/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package(default_visibility=["//visibility:public"])
22

3-
load("@angular//:index.bzl", "protractor_web_test_suite")
3+
load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite")
44
load("//tools:defaults.bzl", "ts_library")
55

66
ts_library(
77
name = "e2e_utils_lib",
88
srcs = glob(["util/**/*.ts"]),
99
tsconfig = ":tsconfig.json",
1010
deps = [
11-
"@matdeps//@types/jasmine",
12-
"@matdeps//protractor"
11+
"@npm//@types/jasmine",
12+
"@npm//protractor"
1313
]
1414
)
1515

@@ -20,8 +20,8 @@ ts_library(
2020
srcs = [spec_file],
2121
tsconfig = ":tsconfig.json",
2222
deps = [
23-
"@matdeps//@types/jasmine",
24-
"@matdeps//protractor",
23+
"@npm//@types/jasmine",
24+
"@npm//protractor",
2525
":e2e_utils_lib",
2626
]
2727
) for spec_file in glob(["components/**/*.spec.ts"])]
@@ -34,7 +34,7 @@ ts_library(
3434
on_prepare = ":start-devserver.js",
3535
server = "//src/e2e-app:devserver",
3636
deps = [
37-
"@matdeps//protractor",
37+
"@npm//protractor",
3838
":%s_specs_lib" % spec_file,
3939
":e2e_utils_lib",
4040
],

index.bzl

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

package.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"node": ">= 5.4.1"
1313
},
1414
"scripts": {
15+
"postinstall": "ngc -p angular-tsconfig.json",
1516
"build": "gulp build-release-packages",
1617
"dev-app": "gulp serve:devapp",
1718
"test": "gulp test",
@@ -30,16 +31,16 @@
3031
"version": "7.3.3",
3132
"requiredAngularVersion": ">=7.0.0",
3233
"dependencies": {
33-
"@angular/animations": "^7.2.1",
34-
"@angular/common": "^7.2.1",
35-
"@angular/compiler": "^7.2.1",
36-
"@angular/core": "^7.2.1",
37-
"@angular/elements": "^7.2.1",
38-
"@angular/forms": "^7.2.1",
39-
"@angular/platform-browser": "^7.2.1",
34+
"@angular/animations": "8.0.0-beta.6",
35+
"@angular/common": "8.0.0-beta.6",
36+
"@angular/compiler": "8.0.0-beta.6",
37+
"@angular/core": "8.0.0-beta.6",
38+
"@angular/elements": "8.0.0-beta.6",
39+
"@angular/forms": "8.0.0-beta.6",
40+
"@angular/platform-browser": "8.0.0-beta.6",
4041
"@webcomponents/custom-elements": "^1.1.0",
4142
"core-js": "^2.6.1",
42-
"rxjs": "^6.3.3",
43+
"rxjs": "^6.4.0",
4344
"systemjs": "0.19.43",
4445
"tsickle": "^0.34.0",
4546
"tslib": "^1.9.3",
@@ -48,15 +49,17 @@
4849
"devDependencies": {
4950
"@angular-devkit/core": "7.1.2",
5051
"@angular-devkit/schematics": "7.1.2",
51-
"@angular/bazel": "^7.2.1",
52-
"@angular/compiler-cli": "^7.2.1",
53-
"@angular/http": "^7.2.1",
54-
"@angular/platform-browser-dynamic": "^7.2.1",
55-
"@angular/platform-server": "^7.2.1",
56-
"@angular/router": "^7.2.1",
52+
"@angular/bazel": "8.0.0-beta.6",
53+
"@angular/compiler-cli": "8.0.0-beta.6",
54+
"@angular/http": "8.0.0-beta.6",
55+
"@angular/platform-browser-dynamic": "8.0.0-beta.6",
56+
"@angular/platform-server": "8.0.0-beta.6",
57+
"@angular/router": "8.0.0-beta.6",
58+
"@angular/upgrade": "8.0.0-beta.6",
5759
"@bazel/ibazel": "^0.9.0",
58-
"@bazel/karma": "0.22.1",
59-
"@bazel/typescript": "0.22.1",
60+
"@bazel/jasmine": "0.26.0",
61+
"@bazel/karma": "0.26.0",
62+
"@bazel/typescript": "0.26.0",
6063
"@firebase/app-types": "^0.3.2",
6164
"@octokit/rest": "^15.9.4",
6265
"@schematics/angular": "7.1.2",
@@ -83,8 +86,8 @@
8386
"clang-format": "^1.2.4",
8487
"codelyzer": "^4.5.0",
8588
"conventional-changelog": "^3.0.5",
86-
"dgeni": "^0.4.10",
87-
"dgeni-packages": "^0.27.0",
89+
"dgeni": "^0.4.11",
90+
"dgeni-packages": "^0.27.1",
8891
"firebase-tools": "^4.1.0",
8992
"fs-extra": "^3.0.1",
9093
"glob": "^7.1.2",

0 commit comments

Comments
 (0)