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

Use URLPattern for scope member #1002

Open
dmurph opened this issue Sep 13, 2021 · 5 comments
Open

Use URLPattern for scope member #1002

dmurph opened this issue Sep 13, 2021 · 5 comments

Comments

@dmurph
Copy link
Collaborator

dmurph commented Sep 13, 2021

The new URLPattern feature would be a great match for the scope member in the manifest.

Does anyone need scope to be more expressive / flexible? Please put your use cases here :)

@wanderview
Copy link
Member

Note, one of the main use cases for making service worker scopes more flexible is to handle nested scope situations. Product 1 is at "example.com/" and Product 2 is at "example.com/foo/". The Product 1 team wanted to be able to restrict their scope to not automatically cover Product 2 in order to reduce the risk of breaking the other product.

My understanding is that installed PWAs don't support nested scopes. Is that true? Would it still be true if the scope member was improved to be more flexible?

@dmurph
Copy link
Collaborator Author

dmurph commented Sep 13, 2021

I believe that we would be able to support nested scopes if the scope member was improved to be more flexible - I think a more accurate statement would be "we don't support overlapping scopes", and URLPattern allows developers to be able to, say, have path nested scopes without the scopes overlapping.

@wanderview
Copy link
Member

Ah, ok. Although it may be difficult to tell if two URLPattern scopes are overlapping or not.

@LuHuangMSFT
Copy link

More cases that URLPattern could help with:

  1. Scope that comprises multiple non-overlapping paths
    • Eg.: scope = contoso.com/a + contoso.com/b
  2. Scope with wildcard path elements (eg. part of the URL path is a username that cannot be determined statically)
    • Eg.: scope = contoso.com/user/*/app
  3. Being able to exclude files/paths from a scope
    • Eg.: scope = contoso.com/ - contoso.com/about - contoso.com/contact

@jcayzac
Copy link
Member

jcayzac commented Sep 27, 2021

At Rakuten we would certainly like this feature. Our current super app has to complement scope with a set of extra urls and exclude patterns, for each PWA. Standardization in the web manifest would make things easier for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants