Skip to content

Commit 87da2bc

Browse files
committed
fix: various AoT and prerender issues
1 parent 3cb0293 commit 87da2bc

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

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 md-icon-button type="button" [attr.aria-label]="_intl.openCalendarLabel"
22
[disabled]="disabled" (click)="_open($event)">
33
<md-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
@@ -26,7 +26,7 @@ import {
2626
animate,
2727
} from '@angular/animations';
2828
import {SPACE, ENTER} from '@angular/material/core';
29-
import {MdExpansionPanel, EXPANSION_PANEL_ANIMATION_TIMING} from './expansion-panel';
29+
import {MdExpansionPanel} from './expansion-panel';
3030
import {filter} from '@angular/material/core';
3131
import {FocusOriginMonitor} from '@angular/material/core';
3232
import {merge} from 'rxjs/observable/merge';
@@ -69,7 +69,7 @@ import {Subscription} from 'rxjs/Subscription';
6969
trigger('indicatorRotate', [
7070
state('collapsed', style({transform: 'rotate(0deg)'})),
7171
state('expanded', style({transform: 'rotate(180deg)'})),
72-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
72+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
7373
]),
7474
trigger('expansionHeight', [
7575
state('collapsed', style({
@@ -82,7 +82,7 @@ import {Subscription} from 'rxjs/Subscription';
8282
}), {
8383
params: {expandedHeight: '64px'}
8484
}),
85-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
85+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
8686
]),
8787
],
8888
})

src/lib/expansion/expansion-panel.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ export const _MdExpansionPanelMixinBase = mixinDisabled(MdExpansionPanelBase);
4141
/** MdExpansionPanel's states. */
4242
export type MdExpansionPanelState = 'expanded' | 'collapsed';
4343

44-
/** Time and timing curve for expansion panel animations. */
45-
export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
46-
4744
/**
4845
* <md-expansion-panel> component.
4946
*
@@ -72,7 +69,7 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
7269
trigger('bodyExpansion', [
7370
state('collapsed', style({height: '0px', visibility: 'hidden'})),
7471
state('expanded', style({height: '*', visibility: 'visible'})),
75-
transition('expanded <=> collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
72+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
7673
]),
7774
],
7875
})

src/lib/snack-bar/snack-bar-container.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ import {MdSnackBarConfig} from './snack-bar-config';
4040

4141
export type SnackBarState = 'visible' | 'hidden' | 'void';
4242

43-
// TODO(jelbourn): we can't use constants from animation.ts here because you can't use
44-
// a text interpolation in anything that is analyzed statically with ngc (for AoT compile).
45-
export const SHOW_ANIMATION = '225ms cubic-bezier(0.4,0.0,1,1)';
46-
export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)';
47-
4843
/**
4944
* Internal component that wraps user-provided snack bar content.
5045
* @docs-private
@@ -67,14 +62,14 @@ export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)';
6762
// Animation from top.
6863
state('visible-top', style({transform: 'translateY(0%)'})),
6964
state('hidden-top', style({transform: 'translateY(-100%)'})),
70-
transition('visible-top => hidden-top', animate(HIDE_ANIMATION)),
71-
transition('void => visible-top', animate(SHOW_ANIMATION)),
65+
transition('visible-top => hidden-top', animate('195ms cubic-bezier(0.0,0.0,0.2,1)')),
66+
transition('void => visible-top', animate('225ms cubic-bezier(0.4,0.0,1,1)')),
7267
// Animation from bottom.
7368
state('visible-bottom', style({transform: 'translateY(0%)'})),
7469
state('hidden-bottom', style({transform: 'translateY(100%)'})),
75-
transition('visible-bottom => hidden-bottom', animate(HIDE_ANIMATION)),
70+
transition('visible-bottom => hidden-bottom', animate('195ms cubic-bezier(0.0,0.0,0.2,1)')),
7671
transition('void => visible-bottom',
77-
animate(SHOW_ANIMATION)),
72+
animate('225ms cubic-bezier(0.4,0.0,1,1)')),
7873
])
7974
],
8075
})

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",

0 commit comments

Comments
 (0)