Skip to content

Commit

Permalink
feat: debug all renders
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Feb 6, 2023
1 parent 2134efb commit 73a0d34
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ui/demo-pwa/src/page-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class AlwatrPageCard extends AlwatrSmartElement {
`;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<alwatr-icon-box
.content=${{icon: 'gift-outline', headline: 'قرعه کشی', description: loremText}}
Expand Down
2 changes: 1 addition & 1 deletion ui/demo-pwa/src/page-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class AlwatrPageHome extends AlwatrSmartElement {
`;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`<alwatr-chat></alwatr-chat>`;
}
}
2 changes: 1 addition & 1 deletion ui/icon/src/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class AlwatrIcon extends DirectionMixin(SignalMixin(AlwatrDummyElement))
protected _icon?: HTMLTemplateResult;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return this._icon;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/pwa-helper/src/pwa-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class AlwatrPwaElement extends AlwatrSmartElement {
}

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`<div class="page-container">${cache(routerOutlet(this._routesConfig))}</div>`;
}

Expand Down
1 change: 1 addition & 0 deletions ui/ui-kit/src/button/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class AlwatrStandardIconButton extends AlwatrSurface {
}

override render(): unknown {
this._logger.logMethod('render');
return html`<alwatr-icon
part="icon"
?flip-rtl=${this.flipRtl}
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-kit/src/chat/chat-avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AlwatrChatAvatar extends AlwatrDummyElement {
user?: string;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`<img src="https://i.pravatar.cc/40?u=${this.user}" alt="User ${this.user} profile image" />`;
}
}
2 changes: 1 addition & 1 deletion ui/ui-kit/src/chat/chat-bubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class AlwatrChatBubble extends DirectionMixin(SignalMixin(AlwatrDummyElem
text?: string;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`${this.text ?? '...'}`;
}
}
1 change: 1 addition & 0 deletions ui/ui-kit/src/chat/chat-footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class AlwatrChatFooter extends AlwatrDummyElement {
`;

override render(): unknown {
this._logger.logMethod('render');
return html`
<alwatr-icon-button .icon=${'happy-outline'} @click=${this._changeLocale}></alwatr-icon-button>
<alwatr-chat-text-input></alwatr-chat-text-input>
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-kit/src/chat/chat-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class AlwatrChatList extends AlwatrDummyElement {
currentUser?: string;

override render(): unknown {
super.render();
this._logger.logMethod('render');
if (this.storage == null) return nothing;
return html`${map(
this.storage.data,
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-kit/src/chat/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class AlwatrChatMessage extends DirectionMixin(SignalMixin(AlwatrDummyEle
self = false;

override render(): unknown {
super.render();
this._logger.logMethod('render');
if (this.message == null || this.message.type !== 'text') return nothing;

const bubble = html`<alwatr-chat-bubble
Expand Down
1 change: 1 addition & 0 deletions ui/ui-kit/src/chat/chat-text-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class AlwatrChatTextInput extends LocalizeMixin(SignalMixin(AlwatrDummyEl
sendButtonElement: AlwatrStandardIconButton | null = null;

override render(): unknown {
this._logger.logMethod('render');
return html`
<textarea
rows="1"
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-kit/src/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class AlwatrChat extends AlwatrSmartElement {
`;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<alwatr-chat-list .storage=${chatStorage} .currentUser=${currentUser}></alwatr-chat-list>
<alwatr-chat-footer></alwatr-chat-footer>
Expand Down
1 change: 1 addition & 0 deletions ui/ui-kit/src/snackbar/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class AlwatrSnackbar extends AlwatrSurface {
}

override render(): unknown {
this._logger.logMethod('render');
return html`<span class="message">${this.message}</span>${when(
this.actionLabel,
() => html`<alwatr-button @click=${this._actionButtonClick}>${this.actionLabel}</alwatr-button>`,
Expand Down
1 change: 1 addition & 0 deletions uniquely/flight-finder-pwa/src/component/job-add-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class JobAddForm extends AlwatrSmartElement {
};

override render(): unknown {
this._logger.logMethod('render');
return html`
<ion-header>
<ion-toolbar color="secondary">
Expand Down
1 change: 1 addition & 0 deletions uniquely/flight-finder-pwa/src/component/job-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class JobItem extends AlwatrSmartElement {
static jobDeleteEventTrigger = eventTrigger.bind('job-delete');

override render(): unknown {
this._logger.logMethod('render');
if (this.job == null || this.job.detail == null) return nothing;

return html`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class PageFlightFinder extends AlwatrSmartElement {
setInterval(this.__updateTimer, 3_000);
}
override render(): unknown {
this._logger.logMethod('render');
return html`
<ion-header>
<ion-toolbar color="primary">
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/lottery-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class AlwatrLotteryBox extends LocalizeMixin(AlwatrSmartElement) {
protected _box: AlwatrIconBox | null = null;

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`<alwatr-icon-box .content=${this._iconBoxContent} @click=${this._click}>
${this._boxContentTemplate()}
</alwatr-icon-box>`;
Expand Down
4 changes: 2 additions & 2 deletions uniquely/soffit-pwa/src/lottery-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {customElement, css, html, property, AlwatrSmartElement, state, LocalizeMixin} from '@alwatr/element';
import {customElement, css, html, property, AlwatrSmartElement, LocalizeMixin} from '@alwatr/element';
import {message} from '@alwatr/i18n';
import {commandTrigger} from '@alwatr/signal';

Expand Down Expand Up @@ -109,7 +109,7 @@ export class AlwatrLotteryForm extends LocalizeMixin(AlwatrSmartElement) {
}

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<alwatr-text-field
name="code"
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/page-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AlwatrPageHome extends AlwatrSmartElement {
}

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<header><img @click=${this._changeLocale.bind(this)} src="image/soffit.svg" alt="SOFFIT Logo" /></header>
<main>${this._menuTemplate()}</main>
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/supply-chain-box.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {customElement, html, state} from '@alwatr/element';
import {customElement, html} from '@alwatr/element';
import {message} from '@alwatr/i18n';

import {AlwatrLotteryBox} from './lottery-box.js';
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/supply-chain-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AlwatrSupplyChainForm extends AlwatrLotteryForm {
static override formId = 'supply-chain';

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<alwatr-text-field
name="name"
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/tech-dep/radio-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class AlwatrFieldSet extends AlwatrDummyElement {
}

override render(): unknown {
super.render();
this._logger.logMethod('render');
return html`
<fieldset>
<legend>${this.options?.title}</legend>
Expand Down

0 comments on commit 73a0d34

Please sign in to comment.