Skip to content

Commit d4b8bff

Browse files
committed
wip: angular 5 support
This is the PR to introduce Angular 5 support. I'll keep it updated and will fix any new issues as beta and RC versions are released. It should be merged once Angular 5 final is released.
1 parent 26bbeb2 commit d4b8bff

28 files changed

+224
-276
lines changed

package-lock.json

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

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,25 @@
2525
"node": ">= 5.4.1"
2626
},
2727
"dependencies": {
28-
"@angular/animations": "~4.4.4",
29-
"@angular/common": "~4.4.4",
30-
"@angular/compiler": "~4.4.4",
31-
"@angular/core": "~4.4.4",
32-
"@angular/forms": "~4.4.4",
33-
"@angular/http": "~4.4.4",
34-
"@angular/platform-browser": "~4.4.4",
28+
"@angular/animations": "~5.0.0-rc.2",
29+
"@angular/common": "~5.0.0-rc.2",
30+
"@angular/compiler": "~5.0.0-rc.2",
31+
"@angular/core": "~5.0.0-rc.2",
32+
"@angular/forms": "~5.0.0-rc.2",
33+
"@angular/http": "~5.0.0-rc.2",
34+
"@angular/platform-browser": "~5.0.0-rc.2",
3535
"core-js": "^2.4.1",
36-
"rxjs": "^5.0.1",
36+
"rxjs": "5.x",
3737
"systemjs": "0.19.43",
38-
"tsickle": "^0.23.5",
38+
"tsickle": "^0.24.x",
3939
"tslib": "^1.7.1",
4040
"zone.js": "^0.8.12"
4141
},
4242
"devDependencies": {
43-
"@angular/compiler-cli": "~4.4.4",
44-
"@angular/platform-browser-dynamic": "~4.4.4",
45-
"@angular/platform-server": "~4.4.4",
46-
"@angular/router": "~4.4.4",
47-
"@angular/tsc-wrapped": "~4.4.4",
43+
"@angular/compiler-cli": "~5.0.0-rc.2",
44+
"@angular/platform-browser-dynamic": "~5.0.0-rc.2",
45+
"@angular/platform-server": "~5.0.0-rc.2",
46+
"@angular/router": "~5.0.0-rc.2",
4847
"@google-cloud/storage": "^1.1.1",
4948
"@types/chalk": "^0.4.31",
5049
"@types/fs-extra": "^3.0.1",
@@ -56,6 +55,7 @@
5655
"@types/minimist": "^1.2.0",
5756
"@types/node": "^7.0.21",
5857
"@types/run-sequence": "^0.0.29",
58+
"ajv": "^5.2.3",
5959
"autoprefixer": "^6.7.6",
6060
"axe-core": "^2.3.1",
6161
"axe-webdriverjs": "^1.1.1",
@@ -67,7 +67,7 @@
6767
"firebase-tools": "^3.11.0",
6868
"fs-extra": "^3.0.1",
6969
"glob": "^7.1.2",
70-
"google-closure-compiler": "20170409.0.0",
70+
"google-closure-compiler": "20170806.0.0",
7171
"gulp": "^3.9.1",
7272
"gulp-clean": "^0.3.2",
7373
"gulp-clean-css": "^3.3.1",

scripts/closure-compiler/build-devapp-bundle.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ OPTS=(
6363
dist/releases/material-moment-adapter/esm2015/material-moment-adapter.js
6464

6565
# Include all Angular FESM bundles.
66-
node_modules/@angular/core/@angular/core.js
67-
node_modules/@angular/common/@angular/common.js
68-
node_modules/@angular/compiler/@angular/compiler.js
69-
node_modules/@angular/forms/@angular/forms.js
70-
node_modules/@angular/http/@angular/http.js
71-
node_modules/@angular/router/@angular/router.js
72-
node_modules/@angular/platform-browser/@angular/platform-browser.js
73-
node_modules/@angular/platform-browser/@angular/platform-browser/animations.js
74-
node_modules/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.js
75-
node_modules/@angular/animations/@angular/animations.js
76-
node_modules/@angular/animations/@angular/animations/browser.js
66+
node_modules/@angular/core/esm5/index.js
67+
node_modules/@angular/common/esm5/index.js
68+
node_modules/@angular/compiler/esm5/index.js
69+
node_modules/@angular/forms/esm5/index.js
70+
node_modules/@angular/http/esm5/index.js
71+
node_modules/@angular/router/esm5/index.js
72+
node_modules/@angular/platform-browser/esm5/index.js
73+
node_modules/@angular/platform-browser/esm5/animations/index.js
74+
node_modules/@angular/platform-browser-dynamic/esm5/index.js
75+
node_modules/@angular/animations/esm5/index.js
76+
node_modules/@angular/animations/esm5/browser/index.js
7777

7878
# Include other dependencies like Zone.js, Moment.js, and RxJS
7979
node_modules/zone.js/dist/zone.js

src/cdk/scrolling/scroll-dispatcher.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,15 @@ describe('Scroll Dispatcher', () => {
6767
}));
6868

6969
it('should not execute the global events in the Angular zone', () => {
70-
const spy = jasmine.createSpy('zone unstable callback');
71-
const subscription = fixture.ngZone!.onUnstable.subscribe(spy);
72-
7370
scroll.scrolled(0).subscribe(() => {});
7471
dispatchFakeEvent(document, 'scroll', false);
7572

76-
expect(spy).not.toHaveBeenCalled();
77-
subscription.unsubscribe();
73+
expect(fixture.ngZone!.isStable).toBe(true);
7874
});
7975

8076
it('should not execute the scrollable events in the Angular zone', () => {
81-
const spy = jasmine.createSpy('zone unstable callback');
82-
const subscription = fixture.ngZone!.onUnstable.subscribe(spy);
83-
84-
dispatchFakeEvent(fixture.componentInstance.scrollingElement.nativeElement, 'scroll', false);
85-
86-
expect(spy).not.toHaveBeenCalled();
87-
subscription.unsubscribe();
77+
dispatchFakeEvent(fixture.componentInstance.scrollingElement.nativeElement, 'scroll');
78+
expect(fixture.ngZone!.isStable).toBe(true);
8879
});
8980

9081
it('should be able to unsubscribe from the global scrollable', () => {

src/cdk/table/row.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class CdkCellOutlet {
141141
* a handle to provide that component's cells and context. After init, the CdkCellOutlet will
142142
* construct the cells with the provided context.
143143
*/
144-
static mostRecentCellOutlet: CdkCellOutlet;
144+
static mostRecentCellOutlet: CdkCellOutlet | null = null;
145145

146146
constructor(public _viewContainer: ViewContainerRef) {
147147
CdkCellOutlet.mostRecentCellOutlet = this;

src/cdk/table/table.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ export class CdkTable<T> implements CollectionViewer {
286286
.createEmbeddedView(this._headerDef.template, {cells});
287287

288288
cells.forEach(cell => {
289-
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cell.template, {});
289+
if (CdkCellOutlet.mostRecentCellOutlet) {
290+
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cell.template, {});
291+
}
290292
});
291293

292294
this._changeDetectorRef.markForCheck();
@@ -346,7 +348,10 @@ export class CdkTable<T> implements CollectionViewer {
346348
const cells = rowData ? this._getCellTemplatesForRow(row) : [];
347349

348350
cells.forEach(cell => {
349-
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cell.template, context);
351+
if (CdkCellOutlet.mostRecentCellOutlet) {
352+
CdkCellOutlet.mostRecentCellOutlet._viewContainer
353+
.createEmbeddedView(cell.template, context);
354+
}
350355
});
351356

352357
this._changeDetectorRef.markForCheck();

src/cdk/tsconfig-build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"skipLibCheck": true,
2121
"types": [],
2222
"paths": {
23-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
23+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2424
}
2525
},
2626
"files": [

src/cdk/tsconfig-es5.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"skipLibCheck": true,
2222
"types": [],
2323
"paths": {
24-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
24+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2525
}
2626
},
2727
"files": [

src/e2e-app/tsconfig-build.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"moduleResolution": "node",
1616
"noEmitOnError": true,
1717
"noImplicitAny": true,
18-
"rootDir": ".",
19-
"outDir": ".",
18+
"outDir": "../../../",
2019
"sourceMap": true,
2120
"target": "es5",
2221
"typeRoots": [

src/lib/chips/chip.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
302302
selector: '[matChipRemove]',
303303
host: {
304304
'class': 'mat-chip-remove',
305-
'(click)': '_handleClick($event)',
306-
},
305+
'(click)': '_handleClick()',
306+
}
307307
})
308308
export class MatChipRemove {
309309
constructor(protected _parentChip: MatChip) {

src/lib/core/datetime/date-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export abstract class DateAdapter<D> {
217217
* Checks if two dates are equal.
218218
* @param first The first date to check.
219219
* @param second The second date to check.
220-
* @returns {boolean} Whether the two dates are equal.
220+
* @returns Whether the two dates are equal.
221221
* Null dates are considered equal to other null dates.
222222
*/
223223
sameDate(first: D | null, second: D | null): boolean {

src/lib/datepicker/datepicker-toggle.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<button mat-icon-button type="button" [attr.aria-label]="_intl.openCalendarLabel"
22
[disabled]="disabled" (click)="_open($event)">
33
<mat-icon>
4-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="100%" height="100%"
5-
fill="currentColor" style="vertical-align: top" focusable="false">
4+
<svg viewBox="0 0 24 24" width="100%" height="100%" fill="currentColor"
5+
style="vertical-align: top" focusable="false">
66
<path d="M0 0h24v24H0z" fill="none"/>
77
<path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/>
88
</svg>

src/lib/expansion/expansion-panel-header.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from '@angular/core';
2525
import {merge} from 'rxjs/observable/merge';
2626
import {Subscription} from 'rxjs/Subscription';
27-
import {EXPANSION_PANEL_ANIMATION_TIMING, MatExpansionPanel} from './expansion-panel';
27+
import {MatExpansionPanel} from './expansion-panel';
2828

2929

3030
/**
@@ -64,7 +64,7 @@ import {EXPANSION_PANEL_ANIMATION_TIMING, MatExpansionPanel} from './expansion-p
6464
trigger('indicatorRotate', [
6565
state('collapsed', style({transform: 'rotate(0deg)'})),
6666
state('expanded', style({transform: 'rotate(180deg)'})),
67-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
67+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
6868
]),
6969
trigger('expansionHeight', [
7070
state('collapsed', style({
@@ -77,7 +77,7 @@ import {EXPANSION_PANEL_ANIMATION_TIMING, MatExpansionPanel} from './expansion-p
7777
}), {
7878
params: {expandedHeight: '64px'}
7979
}),
80-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
80+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
8181
]),
8282
],
8383
})

src/lib/expansion/expansion-panel.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ export const _MatExpansionPanelMixinBase = mixinDisabled(MatExpansionPanelBase);
5151
/** MatExpansionPanel's states. */
5252
export type MatExpansionPanelState = 'expanded' | 'collapsed';
5353

54-
/** Time and timing curve for expansion panel animations. */
55-
export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
56-
5754
/**
5855
* <mat-expansion-panel> component.
5956
*
@@ -84,7 +81,7 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
8481
trigger('bodyExpansion', [
8582
state('collapsed', style({height: '0px', visibility: 'hidden'})),
8683
state('expanded', style({height: '*', visibility: 'visible'})),
87-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
84+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
8885
]),
8986
],
9087
})

src/lib/grid-list/public-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
export * from './grid-list-module';
1010
export * from './grid-list';
11-
export {MatGridTile} from './grid-tile';
11+
export * from './grid-tile';
1212

src/lib/tsconfig-build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"types": [],
2121
"baseUrl": ".",
2222
"paths": {
23-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"],
24-
"@angular/material/*": ["../../dist/packages/material/*/public-api"]
23+
"@angular/cdk/*": ["../../dist/packages/cdk/*"],
24+
"@angular/material/*": ["../../dist/packages/material/*"]
2525
}
2626
},
2727
"files": [

src/lib/tsconfig-es5.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"types": [],
2222
"baseUrl": ".",
2323
"paths": {
24-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"],
25-
"@angular/material/*": ["../../dist/packages/material/*/public-api"]
24+
"@angular/cdk/*": ["../../dist/packages/cdk/*"],
25+
"@angular/material/*": ["../../dist/packages/material/*"]
2626
}
2727
},
2828
"files": [

src/lib/tsconfig-tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"types": ["jasmine"],
1111
"paths": {
1212
"@angular/material/*": ["./*"],
13-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
13+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
1414
}
1515
},
1616
"include": [

src/material-examples/tsconfig-build.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"types": [],
2121
"baseUrl": ".",
2222
"paths": {
23-
"@angular/material/*": ["../../dist/packages/material/*/public-api"],
24-
"@angular/material": ["../../dist/packages/material/public-api"],
25-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
23+
"@angular/material/*": ["../../dist/packages/material/*"],
24+
"@angular/material": ["../../dist/packages/material"],
25+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2626
}
2727
},
2828
"files": [

src/material-examples/tsconfig-es5.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"types": [],
2121
"baseUrl": ".",
2222
"paths": {
23-
"@angular/material/*": ["../../dist/packages/material/*/public-api"],
23+
"@angular/material/*": ["../../dist/packages/material/*"],
2424
"@angular/material": ["../../dist/packages/material/public-api"],
25-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
25+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2626
}
2727
},
2828
"files": [

src/material-moment-adapter/tsconfig-build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"skipLibCheck": true,
2323
"types": [],
2424
"paths": {
25-
"@angular/material/*": ["../../dist/packages/material/*/public-api"],
25+
"@angular/material/*": ["../../dist/packages/material/*"],
2626
"@angular/material": ["../../dist/packages/material/public-api"],
27-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
27+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2828
}
2929
},
3030
"files": [

src/material-moment-adapter/tsconfig-es5.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"skipLibCheck": true,
2424
"types": [],
2525
"paths": {
26-
"@angular/material/*": ["../../dist/packages/material/*/public-api"],
26+
"@angular/material/*": ["../../dist/packages/material/*"],
2727
"@angular/material": ["../../dist/packages/material/public-api"],
28-
"@angular/cdk/*": ["../../dist/packages/cdk/*/public-api"]
28+
"@angular/cdk/*": ["../../dist/packages/cdk/*"]
2929
}
3030
},
3131
"files": [

src/universal-app/prerender.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {renderModuleFactory} from '@angular/platform-server';
66
import {join} from 'path';
77
import {readFileSync} from 'fs-extra';
88
import {log} from 'gulp-util';
9-
import {KitchenSinkServerModuleNgFactory} from './kitchen-sink/kitchen-sink.ngfactory';
9+
import {
10+
KitchenSinkServerModuleNgFactory
11+
} from './dist/packages/universal-app/kitchen-sink/kitchen-sink.ngfactory';
1012

1113
enableProdMode();
1214

src/universal-app/tsconfig-build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"declaration": true,
66
"stripInternal": false,
77
"experimentalDecorators": true,
8-
"noUnusedParameters": true,
8+
// TODO(crisbeto): disabled due to https://github.com/angular/angular/issues/17131
9+
"noUnusedParameters": false,
910
"strictNullChecks": true,
1011
"module": "commonjs",
1112
"moduleResolution": "node",

tools/dashboard/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^4.4.4",
13+
"@angular/animations": "~5.0.0-rc.2",
1414
"@angular/cdk": "github:angular/cdk-builds",
15-
"@angular/common": "^4.4.4",
16-
"@angular/compiler": "^4.4.4",
17-
"@angular/core": "^4.4.4",
18-
"@angular/forms": "^4.4.4",
19-
"@angular/http": "^4.4.4",
15+
"@angular/common": "~5.0.0-rc.2",
16+
"@angular/compiler": "~5.0.0-rc.2",
17+
"@angular/core": "~5.0.0-rc.2",
18+
"@angular/forms": "~5.0.0-rc.2",
19+
"@angular/http": "~5.0.0-rc.2",
2020
"@angular/material": "github:angular/material2-builds",
21-
"@angular/platform-browser": "^4.4.4",
22-
"@angular/platform-browser-dynamic": "^4.4.4",
23-
"@angular/router": "^4.4.4",
21+
"@angular/platform-browser": "~5.0.0-rc.2",
22+
"@angular/platform-browser-dynamic": "~5.0.0-rc.2",
23+
"@angular/router": "~5.0.0-rc.2",
2424
"@swimlane/ngx-charts": "^6.0.0",
2525
"angularfire2": "^5.0.0-rc.2",
2626
"core-js": "^2.4.1",
@@ -31,8 +31,8 @@
3131
},
3232
"devDependencies": {
3333
"@angular/cli": "^1.2.0",
34-
"@angular/compiler-cli": "^4.4.4",
35-
"@angular/language-service": "^4.4.4",
34+
"@angular/compiler-cli": "~5.0.0-rc.2",
35+
"@angular/language-service": "~5.0.0-rc.2",
3636
"@types/jasmine": "2.5.45",
3737
"@types/node": "~6.0.60",
3838
"ts-node": "~3.0.4",

0 commit comments

Comments
 (0)