Skip to content

Commit

Permalink
build: update to angular v9.0.0-next.7 (angular#17147)
Browse files Browse the repository at this point in the history
Ensures the postinstall fails if some replacements could not
be made. This ensures that we don't update Angular and invalidate
some of the workarounds. This would result in broken release output then.
  • Loading branch information
devversion authored and jelbourn committed Sep 19, 2019
1 parent f00ae8d commit f537fba
Show file tree
Hide file tree
Showing 20 changed files with 267 additions and 193 deletions.
14 changes: 7 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Add NodeJS rules (explicitly used for sass bundle rules)
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "3356c6b767403392bab018ce91625f6d15ff8f11c6d772dc84bc9cada01c669a",
# Note that we cannot update to rules_nodejs#0.36.2 as it contains a bug where
# node output binaries cannot be launched on windows. We can update once the
# fix is released: https://github.com/bazelbuild/rules_nodejs/pull/1104.
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.36.1/rules_nodejs-0.36.1.tar.gz"],
sha256 = "da217044d24abd16667324626a33581f3eaccabf80985b2688d6a08ed2f864be",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"],
)

# Add sass rules
Expand Down Expand Up @@ -76,9 +73,12 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"

web_test_repositories()

load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories()
browser_repositories(
chromium = True,
firefox = True,
)

# Fetch transitive dependencies which are needed to use the Sass rules.
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
"requiredAngularVersion": "^8.0.0 || ^9.0.0-0",
"requiredMDCVersion": "^4.0.0-alpha.0",
"dependencies": {
"@angular/animations": "^8.2.2",
"@angular/common": "^8.2.2",
"@angular/compiler": "^8.2.2",
"@angular/core": "^8.2.2",
"@angular/elements": "^8.2.2",
"@angular/forms": "^8.2.2",
"@angular/platform-browser": "^8.2.2",
"@angular/animations": "^9.0.0-next.7",
"@angular/common": "^9.0.0-next.7",
"@angular/compiler": "^9.0.0-next.7",
"@angular/core": "^9.0.0-next.7",
"@angular/elements": "^9.0.0-next.7",
"@angular/forms": "^9.0.0-next.7",
"@angular/platform-browser": "^9.0.0-next.7",
"@types/googlemaps": "^3.37.0",
"@types/youtube": "^0.0.38",
"@webcomponents/custom-elements": "^1.1.0",
Expand All @@ -56,27 +56,27 @@
"systemjs": "0.19.43",
"tsickle": "^0.35.0",
"tslib": "^1.9.3",
"zone.js": "~0.9.1"
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/core": "^8.2.1",
"@angular-devkit/schematics": "^8.2.1",
"@angular/bazel": "^8.2.2",
"@angular/compiler-cli": "^8.2.2",
"@angular/platform-browser-dynamic": "^8.2.2",
"@angular/platform-server": "^8.2.2",
"@angular/router": "^8.2.2",
"@angular/upgrade": "^8.2.2",
"@angular-devkit/core": "^9.0.0-next.5",
"@angular-devkit/schematics": "^9.0.0-next.5",
"@angular/bazel": "^9.0.0-next.7",
"@angular/compiler-cli": "^9.0.0-next.7",
"@angular/platform-browser-dynamic": "^9.0.0-next.7",
"@angular/platform-server": "^9.0.0-next.7",
"@angular/router": "^9.0.0-next.7",
"@angular/upgrade": "^9.0.0-next.7",
"@bazel/bazel": "^0.29.0",
"@bazel/buildifier": "^0.28.0",
"@bazel/ibazel": "^0.10.3",
"@bazel/jasmine": "0.36.1",
"@bazel/karma": "0.36.1",
"@bazel/typescript": "0.36.1",
"@bazel/protractor": "0.36.1",
"@bazel/jasmine": "^0.37.1",
"@bazel/karma": "^0.37.1",
"@bazel/typescript": "^0.37.1",
"@bazel/protractor": "^0.37.1",
"@firebase/app-types": "^0.3.2",
"@octokit/rest": "^16.28.7",
"@schematics/angular": "^8.2.1",
"@schematics/angular": "^9.0.0-next.5",
"@types/browser-sync": "^2.26.1",
"@types/chalk": "^0.4.31",
"@types/fs-extra": "^4.0.3",
Expand All @@ -99,7 +99,7 @@
"browser-sync": "^2.26.7",
"chalk": "^1.1.3",
"clang-format": "^1.2.4",
"codelyzer": "^5.1.0",
"codelyzer": "^5.1.1",
"conventional-changelog": "^3.0.5",
"dgeni": "^0.4.11",
"dgeni-packages": "^0.27.1",
Expand Down
1 change: 1 addition & 0 deletions src/cdk-experimental/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
9 changes: 9 additions & 0 deletions src/cdk/schematics/testing/test-case-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export async function createTestCaseSetup(migrationName: string, collectionPath:
writeFile(relativePath, inputContent);
});

const testAppTsconfigPath = 'projects/cdk-testing/tsconfig.app.json';
const testAppTsconfig = JSON.parse(appTree.readContent(testAppTsconfigPath));

// include all TypeScript files in the project. Otherwise all test input
// files won't be part of the program and cannot be migrated.
testAppTsconfig.include.push('src/**/*.ts');

writeFile(testAppTsconfigPath, JSON.stringify(testAppTsconfig, null, 2));

const runFixers = async function() {
// Switch to the new temporary directory to simulate that "ng update" is ran
// from within the project.
Expand Down
1 change: 1 addition & 0 deletions src/cdk/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
1 change: 1 addition & 0 deletions src/google-maps/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
1 change: 1 addition & 0 deletions src/material-examples/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"public-api.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
1 change: 1 addition & 0 deletions src/material-experimental/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
1 change: 1 addition & 0 deletions src/material-moment-adapter/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"public-api.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
8 changes: 5 additions & 3 deletions src/material/button/testing/shared.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ export function runHarnessTests(

it('should not click a disabled button', async () => {
// Older versions of Edge have a bug where `disabled` buttons are still clickable if
// they contain child elements. We skip this check on Edge.
// See https://stackoverflow.com/questions/32377026/disabled-button-is-clickable-on-edge-browser
if (platform.EDGE) {
// they contain child elements. Also new versions of Firefox (starting v65) do not
// cancel dispatched click events on disabled buttons. We skip this check on Edge and Firefox.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1582570 and:
// https://stackoverflow.com/questions/32377026/disabled-button-is-clickable-on-edge-browser
if (platform.EDGE || platform.FIREFOX) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/material/checkbox/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ng_test_library(
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/checkbox",
Expand Down
7 changes: 7 additions & 0 deletions src/material/checkbox/testing/shared.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Platform} from '@angular/cdk/platform';
import {HarnessLoader} from '@angular/cdk/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Component} from '@angular/core';
Expand All @@ -12,6 +13,7 @@ import {MatCheckboxHarness} from '@angular/material/checkbox/testing/checkbox-ha
*/
export function runHarnessTests(
checkboxModule: typeof MatCheckboxModule, checkboxHarness: typeof MatCheckboxHarness) {
const platform = new Platform();
let fixture: ComponentFixture<CheckboxHarnessTest>;
let loader: HarnessLoader;

Expand Down Expand Up @@ -152,6 +154,11 @@ export function runHarnessTests(
});

it('should not toggle disabled checkbox', async () => {
if (platform.FIREFOX) {
// do run this test on firefox as click events on the label of a disabled checkbox
// cause the value to be changed. https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
return;
}
const disabledCheckbox = await loader.getHarness(checkboxHarness.with({label: 'Second'}));
expect(await disabledCheckbox.isChecked()).toBe(false);
await disabledCheckbox.toggle();
Expand Down
1 change: 1 addition & 0 deletions src/material/radio/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ng_test_library(
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/radio",
Expand Down
9 changes: 9 additions & 0 deletions src/material/radio/testing/shared.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Platform} from '@angular/cdk/platform';
import {HarnessLoader} from '@angular/cdk/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Component} from '@angular/core';
Expand All @@ -10,6 +11,7 @@ import {MatRadioButtonHarness, MatRadioGroupHarness} from './radio-harness';
export function runHarnessTests(radioModule: typeof MatRadioModule,
radioGroupHarness: typeof MatRadioGroupHarness,
radioButtonHarness: typeof MatRadioButtonHarness) {
const platform = new Platform();
let fixture: ComponentFixture<MultipleRadioButtonsHarnessTest>;
let loader: HarnessLoader;

Expand Down Expand Up @@ -225,6 +227,13 @@ export function runHarnessTests(radioModule: typeof MatRadioModule,
});

it('should not be able to check disabled radio-button', async () => {
if (platform.FIREFOX) {
// do run this test on firefox as click events on the label of the underlying
// input checkbox cause the value to be changed. Read more in the bug report:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
return;
}

fixture.componentInstance.disableAll = true;
fixture.detectChanges();

Expand Down
1 change: 1 addition & 0 deletions src/material/slide-toggle/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ng_test_library(
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/slide-toggle",
Expand Down
9 changes: 9 additions & 0 deletions src/material/slide-toggle/testing/shared.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Platform} from '@angular/cdk/platform';
import {HarnessLoader} from '@angular/cdk/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Component} from '@angular/core';
Expand All @@ -10,6 +11,7 @@ import {MatSlideToggleHarness} from '@angular/material/slide-toggle/testing/slid
export function runHarnessTests(
slideToggleModule: typeof MatSlideToggleModule,
slideToggleHarness: typeof MatSlideToggleHarness) {
const platform = new Platform();
let fixture: ComponentFixture<SlideToggleHarnessTest>;
let loader: HarnessLoader;

Expand Down Expand Up @@ -133,6 +135,13 @@ export function runHarnessTests(
});

it('should not toggle disabled slide-toggle', async () => {
if (platform.FIREFOX) {
// do run this test on firefox as click events on the label of the underlying
// input checkbox cause the value to be changed. Read more in the bug report:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
return;
}

const disabledToggle = await loader.getHarness(slideToggleHarness.with({label: 'Second'}));
expect(await disabledToggle.isChecked()).toBe(false);
await disabledToggle.toggle();
Expand Down
1 change: 1 addition & 0 deletions src/material/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
1 change: 1 addition & 0 deletions src/youtube-player/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"typings.d.ts"
],
"angularCompilerOptions": {
"enableIvy": false,
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
Expand Down
Loading

0 comments on commit f537fba

Please sign in to comment.