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

Turn Stacker News into a Progressive Web App #137

Closed
notnout opened this issue Apr 15, 2022 · 1 comment · Fixed by #292
Closed

Turn Stacker News into a Progressive Web App #137

notnout opened this issue Apr 15, 2022 · 1 comment · Fixed by #292
Labels
feature new product features that weren't there before

Comments

@notnout
Copy link
Contributor

notnout commented Apr 15, 2022

Currently on my machine it takes ~2s to get response to the initial GET / request, which slows down the experience.
If the App would follow the rules around PWAs and register ServiceWorker, define manifest and static resources, then the initial 2s could be completely eliminated. PWAs are using interesting set of native browser APIs and there are multiple interesting things that can be done.

Here are basic tutorials:

The are various benefits, e.g.

  • saving latency and number of resources that need to be sent over wire (essentially the ServiceWorker serves as a proxy between the web app and internet - you can do various caching and background-refetching schemes)
  • better control around icons on the phone
  • the app can fairly easily be wrapped into an Android app and put on Play Store: https://developers.google.com/codelabs/pwa-in-play#0
  • It's easier/possible to register phone notifications even if Stacker News isn't in focus
@huumn
Copy link
Member

huumn commented May 11, 2023

After looking at this again, display: standalone, which is the main thing stackers claim they want when they ask for a PWA, does not allow the PWA to share state with the browser on iOS Safari, nor can you link to a PWA on iOS, so email login won't work. Also, navigation (back/reload) is lost with standalone and SN doesn't provide any navigation (wizards claim this doesn't matter but part of maintaining high wizard status is not caring about non-wizards). A middle ground: Chrome treats minimal-ui nearly the same as standalone and Safari treats minimal-ui like browser, and navigation is retained in either case, so for now we can use display: minimal-ui.

Another option is to grab the user-agent when the manifest is requested and return a different manifest depending on the browser/os.

I'm going to leave this open because it's still desirable to have an actual PWA, one that does everything a PWA can do. However IMVHO it at least requires figuring out navigation and login.

@ekzyis ekzyis added the feature new product features that weren't there before label May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new product features that weren't there before
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants