awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.75k stars 342 forks source link

Make URL and URLSearchParams more compliant with WHATWG URL specification #437

Open stephencroberts opened 6 days ago

stephencroberts commented 6 days ago

In trying to use the URL module, I quickly found that it's not compliant with the URL standard for many normal use-cases. The first issue I came across was with the handling of the # for hashes (fragments) in both getting and setting the hash, so I decided to set up the web-platform-tests for url as part of the LLRT unit test suite which uncovered a host of other issues for common web use-cases. I have a fork of LLRT that I'm using, and I've updated URL and URLSearchParams to pass a vast majority of the tests (the rest need to be fixed in the Url crate). Are you open to a Pull Request?

Sytten commented 3 days ago

I also created another variant of URLSearchParams here for reference https://github.com/DelSkayn/rquickjs/blob/bf699539bab3caacc23cadb3abbde9f1ae95160f/util/src/url_search_params.rs