Cloudflare has announced the implementation of the URLPattern API code for reading URLs into the Ada URL project, which serves as the source of implementation for NodeJs project. This API now works seamlessly on both NodeJS and Cloudflare Worker.
The URLPattern API is part of the ECMA Standard 55 suite, which aims to standardize various APIs to work seamlessly on server-side platforms such as NodeJS, Deno, and Cloudflare Worker. This suite does not interfere with APIs already in use in browsers (which are already standardized). Currently, there are many other APIs striving to standardize compatibility.
While reading URLs may not be a complex task, many may write regular expressions to extract values manually. However, achieving full cross-platform compatibility in implementation is challenging. In the case of URLPattern, Cloudflare found that if a host name contains disallowed characters, such as “#”, sometimes it reads quietly, while other platforms immediately throw an error. Despite focusing on server-side standards, Cloudflare aims to synchronize URLs accordingly.
Source – Cloudflare
TLDR: Cloudflare has updated the URLPattern API for NodeJS and Cloudflare Worker, ensuring compatibility and consistency across platforms.
Leave a Comment