Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 1b654b4

Browse files
authored
chore: upgrade to Angular v6 and RxJS v6 (#87)
1 parent 8574425 commit 1b654b4

File tree

9 files changed

+1728
-331
lines changed

9 files changed

+1728
-331
lines changed

karma-test-shim.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ System.config({
5858
packages: {
5959
// Thirdparty barrels.
6060
'rxjs': {main: 'index'},
61+
'rxjs/operators': {main: 'index'},
6162

6263
// Set the default extension for the root package, because otherwise the demo-app can't
6364
// be built within the production mode. Due to missing file extensions.

npm-shrinkwrap.json

Lines changed: 1686 additions & 291 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,52 +27,52 @@
2727
"Jeff Whelpley <[email protected]>"
2828
],
2929
"devDependencies": {
30-
"@angular/animations": "^5.2.1",
31-
"@angular/common": "^5.2.1",
32-
"@angular/compiler": "^5.2.1",
33-
"@angular/compiler-cli": "^5.2.1",
34-
"@angular/core": "^5.2.1",
35-
"@angular/http": "^5.2.1",
36-
"@angular/platform-browser": "^5.2.1",
37-
"@angular/platform-browser-dynamic": "^5.2.1",
38-
"@angular/platform-server": "^5.2.1",
39-
"@types/express": "^4.11.0",
40-
"@types/jasmine": "^2.8.4",
30+
"@angular/animations": "^6.0.0",
31+
"@angular/common": "^6.0.0",
32+
"@angular/compiler": "^6.0.0",
33+
"@angular/compiler-cli": "^6.0.0",
34+
"@angular/core": "^6.0.0",
35+
"@angular/http": "^6.0.0",
36+
"@angular/platform-browser": "^6.0.0",
37+
"@angular/platform-browser-dynamic": "^6.0.0",
38+
"@angular/platform-server": "^6.0.0",
39+
"@types/express": "^4.11.1",
40+
"@types/jasmine": "^2.8.7",
4141
"@types/minimatch": "^3.0.3",
42-
"@types/node": "^8.5.9",
43-
"@types/uglify-js": "^2.6.30",
42+
"@types/node": "^8.10.14",
43+
"@types/uglify-js": "^2.6.31",
4444
"ajv": "^5.5.2",
4545
"camelcase": "^4.1.0",
4646
"concurrently": "^3.5.1",
47-
"express": "^4.16.2",
47+
"express": "^4.16.3",
4848
"glob": "^7.1.2",
4949
"http-server": "^0.10.0",
50-
"jasmine": "^2.9.0",
50+
"jasmine": "^2.99.0",
5151
"jasmine-spec-reporter": "^4.1.1",
5252
"karma": "^1.7.1",
5353
"karma-chrome-launcher": "^2.2.0",
54-
"karma-jasmine": "^1.1.1",
54+
"karma-jasmine": "^1.1.2",
5555
"karma-jasmine-html-reporter": "^0.2.2",
5656
"karma-sourcemap-loader": "^0.3.7",
5757
"minimatch": "^3.0.4",
58-
"protractor": "^5.2.2",
58+
"protractor": "^5.3.2",
5959
"reflect-metadata": "^0.1.12",
6060
"rimraf": "^2.6.2",
6161
"rollup": "~0.41.6",
6262
"rollup-plugin-alias": "^1.4.0",
63-
"rollup-plugin-commonjs": "^8.2.6",
64-
"rollup-plugin-node-resolve": "^3.0.2",
63+
"rollup-plugin-commonjs": "^8.4.1",
64+
"rollup-plugin-node-resolve": "^3.3.0",
6565
"rollup-plugin-sourcemaps": "^0.4.2",
6666
"rollup-plugin-uglify": "^2.0.1",
67-
"rxjs": "^5.5.6",
67+
"rxjs": "^6.1.0",
6868
"systemjs": "0.19.43",
69-
"ts-loader": "^3.2.0",
69+
"ts-loader": "^3.5.0",
7070
"ts-node": "^3.3.0",
71-
"tslint": "^5.9.1",
72-
"typescript": "^2.6.2",
73-
"uglify-js": "^3.3.7",
71+
"tslint": "^5.10.0",
72+
"typescript": "~2.7.2",
73+
"uglify-js": "^3.3.25",
7474
"webdriver-manager": "^12.0.6",
75-
"zone.js": "^0.8.20"
75+
"zone.js": "^0.8.26"
7676
},
7777
"repository": {
7878
"type": "git",

src/lib/api/event.recorder.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
EventSelector,
1212
PrebootAppData,
1313
PrebootData,
14+
PrebootSelection,
1415
ServerClientRoot,
1516
} from '../common/preboot.interfaces';
1617

@@ -59,7 +60,7 @@ describe('UNIT TEST event.recorder', function() {
5960
describe('getSelection()', function () {
6061
it('should return default if no value', function () {
6162
const node = {};
62-
const expected = {
63+
const expected: PrebootSelection = {
6364
start: 0,
6465
end: 0,
6566
direction: 'forward'
@@ -71,7 +72,7 @@ describe('UNIT TEST event.recorder', function() {
7172

7273
it('should return selection for older browsers', function () {
7374
const node = { value: 'foo' };
74-
const expected = {
75+
const expected: PrebootSelection = {
7576
start: 3,
7677
end: 3,
7778
direction: 'forward'
@@ -86,12 +87,12 @@ describe('UNIT TEST event.recorder', function() {
8687
value: 'foo',
8788
selectionStart: 1,
8889
selectionEnd: 2,
89-
selectionDirection: 'reverse'
90+
selectionDirection: 'backward'
9091
};
91-
const expected = {
92+
const expected: PrebootSelection = {
9293
start: 1,
9394
end: 2,
94-
direction: 'reverse'
95+
direction: 'backward'
9596
};
9697

9798
const actual = getSelection(node as HTMLInputElement);

src/lib/api/event.recorder.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
DomEvent,
1414
PrebootWindow,
1515
ServerClientRoot,
16-
PrebootSelection,
16+
PrebootSelection, PrebootSelectionDirection,
1717
} from '../common/preboot.interfaces';
1818
import {getNodeKeyForPreboot} from '../common/get-node-key';
1919

@@ -313,7 +313,7 @@ export function getSelection(node: HTMLInputElement): PrebootSelection {
313313
node = node || {} as HTMLInputElement;
314314

315315
const nodeValue = node.value || '';
316-
const selection = {
316+
const selection: PrebootSelection = {
317317
start: nodeValue.length,
318318
end: nodeValue.length,
319319
direction: 'forward'
@@ -324,7 +324,8 @@ export function getSelection(node: HTMLInputElement): PrebootSelection {
324324
if (node.selectionStart || node.selectionStart === 0) {
325325
selection.start = node.selectionStart;
326326
selection.end = node.selectionEnd ? node.selectionEnd : 0;
327-
selection.direction = node.selectionDirection ? node.selectionDirection : '';
327+
selection.direction = node.selectionDirection ?
328+
node.selectionDirection as PrebootSelectionDirection : 'none';
328329
}
329330
} catch (ex) {}
330331

src/lib/common/preboot.interfaces.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ export interface PrebootEventListener {
6363
handler: EventListener;
6464
}
6565

66+
export type PrebootSelectionDirection = 'forward' | 'backward' | 'none';
67+
6668
export interface PrebootSelection {
6769
start: number;
6870
end: number;
69-
direction: string;
71+
direction: PrebootSelectionDirection;
7072
}
7173

7274
// object that contains all data about the currently active node in the DOM (i.e. that has focus)

src/lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"universal"
2222
],
2323
"peerDependencies": {
24-
"@angular/common": "^5.0.0",
25-
"@angular/core": "^5.0.0"
24+
"@angular/common": "^6.0.0",
25+
"@angular/core": "^6.0.0"
2626
},
2727
"repository": {
2828
"type": "git",

src/lib/provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import {
1414
PLATFORM_ID
1515
} from '@angular/core';
1616
import {DOCUMENT, isPlatformBrowser, isPlatformServer} from '@angular/common';
17-
import {take} from 'rxjs/operators/take';
18-
import {filter} from 'rxjs/operators/filter';
17+
import {filter, take} from 'rxjs/operators';
1918

2019
import {EventReplayer} from './api/event.replayer';
2120
import {PREBOOT_NONCE} from './common/tokens';

tslint.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@
7878
["xdescribe"],
7979
{"name": "Object.assign", "message": "Use the spread operator instead."}
8080
],
81-
// Disallows importing the whole RxJS library. Submodules can be still imported.
82-
"import-blacklist": [true, "rxjs", "rxjs/operators"],
8381
// Avoids inconsistent linebreak styles in source files. Forces developers to use LF linebreaks.
8482
"linebreak-style": [true, "LF"],
8583
// Namespaces are no allowed, because of Closure compiler.

0 commit comments

Comments
 (0)