Skip to content

Commit 8693733

Browse files
authored
perf: lazy load screenshots and icons to improve initial render perfo… (#138)
1 parent 5265954 commit 8693733

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@khmyznikov/pwa-install",
3-
"version": "0.5.7",
3+
"version": "0.5.8",
44
"description": "PWA install dialog provide more convenience user experience and fix lack of native dialogs in some browsers.",
55
"repository": {
66
"type": "git",
@@ -62,7 +62,7 @@
6262
"copy-webpack-plugin": "^13.0.0",
6363
"eslint": "^9.26.0",
6464
"express": "^5.1.0",
65-
"filemanager-webpack-plugin": "^8.0.0",
65+
"filemanager-webpack-plugin": "^9.0.1",
6666
"lit-scss-loader": "^2.0.1",
6767
"minify-lit-html-loader": "github:khmyznikov/minify-lit-html-loader",
6868
"null-loader": "^4.0.1",
@@ -72,7 +72,7 @@
7272
"sass": "^1.87.0",
7373
"sass-loader": "^16.0.5",
7474
"terser-webpack-plugin": "^5.3.14",
75-
"ts-loader": "9.5.2",
75+
"ts-loader": "9.5.4",
7676
"typescript": "^5.8.3",
7777
"typescript-lit-html-plugin": "^0.9.0",
7878
"webpack": "^5.99.7",

src/templates/apple/template-apple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const template = (name: string, description: string, installDescription: string,
6060
</div>
6161
</div>
6262
</div>
63-
${screenshotsAvailable && manifest.screenshots? html`<pwa-gallery .screenshots=${manifest.screenshots} .theme="${isDesktop? 'apple_desktop': 'apple_mobile'}" .rtl="${isRTL}"></pwa-gallery>`: ''}
63+
${screenshotsAvailable && installAvailable? html`<pwa-gallery .screenshots=${manifest.screenshots} .theme="${isDesktop? 'apple_desktop': 'apple_mobile'}" .rtl="${isRTL}"></pwa-gallery>`: ''}
6464
<div class="action-buttons">
6565
${screenshotsAvailable? html`<button class="dialog-button button gallery" @click=${toggleGallery}>
6666
${isDesktop?

src/templates/chrome/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const template = (name: string, description: string, installDescription: string,
2929
${!disableDescription?
3030
html`<hr><div class="description install-description">${installDescription? installDescription: `${msg('This site has app functionality.')} ${msg('Install it on your device for extensive experience and easy access.')}`}</div>`
3131
: ''}
32-
${screenshotsAvailable? html`<pwa-gallery .screenshots=${manifest.screenshots as ManifestScreenshot[]} .rtl="${isRTL}"></pwa-gallery>`: ''}
32+
${screenshotsAvailable && installAvailable? html`<pwa-gallery .screenshots=${manifest.screenshots as ManifestScreenshot[]} .rtl="${isRTL}"></pwa-gallery>`: ''}
3333
<div class="action-buttons">
3434
${screenshotsAvailable? html`<button class="material-button secondary" @click='${toggleGallery}'>${galleryRequested?msg('Less'):msg('More')}</button>`:''}
3535
<button class="material-button primary install" @click='${install}'>${msg('Install')}</button>
@@ -38,7 +38,7 @@ const template = (name: string, description: string, installDescription: string,
3838
</div>
3939
<div class="install-dialog chrome mobile ${classMap(installDialogClasses())}">
4040
<pwa-bottom-sheet .props=${{name, icon, description}} .disableClose=${disableClose} .install=${install} .hideDialog=${hideDialog} .toggleHowTo=${toggleHowTo} .howToRequested=${howToRequested} .fallback=${isAndroidFallback}>
41-
${screenshotsAvailable? html`<pwa-gallery .screenshots=${manifest.screenshots as ManifestScreenshot[]} .rtl="${isRTL}"></pwa-gallery>`: ''}
41+
${screenshotsAvailable && installAvailable? html`<pwa-gallery .screenshots=${manifest.screenshots as ManifestScreenshot[]} .rtl="${isRTL}"></pwa-gallery>`: ''}
4242
</pwa-bottom-sheet>
4343
</div>
4444
</div>`;

0 commit comments

Comments
 (0)