Skip to content

Commit

Permalink
perf(animations): reduce size of animations bundle
Browse files Browse the repository at this point in the history
before:
animations.umd.js = 33k
animations.umd.min.js = 9.0k

after:
animations.umd.js = 31k
animations.umd.min.js = 7.9k
  • Loading branch information
matsko committed May 17, 2017
1 parent 6416e79 commit 712630c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
33 changes: 16 additions & 17 deletions packages/animations/src/players/animation_player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ import {scheduleMicroTask} from '../util';
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationPlayer {
abstract onDone(fn: () => void): void;
abstract onStart(fn: () => void): void;
abstract onDestroy(fn: () => void): void;
abstract init(): void;
abstract hasStarted(): boolean;
abstract play(): void;
abstract pause(): void;
abstract restart(): void;
abstract finish(): void;
abstract destroy(): void;
abstract reset(): void;
abstract setPosition(p: any /** TODO #9100 */): void;
abstract getPosition(): number;
get parentPlayer(): AnimationPlayer|null { throw new Error('NOT IMPLEMENTED: Base Class'); }
set parentPlayer(player: AnimationPlayer|null) { throw new Error('NOT IMPLEMENTED: Base Class'); }
get totalTime(): number { throw new Error('NOT IMPLEMENTED: Base Class'); }
export interface AnimationPlayer {
onDone(fn: () => void): void;
onStart(fn: () => void): void;
onDestroy(fn: () => void): void;
init(): void;
hasStarted(): boolean;
play(): void;
pause(): void;
restart(): void;
finish(): void;
destroy(): void;
reset(): void;
setPosition(p: any /** TODO #9100 */): void;
getPosition(): number;
parentPlayer: AnimationPlayer|null;
readonly totalTime: number;
beforeDestroy?: () => any;
}

Expand Down
28 changes: 14 additions & 14 deletions tools/public_api_guard/animations/animations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,23 @@ export interface AnimationOptions {
}

/** @experimental */
export declare abstract class AnimationPlayer {
export interface AnimationPlayer {
beforeDestroy?: () => any;
parentPlayer: AnimationPlayer | null;
readonly totalTime: number;
abstract destroy(): void;
abstract finish(): void;
abstract getPosition(): number;
abstract hasStarted(): boolean;
abstract init(): void;
abstract onDestroy(fn: () => void): void;
abstract onDone(fn: () => void): void;
abstract onStart(fn: () => void): void;
abstract pause(): void;
abstract play(): void;
abstract reset(): void;
abstract restart(): void;
abstract setPosition(p: any): void;
destroy(): void;
finish(): void;
getPosition(): number;
hasStarted(): boolean;
init(): void;
onDestroy(fn: () => void): void;
onDone(fn: () => void): void;
onStart(fn: () => void): void;
pause(): void;
play(): void;
reset(): void;
restart(): void;
setPosition(p: any): void;
}

/** @experimental */
Expand Down

0 comments on commit 712630c

Please sign in to comment.