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

Remove PWA installability requirement to have a Service Worker #34127

Merged
merged 16 commits into from
Jun 21, 2024

Conversation

FormularSumo
Copy link
Contributor

Fixes #34124

@FormularSumo FormularSumo requested a review from a team as a code owner June 13, 2024 16:28
@FormularSumo FormularSumo requested review from hamishwillee and removed request for a team June 13, 2024 16:28
@github-actions github-actions bot added Content:PWA Progressive Web Apps content size/s [PR only] 6-50 LoC changed labels Jun 13, 2024
Copy link
Contributor

github-actions bot commented Jun 13, 2024

@hamishwillee
Copy link
Collaborator

hamishwillee commented Jun 17, 2024

@FormularSumo Is there a chromestatus or bug or similar that shows when the requirement for service worker disappeared from chrome? My thinking here is that a softer removal is needed than this (or some kind of compatibility info) if the release is relatively recent.

So what is it that defines a PWA? Is it just the presence of a manifest file and being served over HTTPS?
If so, this seems good, though perhaps a little brutal :-).

@wbamberg were you planning on looking at this?

@@ -12,7 +12,7 @@ This intro-level tutorial walks through all the steps of building a basic progre

We will walk through the steps of building a fully functional web app, then progressively enhance CycleTracker to make it installable and to work even when the user is offline.

By default, PWAs are regular websites, built with the same technologies. Just like a regular websites, PWAs are linkable, discoverable via search engines, and visible in a browser. By including a manifest file and service worker, and serving the website over TLS, any website can become a PWA.
By default, PWAs are regular websites, built with the same technologies. Just like a regular websites, PWAs are linkable, discoverable via search engines, and visible in a browser. By including a manifest file, and serving the website over TLS, any website can become a PWA.
Copy link
Collaborator

@hamishwillee hamishwillee Jun 17, 2024

Choose a reason for hiding this comment

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

So it comes down to what defines a PWA - if it is just a manifest file and serving a website over TLS, this is correct.

But I'd still consider having some note here about the service worker even if it isn't a requirement of being a PWA, it is a core feature of what makes PWAs actually useful.

@wbamberg
Copy link
Collaborator

I've tested this in Chrome and it's correct, we don't even need a minimal service worker for a website to be installable. Perhaps @captainbrosset might remember why we said it did :).

I think this is a good PR although we should also address https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app#technical_features_of_pwas. For that page, though, rather than just delete all the SW stuff we should soften the language, because SW are pretty fundamental to PWAs. So for example:

A PWA must have a service worker, and the service worker must implement at least a minimal offline experience.

...could change to:

While a PWA does not need to have a service worker to be installable, most PWAs will include a service worker.

@hamishwillee :

So what is it that defines a PWA? Is it just the presence of a manifest file and being served over HTTPS?

Yeah, although the manifest has a few mandatory keys AFAIK. I think this link ought to be the definitive description (on MDN anyway): https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable#installability.

My thinking here is that a softer removal is needed than this (or some kind of compatibility info) if the release is relatively recent.

https://web.dev/articles/install-criteria says it was last updated in 2020, so if we can believe that, we should be good.

The js13kGames tutorial hasn't been properly updated since 2017, and doesn't really fit with the new content. I would just delete it personally, but it was decided we should keep it 🤷 .

@hamishwillee
Copy link
Collaborator

@FormularSumo What do you make of the comments, and in particular Will's suggestion to update https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app#technical_features_of_pwas with a softer approach.

IF you don't/can't take that on as part of this, I think we can merge and perhaps do that separately.

@captainbrosset
Copy link
Contributor

I've not followed the most recent discussions on this topic since last year's TPAC when the idea of dropping the requirement for service workers to promote installability was discussed.

Our (Edge's) docs still say that Service Workers are required: "For Microsoft Edge to be able to install the app, your app must have a service worker file." See https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/#step-5---add-a-service-worker

I'll do the research and come back to this thread with an update as soon as I can.

@captainbrosset
Copy link
Contributor

@wbamberg

I've tested this in Chrome and it's correct, we don't even need a minimal service worker for a website to be installable. Perhaps @captainbrosset might remember why we said it did :).

Because SW was a hard requirement for browsers to promote PWA installation.

rather than just delete all the SW stuff we should soften the language, because SW are pretty fundamental to PWAs.

100% agree with this, SW are very fundamental to PWAs, and to the web in general. For an installed PWA to feel "app-y", it really ought to handle offline well, and SW makes this possible.

I'll take a read through the PR in a bit.

@FormularSumo
Copy link
Contributor Author

I'm don't think I believe the PWA install criteria article when it says last updated 2020, I'm almost certain I remember service workers being a requirement when I was trying to make an app installable back in August 2022, and then finding it was no longer the case when I revisited the issue in January this year. I've also managed to find a blog post where Chrome talked about updating their instability criteria - https://developer.chrome.com/blog/update-install-criteria - apparently the service worker requirement was dropped in Chrome 108 (2022-11-29) for mobile and 112 (2023-04-04) for desktop. According to the article, a registered service worker was still needed to prompt for installation, but not to be installable, and they were working on changing that as well. Having just tested now my app which does not use/register any service workers does still get prompted for install in Chrome and Edge so I assume this must have also been dropped since.

So I think it's safe to say that service workers aren't a requirement for installability now, just a correct manifest and https. A user engagement criteria is also needed for installation prompts (see the Chrome requirements), which is currently missing from any of the MDN pages so perhaps should be added in a separate PR. I see your point though about service workers and offline functionality still being important/highly relevant to PWAs, so I'm going to go through and update my PR to reflect this and make it a bit softer as you suggested.

@FormularSumo
Copy link
Contributor Author

I've finished updating the pages now. I think it should make it clear that service workers/offline functionality is not a hard requirement, but definitely a sensible thing for a PWA to have. Let me know if you think it works.

…cure_connection/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Thanks very much @FormularSumo (and @captainbrosset ). I've done a minor subedit. Merging.

@hamishwillee hamishwillee merged commit 1c8c727 into mdn:main Jun 21, 2024
8 checks passed
@FormularSumo
Copy link
Contributor Author

Thanks for all the reviews and for merging the PR - it looks great now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:PWA Progressive Web Apps content size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Workers are no longer a requirement for PWA installation
4 participants