Allow developers to construct a URL string from a URLPattern object and a set of provided values for the pattern's parameters. This functionality addresses the need for reverse routing or URL construction, complementing the existing test() and exec() methods that focus on URL matching and parsing.
Currently, URLPattern primarily focuses on matching URLs against patterns and extracting information from matched URLs using methods like test() and exec(). There is no standard way to take a URLPattern object (like /user/:id) and a set of values (like id=123) and generate the corresponding URL or component string that matches that pattern (like /user/123). The proposed generate() method aims to fill this gap. There are long-standing needs for this feature in https://github.com/whatwg/urlpattern/issues/73. See the explainer for details: https://github.com/explainers-by-googlers/urlpattern-generate
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
No milestones specified