pwa: add manifest and related app icons #41

Merged
offbyn merged 1 commits from pwa-add-manifest into master 2 years ago
offbyn commented 2 years ago
Owner

that nostr.ch has a pretty app icon when adding to home screen.

fixes: #15

that nostr.ch has a pretty app icon when adding to home screen. fixes: https://git.qcode.ch/nostr/nostrweb/issues/15
offbyn added 1 commit 2 years ago
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
b86cf6f687
pwa: add manifest and related app icons
That nostr.ch has a pretty app icon when adding to home screen.
offbyn requested review from x1ddos 2 years ago
x1ddos approved these changes 2 years ago
x1ddos left a comment
Owner

lgtm but come on, png can be smaller! :)

image

lgtm but come on, png can be smaller! :) ![image](/attachments/7abee740-4360-4ffd-87f5-2040c399fbaa)
312 KiB
@ -36,6 +39,7 @@ export const options = {
}),
NodeGlobalsPolyfillPlugin({buffer: true}),
replaceOnCopyPlugin(/about\.html$/),
replaceOnCopyPlugin(/manifest\.json$/),
x1ddos commented 2 years ago
Owner

if there's nothing to replace, you could instead add the .json extension to the loader:

loader: {..., '.json': 'copy'}

and remove replaceOnCopyPlugin(/manifest\.json$/) from here.

if there's nothing to replace, you could instead add the .json extension to the loader: ```js loader: {..., '.json': 'copy'} ``` and remove `replaceOnCopyPlugin(/manifest\.json$/)` from here.
offbyn commented 2 years ago
Poster
Owner

I did at first, but then it also found some package.json (not ours iirc)

the only way i could make it work is with replaceOnCopyPlugin(/manifest\.json$/)

I did at first, but then it also found some package.json (not ours iirc) the only way i could make it work is with `replaceOnCopyPlugin(/manifest\.json$/)`
x1ddos commented 2 years ago
Owner

ah good to know! 👍

ah good to know! 👍
offbyn commented 2 years ago
Poster
Owner

adding '.json': 'copy', adds the following (at least on pc):

cat dist/package-RG2JZGPY.json 
{
  "name": "websocket",
  "description": "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",
  "keywords": [

adding `'.json': 'copy',` adds the following (at least on pc): ``` cat dist/package-RG2JZGPY.json { "name": "websocket", "description": "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", "keywords": [ ```
x1ddos commented 2 years ago
Owner

🤮 yeah, keep the replaceOnCopyPlugin then!

🤮 yeah, keep the replaceOnCopyPlugin then!
offbyn commented 2 years ago
Poster
Owner

lgtm but come on, png can be smaller! :)

I used pngquant, there is prob always a smaller format.

prob webp would be better.

> lgtm but come on, png can be smaller! :) I used pngquant, there is prob always a smaller format. prob webp would be better.
offbyn commented 2 years ago
Poster
Owner

@x1ddos do you know if these icons are only downloaded once, when user adds-to-home screen?

are they downloaded again once they are on your homescreen?

prob webp would be better.

then I guess a bigger joice of smaller format would make sense.

or drop all pngs/webp etc and only provide the .svg
(294B asssets/nostr-favicon.svg), but probably not all systems support svg :(

@x1ddos do you know if these icons are only downloaded once, when user adds-to-home screen? are they downloaded again once they are on your homescreen? > prob webp would be better. then I guess a bigger joice of smaller format would make sense. or drop all pngs/webp etc and only provide the .svg (294B asssets/nostr-favicon.svg), but probably not all systems support svg :(
x1ddos commented 2 years ago
Owner

are they downloaded again once they are on your homescreen?

no idea but if i had to guess, i'd say it depends on the platform. android will probaby never re-download automatically. iphone - no sure. a chromebook might since web/http is all it does :)

i would keep png. was just saying it could be smaller but not a big deal.

> are they downloaded again once they are on your homescreen? no idea but if i had to guess, i'd say it depends on the platform. android will probaby never re-download automatically. iphone - no sure. a chromebook might since web/http is all it does :) i would keep png. was just saying it could be smaller but not a big deal.
offbyn reviewed 2 years ago
@ -0,0 +1,21 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"background_color": "#191919",
offbyn commented 2 years ago
Poster
Owner

dark-mode first :)

dark-mode first :)
offbyn merged commit b86cf6f687 into master 2 years ago
offbyn deleted branch pwa-add-manifest 2 years ago

Reviewers

x1ddos approved these changes 2 years ago
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
The pull request has been merged as b86cf6f687.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b pwa-add-manifest master
git pull origin pwa-add-manifest

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff pwa-add-manifest
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nostr/nostrweb#41
Loading…
There is no content yet.