Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Angular version to 5 #722

Merged
merged 6 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Breaking changes

- Angular below version 5 is not supported anymore.

## 18.1.1-beta.3 (2018-03-21)

### Bug Fixes
Expand Down
22 changes: 12 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ var gulp = require('gulp');
var runSequence = require("run-sequence");
var path = require('path');
var typescript = require('gulp-typescript');
var tsc = require('typescript');
var tslint = require('gulp-tslint');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var replace = require('gulp-replace');
var shell = require('gulp-shell');
var sourcemaps = require('gulp-sourcemaps');
var jasmine = require('gulp-jasmine');
var jasmineReporters = require('jasmine-reporters');
var del = require('del');
var merge = require('merge-stream');
var mergeJson = require('gulp-merge-json');
var karmaServer = require('karma').Server;
var karmaConfig = require('karma').config;
var buildConfig = require('./build.config');
var header = require('gulp-header');
var fs = require('fs');
var version = require('@angular/core').VERSION;

//------------Main------------

Expand Down Expand Up @@ -139,6 +135,15 @@ gulp.task('build.copy-sources', ['clean.dist'], function() {

});

// Note: workaround for https://github.com/angular/angular-cli/issues/4874
gulp.task('build.remove-unusable-variable', function() {
var config = buildConfig.components;

return gulp.src(path.join(config.outputPath, '**/*.js'))
.pipe(replace(/var.+devextreme\/bundles\/dx\.all.+/g, ''))
.pipe(gulp.dest(config.outputPath));
});

gulp.task('build.checkMetadata', function(done) {
if(fs.existsSync(path.resolve(buildConfig.components.outputPath, 'index.metadata.json'))) {
done();
Expand All @@ -152,6 +157,7 @@ gulp.task('build.components', ['generate.facades'], function(done) {
'build.copy-sources',
'build.license-headers',
'build.ngc',
'build.remove-unusable-variable',
'build.checkMetadata',
done
);
Expand Down Expand Up @@ -255,11 +261,7 @@ gulp.task('test.components.client', ['build.tests'], function(done) {
});

gulp.task('test.components.server', ['build.tests'], function(done) {
if (version.major >= '5') {
new karmaServer(getKarmaConfig('./karma.server.test.shim.js'), done).start();
} else {
done();
}
new karmaServer(getKarmaConfig('./karma.server.test.shim.js'), done).start();
});

gulp.task('test.components.debug', function(done) {
Expand Down
30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
"license": "MIT",
"peerDependencies": {
"devextreme": "~18.1.1-pre-18079",
"@angular/core": ">4.3.0",
"@angular/common": ">4.3.0",
"@angular/forms": ">4.3.0"
"@angular/core": ">5.0.0",
"@angular/common": ">5.0.0",
"@angular/forms": ">5.0.0"
},
"devDependencies": {
"devextreme": "~18.1.1-pre-18079",
"zone.js": "^0.8.17",
"@angular/animations": "~4.4.5",
"@angular/core": "~4.4.5",
"@angular/common": "~4.4.5",
"@angular/compiler": "~4.4.5",
"@angular/forms": "~4.4.5",
"@angular/http": "~4.4.5",
"@angular/platform-browser": "~4.4.5",
"@angular/platform-server": "~4.4.5",
"@angular/platform-browser-dynamic": "~4.4.5",
"@angular/compiler-cli": "~4.4.5",
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@types/dot": "^1.0.29",
"@types/jasmine": "2.5.38",
"@types/mkdirp": "^0.3.29",
Expand All @@ -49,12 +49,11 @@
"gulp-header": "^1.8.8",
"gulp-jasmine": "^2.3.0",
"gulp-merge-json": "^0.6.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-tslint": "^7.0.1",
"gulp-typescript": "^3.0.1",
"gulp-uglify": "^1.5.3",
"http-server": "0.8.5",
"inflector-js": "^1.0.1",
"jszip": "^3.1.2",
Expand All @@ -68,7 +67,6 @@
"karma-phantomjs-launcher": "^1.0.2",
"karma-webpack": "^2.0.9",
"lite-server": "^2.2.0",
"merge-stream": "^1.0.0",
"mkdirp": "^0.5.1",
"remap-istanbul": "0.5.1",
"run-sequence": "^1.2.2",
Expand Down
3 changes: 0 additions & 3 deletions shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ build:
ci:
- shippable_retry npm install --unsafe-perm
- gulp test
- shippable_retry npm install @angular/animations@^5.0.0 @angular/core@^5.0.0 @angular/common@^5.0.0 @angular/compiler@^5.0.0 @angular/forms@^5.0.0 @angular/http@^5.0.0 @angular/platform-browser@^5.0.0 @angular/platform-server@^5.0.0 @angular/platform-browser-dynamic@^5.0.0 @angular/compiler-cli@^5.0.0 --unsafe-perm
- gulp build.tests
- gulp run.tests
- shippable_retry npm install rxjs@^6.0.0-0 @angular/animations@^6.0.0-0 @angular/core@^6.0.0-0 @angular/common@^6.0.0-0 @angular/compiler@^6.0.0-0 @angular/forms@^6.0.0-0 @angular/http@^6.0.0-0 @angular/platform-browser@^6.0.0-0 @angular/platform-server@^6.0.0-0 @angular/platform-browser-dynamic@^6.0.0-0 @angular/compiler-cli@^6.0.0-0 --unsafe-perm
- gulp build.tests
- gulp run.tests
8 changes: 1 addition & 7 deletions src/core/dom-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { Inject, Injectable, VERSION } from '@angular/core';
import { Inject, Injectable } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import * as domAdapter from 'devextreme/core/dom_adapter';
import * as readyCallbacks from 'devextreme/core/utils/ready_callbacks';

const NG_VERSION_SUPPORTING_SSR = '5';

@Injectable()
export class NgDomAdapter {
constructor(@Inject(DOCUMENT) document: any) {
if (VERSION.major < NG_VERSION_SUPPORTING_SSR) {
return;
}

domAdapter.inject({
_document: document,

Expand Down