Contact [email protected] Explainerhttps://github.com/WICG/urlpattern/blob/master/explainer.md
Specificationhttps://wicg.github.io/urlpattern/ Summary URLPattern is a new web API that provides native support for matching URLs given a pattern string. It is designed to be usable both in javascript directly and by passing patterns to other web platform APIs; e.g. as a service worker scope. Blink componentBlink <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink> TAG reviewhttps://github.com/w3ctag/design-reviews/issues/417 TAG review statusIssues addressed Risks Interoperability and Compatibility This API has minimal interop and compat risk. It can easily be feature detected and a polyfill is available at: https://www.npmjs.com/package/urlpattern-polyfill Gecko: No signal (https://github.com/mozilla/standards-positions/issues/566 <https://chromestatus.com/admin/features/launch/5731920199548928/5?intent=1> ) WebKit: No signal ( https://lists.webkit.org/pipermail/webkit-dev/2021-August/031942.html) Web developers: Positive ( https://github.com/WICG/urlpattern/blob/main/dev-trials-feedack.md) Ergonomics The URLPattern API will often be used with the URL API. To make this more natural we have tried to match URL behavior and API shape wherever possible. URLPattern is also similar in nature to RegExp and we have attempted to match its API shape as well; e.g. providing `test()` and `exec()` methods. In regard to the ergonomics of the pattern syntax itself, we have adopted the syntax from the popular javascript library path-to-regexp. Our hope is that using a popular syntax will result in the web API being more natural for developers to use. Activation The URLPattern API is easily feature detected and a polyfill is availabe at: https://www.npmjs.com/package/urlpattern-polyfill Security The main security risks involve the addition of a new parser in the platform. Since parsers are common attack vectors it does represent a risk. We mitigate this risk by requiring that URLPattern strings must be parsed in the sandboxed renderer. In addition, we are actively fuzzing the parser. Debuggability Currently URLPattern does not have any special integration with devtools. The summary view of the URLPattern object is already useful for inspecting what patterns it will use to match. Exceptions are used to report errors in constructing a URLPattern. In the future it may be useful to provide some kind of syntax highlighting or checking of URLPattern syntax. This seems challenging, though, as the values are passed as plain javascript strings and are not a javascript type like regular expressions. This could be an area for future exploration, though. Is this feature fully tested by web-platform-tests <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md> ?Yes DevTrial instructionshttps://github.com/WICG/urlpattern/blob/main/howto.md Flag nameabout://flags/#enable-experimental-web-platform-features Requires code in //chrome?False Tracking bughttps://bugs.chromium.org/p/chromium/issues/detail?id=1141510 Estimated milestones DevTrial on desktop 93 DevTrial on Webview 93 Link to entry on the Chrome Platform Status https://chromestatus.com/feature/5731920199548928 Links to previous Intent discussionsIntent to prototype: https://groups.google.com/a/chromium.org/d/msg/blink-dev/jBMvUEkyBq8/IwYIZmhEBQAJ Ready for Trial: https://groups.google.com/a/chromium.org/g/blink-dev/c/WitVII_BzyU/m/mI8lZY4NAgAJ This intent message was generated by Chrome Platform Status <https://www.chromestatus.com/>. -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK7rkMgCrO2VN09hUEvfwnMBLqRWzA1NVHk%3D-PBwPhtJ%2BVO3Ag%40mail.gmail.com.
