Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds pwa in production mode #3691

Merged
merged 4 commits into from
Mar 9, 2025
Merged

feat: adds pwa in production mode #3691

merged 4 commits into from
Mar 9, 2025

Conversation

amir20
Copy link
Owner

@amir20 amir20 commented Mar 8, 2025

Fixes #3688

@stasadance
Copy link
Contributor

Did a pull but I don't see a <link rel="manifest" href="manifest.json" /> or similar file and it doesn't seem to act as a PWA

@amir20
Copy link
Owner Author

amir20 commented Mar 8, 2025

I only installed the service worker because the URLs can change. I wasn't aware of a manifest.json. Let me see if that's something I can do.

@amir20
Copy link
Owner Author

amir20 commented Mar 8, 2025

Ok that was a little more tricky. I added a manifest now. Wait till push is done and try again...

Although, I am pretty sure with custom base something would break because the manifest doesn't know about it.

@amir20
Copy link
Owner Author

amir20 commented Mar 8, 2025

@stasadance hmmmm it seems like the service worker breaks auth as the assets are cached. Do you need service worker? Can I do JUST manifest?

@stasadance
Copy link
Contributor

@stasadance hmmmm it seems like the service worker breaks auth as the assets are cached. Do you need service worker? Can I do JUST manifest?

Manifest alone is fine.

@stasadance
Copy link
Contributor

Manifest works pretty well on my device. Adding the website to my home screen in iOS safari now results in an app like feel where it opens Dozzle in full screen instead of in the browser.

Small thing I noticed.. The site doesn't adjust for the phone's insets in standalone display mode so it looks a bit weird. Screenshot for reference.

I think this can be fixed with 2 changes:

  • Something like <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
  • Using CSS safe area variables in the style for some padding on mobile. safe-area-inset-bottom

Let me know if you would like me to work on these, I'm not familiar with local dev yet but I can set it up.

@amir20
Copy link
Owner Author

amir20 commented Mar 8, 2025

That would be great if you can. I am not too familiar with PWA. You should be able to do make tools and finally make dev.

I think Vite PWA does a lot more than needed. Perhaps just creating a manifest is good enough. Thoughts?

Let me know if you have a hard time getting local dev to work. If you are on a Mac (which is what I have) it should be ok.

@stasadance
Copy link
Contributor

That would be great if you can. I am not too familiar with PWA. You should be able to do make tools and finally make dev.

I think Vite PWA does a lot more than needed. Perhaps just creating a manifest is good enough. Thoughts?

Let me know if you have a hard time getting local dev to work. If you are on a Mac (which is what I have) it should be ok.

Manifest alone sounds good enough to me. I'll work on a duplicate PR with some CSS.

@amir20
Copy link
Owner Author

amir20 commented Mar 8, 2025

I pushed some changes to remove vite pwa but keep manifest.

I have never heard of safe-area-inset-bottom 😂

I'll wait to see what you cook up.

@amir20
Copy link
Owner Author

amir20 commented Mar 9, 2025

Going to merge this and release since there are some bugs pending.

@amir20 amir20 merged commit 80bbb31 into master Mar 9, 2025
10 checks passed
@amir20 amir20 deleted the pwa branch March 9, 2025 00:41
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.

Add PWA Manifest
2 participants