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,5 +1,6 @@
import { VirtualCell, VirtualData, VirtualNode } from '../virtual-util';
import { processRecords, populateNodeData, initReadNodes, getVirtualHeight, adjustRendered, estimateHeight } from '../virtual-util';
import { mockPlatform } from '../../../util/mock-providers';
describe('VirtualScroll', () => {
@ -324,7 +325,7 @@ describe('VirtualScroll', () => {
{row: 0, tmpl: TEMPLATE_FOOTER, reads: 0},
];
initReadNodes(nodes, cells, data);
initReadNodes(mockPlatform(), nodes, cells, data);
expect(cells[0].top).toBe(firstTop);
expect(cells[0].left).toBe(0);
@ -374,7 +375,7 @@ describe('VirtualScroll', () => {
{row: 4, tmpl: TEMPLATE_FOOTER, reads: 0},
];
initReadNodes(nodes, cells, data);
initReadNodes(mockPlatform(), nodes, cells, data);
expect(cells[0].top).toBe(0);
expect(cells[0].height).toBe(HEIGHT_HEADER);