Skip to content

add PWA support with vite-plugin-pwa, extract manifest to separate file#218

Open
AduchiMergen wants to merge 2 commits into
SunceWallet:masterfrom
AduchiMergen:PWA
Open

add PWA support with vite-plugin-pwa, extract manifest to separate file#218
AduchiMergen wants to merge 2 commits into
SunceWallet:masterfrom
AduchiMergen:PWA

Conversation

@AduchiMergen

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread package.json Outdated
Co-authored-by: Kosta Korenkov <kosta@korenkov.net>

@troggy troggy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR: this PR is strictly an improvement (e.g. caching app assets for offline use is amazing), though PWA is not yet fully usable (e.g. web+stellar links are not working). I'd merge and keep improving further.

Tested on desktop:

🟩 "Install app" badge visible in browser and works
🟩 App assets are cached with service worker and available offline (tested by setting Offline flag in Dev Tools > Application)
🟧 Setting web+stellar protocol handler keeps opening the website, not a PWA installed app. Not great, would love to see if it is fixable at least in theory

Tested on mobile (via loophole HTTPS site):

🟧 No "install app" prompt visible prompt. Can be installed as usual via menu. Not great, but manifest is used
🟩 App assets are cached with service worker and available offline (tested in Airplane mode)
🟥 Cannot set set protocol handler at all. Clicking either "Handle Stellar protocol requests" menu option or prompt on account view screen does nothing.

Testing notes:

Checkout and build for web:

git remote add aduchi git@github.com:AduchiMergen/sunce.git
git fetch aduchi
git checkout aduchi/PWA
npm install
npm run build:web
npx http-server -p 5002 dist

Run with https (in parallel with web part served from localhost:5002):

loophole http --hostname sunce-pwa-test 5002

Comment thread package-lock.json
@@ -121,6 +121,7 @@
"typescript": "^5.3.3",
"vite": "^6.2.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-pwa": "^1.3.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to sync package-lock with package.json (npm install will do)

@troggy

troggy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

ещё неплохо бы потестить авто-обновление:

  1. Пользователь открыл Сунце → ресурсы закэшировались
  2. Сунце обновилось
  3. Пользователь открывает Сунце → подтягивается последняя версия ресурсов.

Пользователь продолжит работать со старой версией до перезагрузки?

cc @sozidatel

@troggy

troggy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@AduchiMergen порезолвишь конфликты?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants