refactor: improve tree shaking abilities

Internal refactor completed in order to improve tree shaking and dead
code removal. The public API, with an exception to ion-slides, has
stayed the same. However, internally many changes were required so
bundlers could better exclude modules which should not be bundled.
Ultimately most changes resorted to removing references to `window` or
`document`, or a module that referenced one of those.

BREAKING CHANGES

ion-slides was refactored to remove the external dependencies, and
rewritten in TypeScript/ES6 modules to again improve tree shaking
abilities.
This commit is contained in:
Adam Bradley
2017-01-09 09:51:39 -06:00
parent 13cf6a6cb7
commit 7000b1b173
191 changed files with 9401 additions and 13664 deletions

View File

@ -1,12 +1,12 @@
import { Component, Renderer, ElementRef, HostListener, ViewEncapsulation } from '@angular/core';
import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
import { assert } from '../../util/util';
import { BlockerDelegate, GestureController, BLOCK_ALL } from '../../gestures/gesture-controller';
import { Config } from '../../config/config';
import { focusOutActiveElement } from '../../util/dom';
import { Key } from '../../util/key';
import { Key } from '../../platform/key';
import { Platform } from '../../platform/platform';
import { NavParams } from '../../navigation/nav-params';
import { ViewController } from '../../navigation/view-controller';
import { BlockerDelegate, GestureController, BLOCK_ALL } from '../../gestures/gesture-controller';
import { assert } from '../../util/util';
/**
* @private
@ -59,6 +59,7 @@ export class ActionSheetCmp {
constructor(
private _viewCtrl: ViewController,
config: Config,
private _plt: Platform,
private _elementRef: ElementRef,
gestureCtrl: GestureController,
params: NavParams,
@ -122,7 +123,7 @@ export class ActionSheetCmp {
}
ionViewDidEnter() {
focusOutActiveElement();
this._plt.focusOutActiveElement();
let focusableEle = this._elementRef.nativeElement.querySelector('button');
if (focusableEle) {