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

[PROJECT] Revamp the Progressive Web Apps documentation #280

Closed
19 tasks done
captainbrosset opened this issue Dec 8, 2022 · 8 comments
Closed
19 tasks done

[PROJECT] Revamp the Progressive Web Apps documentation #280

captainbrosset opened this issue Dec 8, 2022 · 8 comments
Assignees
Labels
Content: Web API involves: Content Requires the attention of the Content team. p1 We will address this soon and will provide capacity from our team for it in the next few releases. project project issues proposal Auto label for new proposals added via the suggestion form
Milestone

Comments

@captainbrosset
Copy link

captainbrosset commented Dec 8, 2022

Task list

Update content

ToC

Generalize content that's too specific

Best practices and benefits

Demo app

Reference

Proposal

The PWA documentation mostly lives under the /Web/Progressive_web_apps area, but a lot of the features and APIs used by PWAs are documented in other areas too.

I think the PWA docs are due for an update as they are starting to show signs of aging. My understanding is that it was created a long time ago by different people, and hasn't necessarily been updated since.
Some of the content appears outdated, and some important things are missing.

The PWA technologies are in constant evolution, and adoption of PWA to build apps for mobile and desktop is rapidly increasing.

As part of the OWD steering committee, I mentioned this idea at the weekly SC meeting and people were receptive to the idea of revamping the docs. So I'm filing this proposal to get things started.


Below is the current table of content of the /Web/Progressive_web_apps area with some of my own comments:

  • Landing page with links
  • Multi-page tutorial to learn to build an app, step by step:
    • Intro, what are PWAs, their benefits.
    • App structure, architecture, app shell, streams.
    • Offline with SW.
    • Making PWA installable, the requirements, manifest members, add to home screen, splash screen.
    • Re-engage users, Push notifications.
    • Progressive loading, perf improvements, bundling and splitting, images, on demand loading.
  • Structural overview of PWA (duplicate of App structure page in the tutorial).
  • Add to home screen, what is it, using beforeinstallprompt (mobile-focused only, Firefox-focused, some outdated desktop info, kind of a duplicate of the tutorial step 4).
  • Installing/uninstalling, how to install on multiple browsers (some outdated browser information, and missing desktop support. Also kind of duplicate of the tutorial step 4).

Additional information

For inspiration, here is a look into other PWA documentation websites.

learn.microsoft.com

The PWA docs on learn.microsoft.com are being updated at the moment. The following table of content is the new one:

  • Overview/what is it/benefits/store
  • Getting started/beginner-style
  • Best practices/how to make great apps, especially on desktop
  • How to
    • publish to store
    • Debug
    • use in edge
    • try OT/experimental features
  • Reference
    • Manifest
    • SW
    • store data
    • icons
      and theme color
    • Badges
    • Notifications
    • Push
    • file handling
    • url handling
    • protocol handling
    • Window Controls Overlay
    • share and share target
    • Shortcuts
    • Widgets
    • background sync
  • what's new
  • demos

web.dev blog

  • Intro
    • what are pwa
    • how pwa can drive business success
    • what makes a good pwa
  • make it installable
    • what does it take
    • define installation strategy
  • provide installable experience
    • app manifest
    • offline fallback page
    • in-app install experience
    • patterns to promote installation
    • using pwa on Android
  • create app-like experience
    • make pwa feel more like an app
    • progressively enhance pwa
  • pwa features
    • Shortcuts
    • maskable icons
    • Wco
    • more ways to improve UX
    • is app installed?
    • share and share target
  • Advanced
    • how updates to manifest are handled
    • multi-origin pwas
    • multiple pwas on same domain
    • offline design guidelines
  • case studies
    • multiple blog posts about products that have transitioned to pwa.

web.dev/learn/pwa

  • Landing page with links to other articles
  • Intro/best of both worlds/benefits/challenges/compat
  • Getting started/tutorial/best practices
  • Foundations/responsive/progressive enhancements/perf
  • App design/window/icon/theme/display mode/css
  • Assets/cache/storage/offline-ready
  • Service workers/register/lifecycle/capabilities
  • Caching/what to cache/using the API/debugging
  • Serving/respond to request/caching strategies
  • Workbox
  • Offline data/IDB/Storage Manager/FileSystem/Web Storage
  • Installation/criteria/desktop and mobile/prompting
  • Manifest/register/debug/members
  • Installation prompt/beforeinstallprompt
  • Update/updating assets/data/service worker/manifest
  • Enhancements/shortcuts/iOS splash screen
  • Detection/display mode/app installation/related apps
  • OS integration/file system/url handling/protocol handling/share/contact picker
  • Window management/browsing to other domains/tabs/new windows/WCO/multi-screen
  • Experimental features/fugu/OT
  • Tools/Device emulation/debugging devtools
  • Architecture/SPA vs MPA/streams
  • Managing complexity
  • Capabilities

Are you willing to support this work?

Yes, I can take an active role in leading/planning/writing docs.

Depends on

No response

@captainbrosset captainbrosset added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. proposal Auto label for new proposals added via the suggestion form labels Dec 8, 2022
@Rumyra Rumyra changed the title Revamp the Progressive Web Apps documentation [PROJECT] Revamp the Progressive Web Apps documentation Dec 19, 2022
@Rumyra Rumyra added p1 We will address this soon and will provide capacity from our team for it in the next few releases. project project issues involves: Content Requires the attention of the Content team. Content: Web API and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Dec 19, 2022
@captainbrosset
Copy link
Author

As part of this project, we might want to also focus on improving the storage docs too: mdn/content#23557
PWA and storage are not strictly related, you can store data without your site being a PWA, but they're often used together. Something to think about at least.

@wbamberg
Copy link

wbamberg commented Feb 12, 2023

I've been thinking about this with the Divio docs system in mind. We don't often use this system on MDN because 80-90% of our stuff is reference, but it is a very useful model for thinking about doc structure, and is applicable in this case. The site explains it well, but to summarise, it says that docs can be divided into four parts:

  • Tutorials: practical lessons that take the learner step by step through the process of building something
  • How to: guides that each explain how to achieve a specific thing
  • Reference: docs that describe the technical machinery of the thing
  • Explanation: guides which focus on developing and deepening understanding of the system.

We don't always have to have all these components, but it's a useful tool to consider which parts we do want, to be conscious about which ones we exclude, and to understand which of the docs we're creating fall into which category. The system also suggests that it's a good idea to avoid docs that blur categories - so for example reference docs should not go deeply into concepts. For example, I think it's a weakness in our docs that pages like https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers mix tutorial and explanation. With tutorials people just want to see results.

So in that context, we might think:

  • Tutorial would be our step-by-step guide to building a PWA.
  • How to could include topics like Define icons and a theme color. But there would be work here to figure out which guides we might want here.
  • Explanation could include guides like:
    • what is a PWA (on "what is a PWA", I thought some of the Google docs were confusing because they listed things that I would have thought are just basic requirements of any web app/website (or any software at all really), like performance or accessibility (https://web.dev/learn/pwa/getting-started/#pwa-checklist). This doesn't help me understand what is distinctive about PWAs.)
    • what's the benefit to writing a PWA (versus "normal site"/ versus native app)
    • attributes of PWAs:
      • working offline
      • integrating with the OS
      • running in the background
    • common PWA tech
  • Reference should be just a list of links to reference docs elsewhere on MDN, such as:
    • Web Manifest
    • Service workers
    • Notifications API
    • Push API
    • Background Sync API
    • Background Fetch API
    • ...

Like I say we don't need everything here, this is just a framework.

I had a bit of a look through your list of actions, and here are a few notes.

Related: update the app structure article. It's the second one right after the introduction but goes into a complicated description of SSR vs. CSR vs. Streams. If we're trying to get new people to try PWA, this seems likely to confuse them more than it would help them.

Yes, agreed. This seems partly like a consequence of these docs blurring "tutorial" and "explanation".

Fix the sidebar article order to match the order of articles in the tutorial.

I expect that for now we would need a dedicated PWA sidebar. The current sidebar here is a generic one that lists pages in alphabetical order, while of course the tutorial is curated order.

Figure out whether the "tutorial" (i.e. the set of pages that are linked together with previous/next buttons) needs to be a tutorial. Isn't the sidebar, complemented by well-crafted "see also" sections a better way to navigate?

If we want this tutorial to be "building a PWA step-by-step" then next/previous is helpful to emphasise that this is a strongly linked set of pages. It's also pretty common practice in MDN to do this (see also Learn, and tutorials like https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial).

The intro/benefits page should probably be the landing page instead of the current long list of links.

I'm not sure about this. I think a landing page that shows the scope and organization of the documentation is helpful. It can have a short intro but should mostly be about providing an overview of the docs. I do think it could provide more context than it currently does (for example, explaining which part is a walkthrough of writing a PWA), or it isn't adding any benefit over a sidebar.

Mention the main PWA benefit in the list of advantages: that PWAs can target all devices from a single codebase, which is often more cost-effective than device-specific codebases.

This makes me think we have 2 audiences here: native app developers and web developers, and the story about benefits is different for each. I mean, if I'm right, the "single codebase" benefit is for people coming from a native app world, right? So I think it might be worth being explicit about these two audiences.

Add more "best practice" pages, on top of the performance one, for example about using native-like features such as sharing, badging, shortcuts, protocol handling, background sync, etc.).

A couple of thoughts here. First, the performance page is (again) a mix of doc types. It's primarily part of our "step by step build a PWA" tutorial but includes, again, conceptual stuff on performance. I wonder how much of the conceptual stuff is better covered in general performance docs as it doesn't seem PWA-specific?

Second, perhaps the things you have listed here would be good how to topics?

Review the js13kGames 2017 source code, and update it to be current and correct, if needed.

Yes, definitely!

@estelle
Copy link
Member

estelle commented Feb 13, 2023

@captainbrosset
Copy link
Author

captainbrosset commented Feb 13, 2023

Will, Estelle, and I met today and discussed about this project, here are some notes, on top of what Estelle already mentioned above:

Sidebar

The PWA docs right now use a generic sidebar.
It's nice because you don't need to create your own one, but it's just alpha ordered right now.
Let's create our own custom sidebar for PWA.

Tutorial

Idea to create 3 little apps for the tutorials:

  1. very simple, just one page, just to know how to create an app and make it installable.
  2. actual app, but no bells and whistles.
  3. use actual pwa features.

Installation docs

Regarding the user documentation about installing PWAs: we should mention this, but it's different in each browser, so perhaps we should link to each vendor's docs.

Ref docs

We should make sure all reference docs are already on MDN. There are 3 missing manifest members, but there may be other missing things too. Updating the list of tasks based on this.

It would be good to also write a reference page that gives links to all reference pages for PWA. Like a cheatsheet.

Table of content

We agreed to start by taking a stab at a new ToC, using the Divio approach mentioned by Will above.

Tutorials: super practical, not conceptual. I want to do this thing, here's how.
How Tos: Sort of like tutorials, but without writing code.
Reference docs: just the API, inputs, outputs.
Explanations: conceptual docs.

@wbamberg
Copy link

wbamberg commented Mar 4, 2023

PWA sidebar -> mdn/yari#8238

@captainbrosset
Copy link
Author

Thanks @Josh-Cena. The first and third issues in your list are now closed. Thanks for raising awareness about these.
The second one is something we should try to get to at some point too. I don't think we will do so during the scope of this project, but at some point we should.

@captainbrosset
Copy link
Author

Because mdn/yari#9192 landed, this project is officially complete!
We didn't get to everything but enough that the PWA docs are now very useful, and in a state where it's easy to keep adding new guides and how-to articles.
Let me officially close this issue so we can celebrate 😀

@bsmth bsmth added this to the 2023 Q3 milestone Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: Web API involves: Content Requires the attention of the Content team. p1 We will address this soon and will provide capacity from our team for it in the next few releases. project project issues proposal Auto label for new proposals added via the suggestion form
Projects
Status: In progress
Development

No branches or pull requests

7 participants