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,8 +1,9 @@
import { Menu } from './menu';
import { DomController } from '../../platform/dom-controller';
import { GestureController, GesturePriority, GESTURE_MENU_SWIPE } from '../../gestures/gesture-controller';
import { Platform } from '../../platform/platform';
import { SlideEdgeGesture } from '../../gestures/slide-edge-gesture';
import { SlideData } from '../../gestures/slide-gesture';
import { GestureController, GesturePriority, GESTURE_MENU_SWIPE } from '../../gestures/gesture-controller';
import { DomController } from '../../util/dom-controller';
/**
* Gesture attached to the content which the menu is assigned to
@ -10,11 +11,12 @@ import { DomController } from '../../util/dom-controller';
export class MenuContentGesture extends SlideEdgeGesture {
constructor(
plt: Platform,
public menu: Menu,
gestureCtrl: GestureController,
domCtrl: DomController,
) {
super(document.body, {
super(plt, plt.doc().body, {
direction: 'x',
edge: menu.side,
threshold: 5,