Technology Evaluation - URL parsing
In recent work within the community, many of us have moved away from using request-handling libraries in favor of the DataSource concept introduce in kettle. When interacting with REST APIs from Node, many of us have used the kettle.dataSource.URL grade, whose implementation is backed by the "http.request" method provided by Node itself. We have been working to create a browser equivalent of kettle.dataSource.URL. This requires us to find cross-environment alternatives for the node-specific approaches currently used.
One key point we discussed is URL parsing.
Long term, we need an approach that:
- Works in all browsers
- Works in node
- Provides all the information we need, and in the right format, to launch the underlying request mechanism
- Ideally, is based on a standard.
- Is compatible with our way of working:
- It should be possible to build a series of simple reusable components using the library.
- It should not require us to support additional technologies for either the code or tests.
The WhatWG URL Standard is a living standard that builds on earlier work, including that of the related W3C working group. It is actively maintained and there are implementations for both node and browsers.
Browserify and Node Modules
Libraries that Follow the WhatWG Spec
After searching Google and npm, I identified two libraries that provide WhatWG compliant URL parsing, and that at least at face value appear to work cross-environment.
The next step is to evaluate each of these.