defunctzombie / node-url

node.js core url module as a module
MIT License
376 stars 96 forks source link

feat: replace the querystring package with the new URLSearchParams api #60

Closed bertyhell closed 2 years ago

bertyhell commented 2 years ago

During an npm install i got this message:

npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

I tried to replace it in this new API, and all tests in node still succeed, but I'm unsure if the supported browsers match with what this package supports.

https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams

On MDN the support for URLSearchParams seems to be quite good: image

https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#browser_compatibility

This should reduce the package size by about 16%

bertyhell commented 2 years ago

Ok, closing. For future reference, where can I find the list of supported browsers for this package?

ljharb commented 2 years ago

At the moment, you can infer it by looking at what's tested - https://github.com/defunctzombie/node-url/actions/runs/1554926464 is node 0.8, so it's at least "any ES5 browser", but in practice this includes IE 6-8 as well.