mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
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:
@ -7,7 +7,7 @@ import { PickerColumn, PickerColumnOption } from '../picker/picker-options';
|
||||
import { Form } from '../../util/form';
|
||||
import { Ion } from '../ion';
|
||||
import { Item } from '../item/item';
|
||||
import { merge, isBlank, isPresent, isTrueProperty, isArray, isString } from '../../util/util';
|
||||
import { deepCopy, isBlank, isPresent, isTrueProperty, isArray, isString } from '../../util/util';
|
||||
import { dateValueRange, renderDateTime, renderTextFormat, convertFormatToKey, getValueFromFormat, parseTemplate, parseDate, updateDate, DateTimeData, convertDataToISO, daysInMonth, dateSortValue, dateDataSortValue, LocaleData } from '../../util/datetime-util';
|
||||
|
||||
export const DATETIME_VALUE_ACCESSOR: any = {
|
||||
@ -408,7 +408,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
@Input() pickerOptions: any = {};
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
@ -473,9 +473,9 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
console.debug('datetime, open picker');
|
||||
|
||||
// the user may have assigned some options specifically for the alert
|
||||
let pickerOptions = merge({}, this.pickerOptions);
|
||||
const pickerOptions = deepCopy(this.pickerOptions);
|
||||
|
||||
let picker = this._pickerCtrl.create(pickerOptions);
|
||||
const picker = this._pickerCtrl.create(pickerOptions);
|
||||
pickerOptions.buttons = [
|
||||
{
|
||||
text: this.cancelText,
|
||||
|
Reference in New Issue
Block a user