feat(queue): use stencil's queue controller for dom read/writes

This commit is contained in:
Adam Bradley
2018-04-11 15:24:49 -05:00
parent 6a31f3960a
commit d623b3b71f
17 changed files with 75 additions and 145 deletions

View File

@ -1,6 +1,5 @@
import 'ionicons';
import { createConfigController } from './config-controller';
import { createDomControllerClient } from './dom-controller';
import { PLATFORM_CONFIGS, detectPlatforms, readQueryParam } from './platform-configs';
@ -8,12 +7,9 @@ const Ionic = (window as any).Ionic = (window as any).Ionic || {};
declare const Context: any;
// add dom controller, used to coordinate DOM reads and write in order to avoid
// layout thrashing
if (!Context.dom) {
const now = () => window.performance.now();
Context.dom = createDomControllerClient(window, now);
}
// queue used to coordinate DOM reads and
// write in order to avoid layout thrashing
Ionic.queue = Context.queue;
if (!Context.platforms) {
Context.platforms = detectPlatforms(window.location.href, window.navigator.userAgent, PLATFORM_CONFIGS, 'core');