Skip to content

Commit 9e366d6

Browse files
gregmagolanalexeagle
authored andcommitted
build(examples): update examples/angular & examples/angular_view_engine angular deps
* update examples/angular to latest @angular 9.0.0-rc.7 * update examples/angular to latest @angular/cdk & @angular/material 9.0.0-rc.6 * examples/angular hello-world.component.spec.ts updated to no longer use aotSummaries in TestBed.configureTestModule (that ViewEngine pattern now breaks the build) * cleanup deps in examples/angular since with Ivy ngfactory files no longer pull in extra deps * update examples/angular_view_engine to latest @angular 8.2.14 * update examples/angular_view_engine to latest @angular/bazel 9.0.0-rc.7 * update examples/angular_view_engine to @angular/cli 8.3.12 NB: @angular/cli 8.3.13+ causes error: ``` node_modules/@angular/cli/commands/add-impl.d.ts(7,37): error TS2307: Cannot find module '../../../../dist-schema/packages/angular/cli/lib/config/schema'. error Command failed with exit code 1. ```
1 parent 7669172 commit 9e366d6

14 files changed

Lines changed: 460 additions & 383 deletions

File tree

‎examples/angular/.bazelrc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import %workspace%/../../common.bazelrc
2-
# Use the Angular IVy compiler
2+
# Use the Angular Ivy compiler
33
# See https://github.com/angular/angular/blob/master/docs/BAZEL.md#various-flags-used-for-tests
4-
build --define=compile=aot
4+
build --define=angular_ivy_enabled=True

‎examples/angular/package.json‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"yarn": ">=1.9.2 <2.0.0"
99
},
1010
"dependencies": {
11-
"@angular/animations": "9.0.0-next.11",
12-
"@angular/cdk": "8.2.3",
13-
"@angular/common": "9.0.0-next.11",
14-
"@angular/core": "9.0.0-next.11",
15-
"@angular/forms": "9.0.0-next.11",
16-
"@angular/material": "8.2.3",
17-
"@angular/platform-browser": "9.0.0-next.11",
18-
"@angular/platform-browser-dynamic": "9.0.0-next.11",
19-
"@angular/router": "9.0.0-next.11",
11+
"@angular/animations": "9.0.0-rc.7",
12+
"@angular/cdk": "9.0.0-rc.6",
13+
"@angular/common": "9.0.0-rc.7",
14+
"@angular/core": "9.0.0-rc.7",
15+
"@angular/forms": "9.0.0-rc.7",
16+
"@angular/material": "9.0.0-rc.6",
17+
"@angular/platform-browser": "9.0.0-rc.7",
18+
"@angular/platform-browser-dynamic": "9.0.0-rc.7",
19+
"@angular/router": "9.0.0-rc.7",
2020
"@ngrx/store": "8.3.0",
2121
"date-fns": "1.30.1",
2222
"rxjs": "6.5.3",
@@ -25,10 +25,10 @@
2525
"zone.js": "0.10.2"
2626
},
2727
"devDependencies": {
28-
"@angular/bazel": "9.0.0-rc.2",
29-
"@angular/cli": "9.0.0-next.10",
30-
"@angular/compiler": "9.0.0-next.11",
31-
"@angular/compiler-cli": "9.0.0-next.11",
28+
"@angular/bazel": "9.0.0-rc.7",
29+
"@angular/cli": "9.0.0-rc.7",
30+
"@angular/compiler": "9.0.0-rc.7",
31+
"@angular/compiler-cli": "9.0.0-rc.7",
3232
"@babel/cli": "^7.6.0",
3333
"@babel/core": "^7.6.0",
3434
"@babel/preset-env": "^7.6.0",
@@ -60,7 +60,7 @@
6060
"rollup-plugin-commonjs": "^10.1.0",
6161
"rollup-plugin-node-resolve": "^5.2.0",
6262
"terser": "4.3.1",
63-
"typescript": "3.4.5"
63+
"typescript": "3.6.4"
6464
},
6565
"scripts": {
6666
"build": "bazel build //src:bundle",

examples/angular/patches/@angular+bazel+9.0.0-rc.2.patch renamed to examples/angular/patches/@angular+bazel+9.0.0-rc.7.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
2-
index ccda5a5..00f1624 100755
2+
index 55bd685..3666382 100755
33
--- a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
44
+++ b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
55
@@ -15,9 +15,9 @@ specification of this format at https://goo.gl/jB3GVv

‎examples/angular/src/BUILD.bazel‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ sass_binary(
2525
src = "styles.scss",
2626
)
2727

28-
# We don't import from these, but the generated ngfactory code will
29-
NG_FACTORY_ADDED_IMPORTS = [
30-
"@npm//@angular/animations",
31-
"@npm//@angular/cdk",
32-
"@npm//@angular/material",
33-
"@npm//@angular/forms",
34-
]
35-
3628
ts_library(
3729
name = "initialize_testbed",
3830
testonly = 1,
@@ -53,7 +45,7 @@ ng_module(
5345
"main.prod.ts",
5446
],
5547
tsconfig = ":tsconfig.json",
56-
deps = NG_FACTORY_ADDED_IMPORTS + [
48+
deps = [
5749
"//src/app",
5850
"@npm//@angular/core",
5951
"@npm//@angular/platform-browser",

‎examples/angular/src/app/BUILD.bazel‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,19 @@ load("@npm_angular_bazel//:index.bzl", "ng_module")
22

33
package(default_visibility = ["//:__subpackages__"])
44

5-
# We don't import from these, but the generated ngfactory code will
6-
NG_FACTORY_ADDED_IMPORTS = [
7-
"@npm//@angular/animations",
8-
"@npm//@angular/cdk",
9-
"@npm//@angular/material",
10-
"@npm//@angular/forms",
11-
]
12-
135
ng_module(
146
name = "app",
157
srcs = glob(["*.ts"]),
168
assets = ["app.component.html"],
179
tsconfig = "//src:tsconfig.json",
18-
deps = NG_FACTORY_ADDED_IMPORTS + [
10+
deps = [
1911
"//src/app/hello-world",
2012
"//src/app/home",
2113
"//src/app/todos",
2214
"//src/shared/material",
2315
"@npm//@angular/core",
24-
"@npm//@angular/router",
2516
"@npm//@angular/platform-browser",
17+
"@npm//@angular/router",
2618
"@npm//@ngrx/store",
2719
],
2820
)

‎examples/angular/src/app/hello-world/BUILD.bazel‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ sass_binary(
1010
src = "hello-world.component.scss",
1111
)
1212

13-
# We don't import from these, but the generated ngfactory code will
14-
NG_FACTORY_ADDED_IMPORTS = [
15-
"@npm//@angular/cdk",
16-
"@npm//@angular/material",
17-
]
18-
1913
ng_module(
2014
name = "hello-world",
2115
srcs = [
@@ -27,11 +21,9 @@ ng_module(
2721
":hello-world-styles",
2822
],
2923
tsconfig = "//src:tsconfig.json",
30-
deps = NG_FACTORY_ADDED_IMPORTS + [
24+
deps = [
3125
"//src/lib/shorten",
3226
"//src/shared/material",
33-
"@npm//@angular/core",
34-
"@npm//@angular/forms",
3527
"@npm//@angular/router",
3628
"@npm//date-fns",
3729
],
@@ -44,11 +36,10 @@ ts_library(
4436
tsconfig = "//src:tsconfig-test",
4537
deps = [
4638
":hello-world",
39+
"//src/shared/material",
4740
"@npm//@angular/core",
4841
"@npm//@angular/platform-browser",
49-
"@npm//@angular/platform-browser-dynamic",
5042
"@npm//@types/jasmine",
51-
"@npm//@types/node",
5243
],
5344
)
5445

@@ -77,5 +68,7 @@ karma_web_test_suite(
7768
deps = [
7869
":test_lib",
7970
"//src:rxjs_umd_modules",
71+
# explicit tslib dependency comes from @angular/material
72+
"@npm//:node_modules/tslib/tslib.js",
8073
],
8174
)

‎examples/angular/src/app/hello-world/hello-world.component.spec.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {By} from '@angular/platform-browser';
33
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
44

5+
import {MaterialModule} from '../../shared/material/material.module';
6+
57
import {HelloWorldComponent} from './hello-world.component';
6-
import {HelloWorldModuleNgSummary} from './hello-world.module.ngsummary';
78

89
describe('BannerComponent (inline template)', () => {
910
let comp: HelloWorldComponent;
@@ -13,8 +14,7 @@ describe('BannerComponent (inline template)', () => {
1314
beforeEach(async(() => {
1415
TestBed.configureTestingModule({
1516
declarations: [HelloWorldComponent], // declare the test component
16-
aotSummaries: HelloWorldModuleNgSummary,
17-
imports: [BrowserAnimationsModule],
17+
imports: [BrowserAnimationsModule, MaterialModule],
1818
});
1919
TestBed.compileComponents();
2020
}));

‎examples/angular/src/app/todos/BUILD.bazel‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ sass_binary(
88
src = "todos.component.scss",
99
)
1010

11-
# We don't import from these, but the generated ngfactory code will
12-
NG_FACTORY_ADDED_IMPORTS = [
13-
"@npm//@angular/material",
14-
]
15-
1611
ng_module(
1712
name = "todos",
1813
srcs = [
@@ -24,9 +19,9 @@ ng_module(
2419
":todos-styles",
2520
],
2621
tsconfig = "//src:tsconfig.json",
27-
deps = NG_FACTORY_ADDED_IMPORTS + [
28-
"//src/shared/material",
22+
deps = [
2923
"//src/app/todos/reducers",
24+
"//src/shared/material",
3025
"@npm//@angular/common",
3126
"@npm//@angular/core",
3227
"@npm//@angular/forms",

‎examples/angular/src/shared/material/BUILD.bazel‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ load("@npm_angular_bazel//:index.bzl", "ng_module")
22

33
package(default_visibility = ["//:__subpackages__"])
44

5-
# We don't import from these, but the generated ngfactory code will
6-
NG_FACTORY_ADDED_IMPORTS = [
7-
"@npm//@angular/forms",
8-
"@npm//@angular/platform-browser",
9-
]
10-
115
ng_module(
126
name = "material",
137
srcs = glob(["*.ts"]),
148
tsconfig = "//src:tsconfig.json",
15-
deps = NG_FACTORY_ADDED_IMPORTS + [
9+
deps = [
1610
"@npm//@angular/core",
1711
"@npm//@angular/material",
1812
],

‎examples/angular/src/tsconfig.json‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
"es2015.iterable",
99
"es2015.promise"
1010
],
11-
// Allow type-checking to succeed when we import from generated files
12-
// This lets us write out Angular AOT bootstrap by importing the
13-
// ngfactory file.
14-
// Under Angular Ivy, this is unneeded.
15-
"rootDirs": [
16-
".",
17-
"../dist/bin/src",
18-
],
1911
// Permit decorator syntax
2012
"experimentalDecorators": true,
2113
// Don't scan the node_modules/@types folder for ambient types.

0 commit comments

Comments
 (0)