Skip to content

Commit c2f5803

Browse files
authored
perf(angular): disable async queue (#16118)
* perf(angular): disable async queue * wip * update proxy
1 parent fa965e2 commit c2f5803

File tree

8 files changed

+184
-77
lines changed

8 files changed

+184
-77
lines changed

angular/src/app-initialize.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export function appInitialize(config: Config) {
1414
const Ionic = win.Ionic = win.Ionic || {};
1515

1616
Ionic.config = config;
17+
Ionic.asyncQueue = false;
1718

1819
Ionic.ael = (elm, eventName, cb, opts) => {
1920
if (elm.__zone_symbol__addEventListener && skipZone(eventName)) {
@@ -45,12 +46,10 @@ export function appInitialize(config: Config) {
4546
};
4647
}
4748

48-
const SKIP_ZONE = [
49-
'scroll',
50-
'touchmove',
51-
'mousemove'
49+
const PASS_ZONE = [
50+
'click',
5251
];
5352

5453
function skipZone(eventName: string) {
55-
return SKIP_ZONE.indexOf(eventName) >= 0;
54+
return PASS_ZONE.indexOf(eventName) < 0;
5655
}

angular/src/directives/navigation/tabs-delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class TabsDelegate {
1717

1818
@HostListener('ionTabButtonClick', ['$event'])
1919
onTabbarClick(ev: UIEvent) {
20-
const tabElm: HTMLIonTabElement = ev.detail as any;
20+
const tabElm: HTMLIonTabButtonElement = ev.detail as any;
2121
if (this.router && tabElm && tabElm.href) {
2222
this.router.navigateByUrl(tabElm.href);
2323
}

angular/src/directives/proxies.ts

Lines changed: 139 additions & 70 deletions
Large diffs are not rendered by default.

angular/src/types/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface IonicGlobal {
44
ael?: (elm: any, eventName: string, cb: (ev: Event) => void, opts: any) => void;
55
raf?: (ts: number) => void;
66
rel?: (elm: any, eventName: string, cb: (ev: Event) => void, opts: any) => void;
7+
asyncQueue?: boolean;
78
}
89

910
export interface IonicWindow extends Window {

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ionicons": "4.4.6"
3131
},
3232
"devDependencies": {
33-
"@stencil/core": "0.15.1",
33+
"@stencil/core": "0.15.2-0",
3434
"@stencil/sass": "0.1.1",
3535
"@stencil/utils": "latest",
3636
"@types/jest": "^23.3.1",
Lines changed: 1 addition & 0 deletions
Loading

core/src/components/tab-bar/test/scenarios/index.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@
88
<script src="../../../../../dist/ionic.js"></script>
99
<link rel="stylesheet" href="../../../../../css/ionic.bundle.css">
1010
<link rel="stylesheet" href="../../../../../scripts/testing/styles.css">
11+
12+
<style>
13+
.custom-tabbar {
14+
overflow: visible;
15+
contain: none;
16+
}
17+
.main-tab {
18+
--padding-top: 18px;
19+
20+
border-radius: 50%;
21+
max-width: 80px;
22+
height: 80px;
23+
background: #848484;
24+
color: white;
25+
font-size: 16px;
26+
}
27+
28+
</style>
1129
</head>
1230

1331
<body>
@@ -187,6 +205,24 @@
187205
</ion-tab-button>
188206
</ion-tab-bar>
189207

208+
<!-- Custom TabBar -->
209+
<ion-tab-bar selected-tab="1" class="custom-tabbar">
210+
<ion-tab-button tab='1'>
211+
<ion-label>Location</ion-label>
212+
<ion-icon name="navigate"></ion-icon>
213+
</ion-tab-button>
214+
215+
<ion-tab-button tab='2' class="main-tab">
216+
<ion-icon src="/src/components/tab-bar/test/scenarios/camera.svg"></ion-icon>
217+
</ion-tab-button>
218+
219+
<ion-tab-button tab='3'>
220+
<ion-label>Radio</ion-label>
221+
<ion-icon name="musical-notes"></ion-icon>
222+
</ion-tab-button>
223+
224+
</ion-tab-bar>
225+
190226
</ion-app>
191227

192228
</body>

core/stencil.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const config: Config = {
6565
},
6666
{
6767
type: 'angular',
68+
useDirectives: false,
6869
componentCorePackage: '@ionic/core',
6970
directivesProxyFile: '../angular/src/directives/proxies.ts',
7071
directivesArrayFile: '../angular/src/directives/proxies-list.txt',

0 commit comments

Comments
 (0)