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

@ -7,7 +7,7 @@ import { App } from '../app/app';
import { Config } from '../../config/config';
import { Form } from '../../util/form';
import { Ion } from '../ion';
import { isBlank, isCheckedProperty, isTrueProperty, merge } from '../../util/util';
import { isBlank, isCheckedProperty, isTrueProperty, deepCopy } from '../../util/util';
import { Item } from '../item/item';
import { NavController } from '../../navigation/nav-controller';
import { Option } from '../option/option';
@ -191,7 +191,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
@Input() selectedText: string = '';
/**
* @input {string} The mode to apply to this component.
* @input {string} The mode to apply to this component. Mode can be `ios`, `wp`, or `md`.
*/
@Input()
set mode(val: string) {
@ -257,7 +257,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
console.debug('select, open alert');
// the user may have assigned some options specifically for the alert
let selectOptions = merge({}, this.selectOptions);
const selectOptions = deepCopy(this.selectOptions);
// make sure their buttons array is removed from the options
// and we create a new array for the alert's two buttons