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

Scope extensions explainer: consider using URLPattern syntax for include and exclude paths #32

Open
LuHuangMSFT opened this issue Aug 26, 2021 · 4 comments
Labels
scope-extensions https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md

Comments

@LuHuangMSFT
Copy link
Collaborator

See: https://github.com/WICG/urlpattern/blob/main/mdn-drafts/QUICK-REFERENCE.md
URLPattern allows per-path-element pattern matching and other useful syntax.

@alancutter alancutter added the scope-extensions https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md label Aug 27, 2021
@kenchris
Copy link

kenchris commented Oct 1, 2021

@wanderview fyi

@LuHuangMSFT
Copy link
Collaborator Author

Discussions with @alancutter and @wanderview identified these concerns:

  1. Performance of URLPattern matching on different platforms. Computation requirement could make this usage impractical on some platforms. One approach here is to use a subset of the URLPattern syntax in exchange for better performance characteristics.
  2. OS integration in the future - using a more complicated syntax to define scope could make it difficult or impossible translate that scope to OS-specific APIs (such as the ones for registering protocol or link handling).

I expect that that finding a well-rounded solution to these problems will take some time. We will structure scope_extension JSON format to accept improvements in the future.

@wanderview
Copy link

Hmm, I don't recall discussing performance concerns. What I've measured so far is in the single digit microseconds in the lab, so I wouldn't expect a huge performance impact.

The OS integration issue I believe was regarding android intent integration which would have difficulty completely matching full URLPattern features. I thought, however, @alancutter was of the opinion we should not target the lowest common denominator.

Anyway, just wanted to clarify my position.

@alancutter
Copy link
Collaborator

We should not target only the lowest common denominator but we should allow for it to be catered to by sites.
I would like to see a pattern akin to display_override where multiple entries can be specified and the user agent will pick the first that it can support.

Sketch:

{
  paths: [{
    mode: 'pattern',
    include_patterns: [ ... ],
    exclude_patterns: [ ... ],
  }, {
    mode: 'path',
    include_paths: [ ... ],
    exclude_paths: [ ... ],
  }, {
    mode: 'path',
    include_path: [ ... ],
    // Some platforms don't support path exclusion.
  }],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-extensions https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md
Projects
None yet
Development

No branches or pull requests

4 participants