Skip to content

Commit

Permalink
chore: update to angular 9.0.0-rc.3 with ivy (NG-ZORRO#4453)
Browse files Browse the repository at this point in the history
* chore: update to angular 9 with ivy

* test(module:*): fix tests (#1)

* ci: add now.json

* fix: fix test error

* fix(module:date-picker): add markforcheck when animation is done (#2)

* fix(module: tree): fix tests for 9.0 version (#3)
  • Loading branch information
Yadong Xie committed Nov 22, 2019
1 parent 3fed076 commit 8f74cb7
Show file tree
Hide file tree
Showing 53 changed files with 205 additions and 1,385 deletions.
13 changes: 13 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
titleAndCommits: true
types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.9.0
12.13.1
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ sudo: required
dist: trusty
language: node_js
node_js:
- '12.4.0'

- '12.13.1'
env:
- TASK=build
- TASK=test
Expand All @@ -21,12 +20,16 @@ before_install:

before_script:
- export NG_CLI_ANALYTICS=ci
- npm install -g @angular/cli
- npm install -g @angular/cli@next
- npm install -g karma
- npm install -g surge

script:
- npm run $TASK
- |
if [ "$TASK" = "test" ]; then
cat ./coverage/lcov.info | ./node_modules/.bin/codecov
fi
if [ "$TASK" = "build" ]; then
bash ./scripts/surge.sh
fi
38 changes: 10 additions & 28 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"main": "./site/doc/main.ts",
"tsConfig": "./site/doc/tsconfig.app.json",
"polyfills": "./site/doc/polyfills.ts",
"aot": true,
"assets": [
"site/doc/assets",
"site/doc/manifest.json",
Expand Down Expand Up @@ -51,33 +52,14 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true
},
"ivy": {
"tsConfig": "./site/doc/tsconfig-ivy.server.json"
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"es5": {
"tsConfig": "./site/doc/tsconfig.es5.json",
"fileReplacements": [
{
"replace": "./site/doc/environments/environment.ts",
"with": "./site/doc/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true
"tsConfig": "./site/doc/tsconfig.es5.json"
}
}
},
Expand Down Expand Up @@ -138,6 +120,7 @@
"index": "./site/iframe/index.html",
"main": "./site/iframe/main.ts",
"tsConfig": "./site/iframe/tsconfig.app.json",
"aot": true,
"polyfills": "./site/iframe/polyfills.ts",
"assets": [
{
Expand All @@ -163,7 +146,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand Down Expand Up @@ -210,6 +192,11 @@
"options": {
"tsConfig": "components/tsconfig.lib.json",
"project": "components/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "components/tsconfig.lib.prod.json"
}
}
},
"test": {
Expand All @@ -233,11 +220,6 @@
"polyfills": "components/polyfills.ts",
"tsConfig": "components/tsconfig.spec.json",
"scripts": []
},
"configurations": {
"ivy": {
"tsConfig": "components/tsconfig-ivy.spec.json"
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion components/anchor/nz-anchor-link.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class NzAnchorLinkComponent implements OnInit, OnDestroy {
@Input() nzHref = '#';

titleStr: string | null = '';
titleTpl: TemplateRef<void>;
// tslint:disable-next-line:no-any
titleTpl: TemplateRef<any>;
active: boolean = false;

@Input()
Expand Down
6 changes: 0 additions & 6 deletions components/core/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ export function WithConfig<T>(componentName: NzConfigKey, innerDefaultValue?: T)
return function ConfigDecorator(target: any, propName: any, originalDescriptor?: TypedPropertyDescriptor<T>): any {
const privatePropName = `$$__assignedValue__${propName}`;

if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
console.warn(
`The prop "${privatePropName}" is already exist, it will be override by ${componentName} decorator.`
);
}

Object.defineProperty(target, privatePropName, {
configurable: true,
writable: true,
Expand Down
25 changes: 1 addition & 24 deletions components/core/config/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { NzButtonComponent, NzButtonModule } from 'ng-zorro-antd/button';
import { NzConfigService, NZ_CONFIG, WithConfig } from 'ng-zorro-antd/core';

@Component({
template: ''
})
export class NzGlobalConfigTestBindTwiceComponent {
@WithConfig('button', 'b') @WithConfig('button', 'a') v: string;

constructor(public nzConfigService: NzConfigService) {}
}
import { NzConfigService, NZ_CONFIG } from 'ng-zorro-antd/core';

@Component({
template: `
Expand All @@ -31,20 +22,6 @@ describe('nz global config', () => {
let button: DebugElement;
let buttonEl: HTMLButtonElement;

describe('decorator', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [NzGlobalConfigTestBindTwiceComponent]
}).compileComponents();
}));

it('should not decorate a property twice', () => {
expect(() => {
TestBed.createComponent(NzGlobalConfigTestBasicComponent);
}).toThrowError();
});
});

describe('without config', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
Expand Down
5 changes: 2 additions & 3 deletions components/core/testing/event-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ export function createMouseEvent(type: string, x: number = 0, y: number = 0, but
export function createTouchEvent(type: string, pageX: number = 0, pageY: number = 0): UIEvent {
// In favor of creating events that work for most of the browsers, the event is created
// as a basic UI Event. The necessary details for the event will be set manually.
const event = document.createEvent('UIEvent');
const event = new UIEvent(type, { detail: 0, view: window });
const touchDetails = { pageX, pageY, clientX: pageX, clientY: pageY };
event.initUIEvent(type, true, true, window, 0);

// Most of the browsers don't have a "initTouchEvent" method that can be used to define
// the touch details.
Expand Down Expand Up @@ -78,7 +77,7 @@ export function createKeyboardEvent(type: string, keyCode: number, target?: Elem
// IE won't set `defaultPrevented` on synthetic events so we need to do it manually.
// tslint:disable-next-line:typedef
event.preventDefault = function() {
Object.defineProperty(event, 'defaultPrevented', { get: () => true });
Object.defineProperty(event, 'defaultPrevented', { get: () => true, configurable: true });
// tslint:disable-next-line:no-invalid-this
return originalPreventDefault.apply(this, arguments);
};
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/nz-date-picker.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('NzDatePickerComponent', () => {
fixtureInstance.nzValue = new Date();
fixture.detectChanges();
// Do it 2 times to normalize the value of the element.
// Also Check whether input is focused when we continuous open panel
const action = () => {
openPickerByClickTrigger();
expect(document.activeElement).toEqual(queryFromOverlay('input.ant-calendar-input'));
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export class NzPickerComponent implements AfterViewInit, OnChanges {
animationDone(): void {
if (!this.realOpenState) {
this.animationOpenState = false;
this.changeDetector.markForCheck();
}
}
}
Expand Down
42 changes: 0 additions & 42 deletions components/dropdown/nz-dropdown-button.component.html

This file was deleted.

98 changes: 0 additions & 98 deletions components/dropdown/nz-dropdown-button.component.ts

This file was deleted.

6 changes: 0 additions & 6 deletions components/dropdown/nz-dropdown-context.component.html

This file was deleted.

Loading

0 comments on commit 8f74cb7

Please sign in to comment.