Skip to content

Commit 0af640e

Browse files
committed
wip: angular 5 support
1 parent 0ea4370 commit 0af640e

File tree

24 files changed

+255
-318
lines changed

24 files changed

+255
-318
lines changed

package-lock.json

Lines changed: 145 additions & 229 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/platform-browser": "~4.4.4",
28+
"@angular/animations": "~5.0.0-rc.4",
29+
"@angular/common": "~5.0.0-rc.4",
30+
"@angular/compiler": "~5.0.0-rc.4",
31+
"@angular/core": "~5.0.0-rc.4",
32+
"@angular/forms": "~5.0.0-rc.4",
33+
"@angular/platform-browser": "~5.0.0-rc.4",
3434
"core-js": "^2.4.1",
35-
"rxjs": "^5.0.1",
35+
"rxjs": "5.x",
3636
"systemjs": "0.19.43",
37-
"tsickle": "^0.23.5",
37+
"tsickle": "^0.24.x",
3838
"tslib": "^1.7.1",
3939
"zone.js": "^0.8.12"
4040
},
4141
"devDependencies": {
42-
"@angular/compiler-cli": "~4.4.4",
43-
"@angular/platform-browser-dynamic": "~4.4.4",
44-
"@angular/platform-server": "~4.4.4",
45-
"@angular/router": "~4.4.4",
46-
"@angular/tsc-wrapped": "~4.4.4",
47-
"@angular/http": "~4.4.4",
42+
"@angular/compiler-cli": "~5.0.0-rc.4",
43+
"@angular/http": "~5.0.0-rc.4",
44+
"@angular/platform-browser-dynamic": "~5.0.0-rc.4",
45+
"@angular/platform-server": "~5.0.0-rc.4",
46+
"@angular/router": "~5.0.0-rc.4",
4847
"@google-cloud/storage": "^1.1.1",
4948
"@types/chalk": "^0.4.31",
5049
"@types/fs-extra": "^3.0.1",
@@ -57,6 +56,7 @@
5756
"@types/minimist": "^1.2.0",
5857
"@types/node": "^7.0.21",
5958
"@types/run-sequence": "^0.0.29",
59+
"ajv": "^5.2.3",
6060
"autoprefixer": "^6.7.6",
6161
"axe-core": "^2.3.1",
6262
"axe-webdriverjs": "^1.1.1",
@@ -68,7 +68,7 @@
6868
"firebase-tools": "^3.11.0",
6969
"fs-extra": "^3.0.1",
7070
"glob": "^7.1.2",
71-
"google-closure-compiler": "20170409.0.0",
71+
"google-closure-compiler": "20170806.0.0",
7272
"gulp": "^3.9.1",
7373
"gulp-clean": "^0.3.2",
7474
"gulp-clean-css": "^3.3.1",

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,18 @@ 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/common/@angular/common/http.js
69-
node_modules/@angular/compiler/@angular/compiler.js
70-
node_modules/@angular/forms/@angular/forms.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/common/esm5/http.js
69+
node_modules/@angular/compiler/esm5/index.js
70+
node_modules/@angular/forms/esm5/index.js
71+
node_modules/@angular/http/esm5/index.js
72+
node_modules/@angular/router/esm5/index.js
73+
node_modules/@angular/platform-browser/esm5/index.js
74+
node_modules/@angular/platform-browser/esm5/animations/index.js
75+
node_modules/@angular/platform-browser-dynamic/esm5/index.js
76+
node_modules/@angular/animations/esm5/index.js
77+
node_modules/@angular/animations/esm5/browser/index.js
7778

7879
# Include other dependencies like Zone.js, Moment.js, and RxJS
7980
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/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/core/option/option.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ describe('MatOption component', () => {
6161
@Component({
6262
template: `<mat-option [disabled]="disabled"></mat-option>`
6363
})
64-
export class OptionWithDisable {
64+
class OptionWithDisable {
6565
disabled: boolean;
6666
}

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/progress-spinner/progress-spinner.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
9494
/** Tracks diameters of existing instances to de-dupe generated styles (default d = 100) */
9595
private static diameters = new Set<number>([100]);
9696

97-
/** Used for storing all of the generated keyframe animations. */
98-
private static styleTag: HTMLStyleElement;
97+
/**
98+
* Used for storing all of the generated keyframe animations.
99+
* @dynamic
100+
*/
101+
private static styleTag: HTMLStyleElement|null = null;
99102

100103
/** The diameter of the progress spinner (will set width and height of svg). */
101104
@Input()
@@ -199,7 +202,7 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
199202
MatProgressSpinner.styleTag = styleTag;
200203
}
201204

202-
if (styleTag.sheet) {
205+
if (styleTag && styleTag.sheet) {
203206
(styleTag.sheet as CSSStyleSheet).insertRule(this._getAnimationText());
204207
}
205208

src/lib/select/select.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3487,7 +3487,7 @@ class SelectWithErrorSibling {
34873487
selector: 'throws-error-on-init',
34883488
template: ''
34893489
})
3490-
export class ThrowsErrorOnInit implements OnInit {
3490+
class ThrowsErrorOnInit implements OnInit {
34913491
ngOnInit() {
34923492
throw Error('Oh no!');
34933493
}

src/lib/tsconfig-build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"moduleResolution": "node",
1313
"outDir": "../../dist/packages/material",
1414
"rootDir": ".",
15+
"rootDirs": [
16+
".",
17+
"../../dist/packages/material"
18+
],
1519
"sourceMap": true,
1620
"inlineSources": true,
1721
"target": "es2015",

src/lib/tsconfig-es5.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"moduleResolution": "node",
1414
"outDir": "../../dist/packages/material/esm5",
1515
"rootDir": ".",
16+
"rootDirs": [
17+
".",
18+
"../../dist/packages/material"
19+
],
1620
"sourceMap": true,
1721
"inlineSources": true,
1822
"target": "es5",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"target": "es5",
1010
"types": ["jasmine"]
1111
},
12+
"angularCompilerOptions": {
13+
"strictMetadataEmit": true,
14+
"skipTemplateCodegen": true
15+
},
1216
"include": [
1317
"**/*.spec.ts",
1418
"index.ts"

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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^4.4.4",
13+
"@angular/animations": "~5.0.0-rc.4",
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",
15+
"@angular/common": "~5.0.0-rc.4",
16+
"@angular/compiler": "~5.0.0-rc.4",
17+
"@angular/core": "~5.0.0-rc.4",
18+
"@angular/forms": "~5.0.0-rc.4",
1919
"@angular/material": "github:angular/material2-builds",
20-
"@angular/platform-browser": "^4.4.4",
21-
"@angular/platform-browser-dynamic": "^4.4.4",
22-
"@angular/router": "^4.4.4",
20+
"@angular/platform-browser": "~5.0.0-rc.4",
21+
"@angular/platform-browser-dynamic": "~5.0.0-rc.4",
22+
"@angular/router": "~5.0.0-rc.4",
2323
"@swimlane/ngx-charts": "^6.0.0",
2424
"angularfire2": "^5.0.0-rc.2",
2525
"core-js": "^2.4.1",
@@ -30,8 +30,8 @@
3030
},
3131
"devDependencies": {
3232
"@angular/cli": "^1.2.0",
33-
"@angular/compiler-cli": "^4.4.4",
34-
"@angular/language-service": "^4.4.4",
33+
"@angular/compiler-cli": "~5.0.0-rc.4",
34+
"@angular/language-service": "~5.0.0-rc.4",
3535
"@types/jasmine": "2.5.45",
3636
"@types/node": "~6.0.60",
3737
"ts-node": "~3.0.4",

0 commit comments

Comments
 (0)