From e41180295b4b6e52b1b6f763bb07be96207cf78c Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 14:13:22 +0300 Subject: [PATCH 01/14] Support Angular 4 --- package.json | 8 +++++--- src/core/iterable-differ-helper.ts | 13 +++++-------- src/tsconfig.json | 2 +- templates/component.tst | 6 ++++++ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a8f4ced22..42042cd1e 100644 --- a/package.json +++ b/package.json @@ -16,14 +16,16 @@ "author": "Developer Express Inc.", "license": "MIT", "dependencies": { + "@angular/core": "^4.0.0-rc.3", "@types/jquery": "^2.0.0 || ^3.0.0", "jquery": "^2.0.0 || ^3.0.0" }, "peerDependencies": { "devextreme": "~16.2.4", - "@angular/core": "^2.2.1", - "@angular/common": "^2.2.1", - "@angular/forms": "^2.2.1" + "@angular/core": "^2.2.1 || ^4.0.0-rc.1", + "@angular/common": "^2.2.1 || ^4.0.0-rc.1", + "@angular/compiler": "^2.2.1 || ^4.0.0-rc.1", + "@angular/forms": "^2.2.1 || ^4.0.0-rc.1" }, "devDependencies": { "devextreme": "~16.2.4", diff --git a/src/core/iterable-differ-helper.ts b/src/core/iterable-differ-helper.ts index c198d5b08..4dcea97fb 100644 --- a/src/core/iterable-differ-helper.ts +++ b/src/core/iterable-differ-helper.ts @@ -1,10 +1,7 @@ import { Injectable, SimpleChanges, - IterableDiffers, - IterableDiffer, - ChangeDetectorRef, - DefaultIterableDiffer + IterableDiffers } from '@angular/core'; import { @@ -15,9 +12,9 @@ import { export class IterableDifferHelper { private _host: DxComponent; - private _propertyDiffers: { [id: string]: IterableDiffer; } = {}; + private _propertyDiffers: { [id: string]: any; } = {}; - constructor(private _differs: IterableDiffers, private _cdr: ChangeDetectorRef) { } + constructor(private _differs: IterableDiffers) { } setHost(host: DxComponent) { this._host = host; @@ -29,7 +26,7 @@ export class IterableDifferHelper { if (value && Array.isArray(value)) { if (!this._propertyDiffers[prop]) { try { - this._propertyDiffers[prop] = this._differs.find(value).create(this._cdr, null); + this._propertyDiffers[prop] = this._differs.find(value).create(null, null); } catch (e) { } } } else { @@ -40,7 +37,7 @@ export class IterableDifferHelper { doCheck(prop: string) { if (this._propertyDiffers[prop]) { - const changes = this._propertyDiffers[prop].diff(this._host[prop]); + const changes = this._propertyDiffers[prop].diff(this._host[prop]); if (changes && this._host.instance) { this._host.instance.option(prop, this._host[prop]); } diff --git a/src/tsconfig.json b/src/tsconfig.json index e76f0b68e..a318fb46b 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -11,7 +11,7 @@ "declaration": true, "noUnusedParameters": true, "noUnusedLocals": true, - "lib": ["es2015", "dom"] + "lib": ["es2015", "es2015.iterable", "dom"] }, "filesGlob": [ "**/*.ts" diff --git a/templates/component.tst b/templates/component.tst index bae3be26d..b0a04ba24 100644 --- a/templates/component.tst +++ b/templates/component.tst @@ -116,6 +116,12 @@ export class <#= it.className #>Component extends <#= baseClass #> <#? implement } protected _createInstance(element, options) { + // =========== WORKAROUND ============= + // https://github.com/angular/angular/issues/15143 + if (element.firstChild && element.firstChild.nodeType === Node.COMMENT_NODE) { + element.removeChild(element.firstChild); + } + // =========== /WORKAROUND ============= <#? it.isEditor #>let widget = new <#= it.className #>(element, options); if (this.validator) { this.validator.createInstance(element); From 325771af8dcd3075be94b5cd4f29dd1ed093b4a3 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 14:41:48 +0300 Subject: [PATCH 02/14] Update typescript version --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 42042cd1e..08f79aae7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "author": "Developer Express Inc.", "license": "MIT", "dependencies": { - "@angular/core": "^4.0.0-rc.3", "@types/jquery": "^2.0.0 || ^3.0.0", "jquery": "^2.0.0 || ^3.0.0" }, @@ -76,7 +75,7 @@ "remap-istanbul": "0.5.1", "run-sequence": "^1.2.2", "tslint": "^4.0.2", - "typescript": "~2.0.10", + "typescript": "~2.1.6", "yargs": "^6.0.0", "systemjs": "0.19.39", "rxjs": "^5.0.1", From 9f490f82bbdaae1fa310df5da9142a3c06ed11f5 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 15:05:32 +0300 Subject: [PATCH 03/14] Add test for angular 4 --- shippable.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shippable.yml b/shippable.yml index 3ccecf2ba..63fab0c4b 100644 --- a/shippable.yml +++ b/shippable.yml @@ -21,4 +21,6 @@ build: ci: - shippable_retry npm install --unsafe-perm + - gulp test + - shippable_retry npm install @angular/core@4.0.0-rc.3 @angular/common@4.0.0-rc.3 @angular/forms@4.0.0-rc.3 @angular/compiler@4.0.0-rc.3 @angular/platform-browser@4.0.0-rc.3 @angular/platform-browser-dynamic@4.0.0-rc.3 --unsafe-perm - gulp test \ No newline at end of file From f0b1dd4a9ce6929573dce7e98d84746e4e8cb591 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 15:53:54 +0300 Subject: [PATCH 04/14] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d0ac1b02..7eb46d947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +### Features + +- We support Angular 4.0.0-rc.3 + ## 16.2.5 ### Features From 6c332d2df5ddbd40d94e026253a6ed2f8e532a3b Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 20:04:58 +0300 Subject: [PATCH 05/14] Separation building and testing --- gulpfile.js | 20 ++++++++++++++------ package.json | 2 +- shippable.yml | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8b2b8dfac..77e4da073 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -24,7 +24,9 @@ gulp.task('build', [ 'build.tools', 'build.components', 'build.examples' - ] + ], function(done) { + runSequence('build.tests', done); + } ); gulp.task('default', ['build']); @@ -217,7 +219,7 @@ gulp.task('clean.tests', function () { return del([outputFolderPath]); }); -gulp.task('build.tests', ['build.components', 'clean.tests'], function() { +gulp.task('build.tests', ['clean.tests'], function() { var config = buildConfig.components, testConfig = buildConfig.tests; @@ -232,13 +234,13 @@ gulp.task('watch.spec', function() { gulp.watch(buildConfig.components.tsTestSrc, ['build.tests']); }); -gulp.task('test.components', ['build.tests'], function(done) { +gulp.task('test.components', function(done) { new karmaServer({ configFile: __dirname + '/karma.conf.js' }, done).start(); }); -gulp.task('test.components.debug', ['build.tests'], function(done) { +gulp.task('test.components.debug', function(done) { new karmaServer({ configFile: __dirname + '/karma.conf.js', browsers: [ 'Chrome' ], @@ -246,7 +248,7 @@ gulp.task('test.components.debug', ['build.tests'], function(done) { }, done).start(); }); -gulp.task('test.tools', ['build.tools'], function(done) { +gulp.task('test.tools', function(done) { var config = buildConfig.tools.tests; return gulp.src(config.srcFilesPattern) @@ -265,13 +267,19 @@ gulp.task('test.tools', ['build.tools'], function(done) { })); }); -gulp.task('test', function(done) { +gulp.task('test.run', function(done) { runSequence( ['test.tools', 'test.components'], 'lint', done); }); +gulp.task('test', function(done) { + runSequence( + 'build', 'test.run', + done); +}); + gulp.task('watch.test', function(done) { new karmaServer({ configFile: __dirname + '/karma.conf.js' diff --git a/package.json b/package.json index 08f79aae7..c58e3eb13 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "remap-istanbul": "0.5.1", "run-sequence": "^1.2.2", "tslint": "^4.0.2", - "typescript": "~2.1.6", + "typescript": "~2.0.10", "yargs": "^6.0.0", "systemjs": "0.19.39", "rxjs": "^5.0.1", diff --git a/shippable.yml b/shippable.yml index 63fab0c4b..e531f4f27 100644 --- a/shippable.yml +++ b/shippable.yml @@ -22,5 +22,5 @@ build: ci: - shippable_retry npm install --unsafe-perm - gulp test - - shippable_retry npm install @angular/core@4.0.0-rc.3 @angular/common@4.0.0-rc.3 @angular/forms@4.0.0-rc.3 @angular/compiler@4.0.0-rc.3 @angular/platform-browser@4.0.0-rc.3 @angular/platform-browser-dynamic@4.0.0-rc.3 --unsafe-perm - - gulp test \ No newline at end of file + - shippable_retry npm install @angular/core@~4.0.0-0 @angular/common@~4.0.0-0 @angular/forms@~4.0.0-0 @angular/compiler@~4.0.0-0 @angular/platform-browser@~4.0.0-0 @angular/platform-browser-dynamic@~4.0.0-0 --unsafe-perm + - gulp test.run \ No newline at end of file From 4e2fa57084cc0cf4d167f45f912733d101d9067d Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 20:24:08 +0300 Subject: [PATCH 06/14] Refactoring --- package.json | 1 - src/core/iterable-differ-helper.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index c58e3eb13..86d8c14bb 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "devextreme": "~16.2.4", "@angular/core": "^2.2.1 || ^4.0.0-rc.1", "@angular/common": "^2.2.1 || ^4.0.0-rc.1", - "@angular/compiler": "^2.2.1 || ^4.0.0-rc.1", "@angular/forms": "^2.2.1 || ^4.0.0-rc.1" }, "devDependencies": { diff --git a/src/core/iterable-differ-helper.ts b/src/core/iterable-differ-helper.ts index 4dcea97fb..94d3293b5 100644 --- a/src/core/iterable-differ-helper.ts +++ b/src/core/iterable-differ-helper.ts @@ -26,7 +26,7 @@ export class IterableDifferHelper { if (value && Array.isArray(value)) { if (!this._propertyDiffers[prop]) { try { - this._propertyDiffers[prop] = this._differs.find(value).create(null, null); + this._propertyDiffers[prop] = this._differs.find(value).create(null); } catch (e) { } } } else { From e7a6a939043f4f9462b168dc4bfa7bb231a1761d Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Thu, 16 Mar 2017 20:38:42 +0300 Subject: [PATCH 07/14] Add link of issue in changelog --- CHANGELOG.md | 2 +- shippable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eb46d947..fd4ea8d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Features -- We support Angular 4.0.0-rc.3 +- We support Angular 4.0.0-rc.3 ([#386](https://github.com/DevExpress/devextreme-angular/issues/386)). ## 16.2.5 diff --git a/shippable.yml b/shippable.yml index e531f4f27..de7c36bf1 100644 --- a/shippable.yml +++ b/shippable.yml @@ -23,4 +23,4 @@ build: - shippable_retry npm install --unsafe-perm - gulp test - shippable_retry npm install @angular/core@~4.0.0-0 @angular/common@~4.0.0-0 @angular/forms@~4.0.0-0 @angular/compiler@~4.0.0-0 @angular/platform-browser@~4.0.0-0 @angular/platform-browser-dynamic@~4.0.0-0 --unsafe-perm - - gulp test.run \ No newline at end of file + - gulp test.run From 5ddc9d366effb1a26a833b31fd86f870855882c8 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Fri, 17 Mar 2017 14:14:16 +0300 Subject: [PATCH 08/14] Fix jquery version --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 86d8c14bb..c77b197e3 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "author": "Developer Express Inc.", "license": "MIT", "dependencies": { - "@types/jquery": "^2.0.0 || ^3.0.0", - "jquery": "^2.0.0 || ^3.0.0" + "@types/jquery": "^2.0.0 || ~3.1.1", + "jquery": "^2.0.0 || ~3.1.1" }, "peerDependencies": { "devextreme": "~16.2.4", @@ -27,7 +27,7 @@ }, "devDependencies": { "devextreme": "~16.2.4", - "jquery": "^2.0.0 || ^3.0.0", + "jquery": "^2.0.0 || ~3.1.1", "zone.js": "^0.7.2", "@angular/core": "^2.2.1", "@angular/common": "^2.2.1", From dd5e4a62d006864e2f73db30cfdce6eeb6cd2f25 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Fri, 17 Mar 2017 16:46:30 +0300 Subject: [PATCH 09/14] Refactoring --- CHANGELOG.md | 2 +- gulpfile.js | 21 +++++++++------------ shippable.yml | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4ea8d85..c5e69148b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Features -- We support Angular 4.0.0-rc.3 ([#386](https://github.com/DevExpress/devextreme-angular/issues/386)). +- Support for Angular 4 RC has been provided ([#386](https://github.com/DevExpress/devextreme-angular/issues/386)). ## 16.2.5 diff --git a/gulpfile.js b/gulpfile.js index 77e4da073..3315473ef 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -24,9 +24,7 @@ gulp.task('build', [ 'build.tools', 'build.components', 'build.examples' - ], function(done) { - runSequence('build.tests', done); - } + ] ); gulp.task('default', ['build']); @@ -234,10 +232,10 @@ gulp.task('watch.spec', function() { gulp.watch(buildConfig.components.tsTestSrc, ['build.tests']); }); -gulp.task('test.components', function(done) { +gulp.task('test.components', function() { new karmaServer({ configFile: __dirname + '/karma.conf.js' - }, done).start(); + }).start(); }); gulp.task('test.components.debug', function(done) { @@ -267,16 +265,15 @@ gulp.task('test.tools', function(done) { })); }); -gulp.task('test.run', function(done) { - runSequence( - ['test.tools', 'test.components'], - 'lint', - done); -}); +gulp.task('run.tests', [ + 'test.tools', + 'test.components', + 'lint'] +); gulp.task('test', function(done) { runSequence( - 'build', 'test.run', + 'build', 'build.tests', 'run.tests', done); }); diff --git a/shippable.yml b/shippable.yml index de7c36bf1..f8058c37c 100644 --- a/shippable.yml +++ b/shippable.yml @@ -23,4 +23,4 @@ build: - shippable_retry npm install --unsafe-perm - gulp test - shippable_retry npm install @angular/core@~4.0.0-0 @angular/common@~4.0.0-0 @angular/forms@~4.0.0-0 @angular/compiler@~4.0.0-0 @angular/platform-browser@~4.0.0-0 @angular/platform-browser-dynamic@~4.0.0-0 --unsafe-perm - - gulp test.run + - gulp run.tests From a9fff0fd7472293494ce3928969c8a8515523c71 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Fri, 17 Mar 2017 18:35:32 +0300 Subject: [PATCH 10/14] Add done --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3315473ef..365700cd4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -232,10 +232,10 @@ gulp.task('watch.spec', function() { gulp.watch(buildConfig.components.tsTestSrc, ['build.tests']); }); -gulp.task('test.components', function() { +gulp.task('test.components', function(done) { new karmaServer({ configFile: __dirname + '/karma.conf.js' - }).start(); + }, done).start(); }); gulp.task('test.components.debug', function(done) { From f9dc3e1e1eb841c945061f7e493c3b018bfb9b51 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Mon, 20 Mar 2017 10:54:59 +0300 Subject: [PATCH 11/14] Fix jquery version --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c77b197e3..2e5c99307 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "author": "Developer Express Inc.", "license": "MIT", "dependencies": { - "@types/jquery": "^2.0.0 || ~3.1.1", - "jquery": "^2.0.0 || ~3.1.1" + "@types/jquery": "^2.0.0 || ~3.1", + "jquery": "^2.0.0 || ~3.1" }, "peerDependencies": { "devextreme": "~16.2.4", @@ -27,7 +27,6 @@ }, "devDependencies": { "devextreme": "~16.2.4", - "jquery": "^2.0.0 || ~3.1.1", "zone.js": "^0.7.2", "@angular/core": "^2.2.1", "@angular/common": "^2.2.1", From bba2d58cfe792f391353a589e4bbe5368440293a Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Mon, 20 Mar 2017 13:30:42 +0300 Subject: [PATCH 12/14] Fix tests --- gulpfile.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 365700cd4..cc6987eb3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -265,11 +265,12 @@ gulp.task('test.tools', function(done) { })); }); -gulp.task('run.tests', [ - 'test.tools', - 'test.components', - 'lint'] -); +gulp.task('run.tests', function(done) { + runSequence( + ['test.tools', 'test.components'], + 'lint', + done); +}); gulp.task('test', function(done) { runSequence( From d7b0285b5a9792b9f308a90250989c88ddba542d Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Mon, 20 Mar 2017 14:48:29 +0300 Subject: [PATCH 13/14] Add range of versions for jquery --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2e5c99307..a761486c6 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "author": "Developer Express Inc.", "license": "MIT", "dependencies": { - "@types/jquery": "^2.0.0 || ~3.1", - "jquery": "^2.0.0 || ~3.1" + "@types/jquery": "2.0.0 - 3.1", + "jquery": "2.0.0 - 3.1" }, "peerDependencies": { "devextreme": "~16.2.4", @@ -27,6 +27,7 @@ }, "devDependencies": { "devextreme": "~16.2.4", + "jquery": "2.0.0 - 3.1", "zone.js": "^0.7.2", "@angular/core": "^2.2.1", "@angular/common": "^2.2.1", From 66b7e9a5531b051e6f51ad6e9567012ad86452da Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Mon, 20 Mar 2017 17:06:16 +0300 Subject: [PATCH 14/14] Remove jquery from devDependencies --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a761486c6..c038df9db 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ }, "devDependencies": { "devextreme": "~16.2.4", - "jquery": "2.0.0 - 3.1", "zone.js": "^0.7.2", "@angular/core": "^2.2.1", "@angular/common": "^2.2.1",