mqttjs / MQTT.js

The MQTT client for Node.js and the browser
Other
8.55k stars 1.41k forks source link

fix: replace deprecated `url.parse` with `new URL` #1927

Open Steve-Mcl opened 1 month ago

Steve-Mcl commented 1 month ago

closes #1569

Alters internal processing of connection URL. Removes url.parse and uses new URL

This is done in a backwards compatible manor however I would recommend updating all types and function signatures to use the the URL object instead of a string (or as well as) but that may be more suited to a major bump.

NOTE: there are some TODOs in the code that need to be understood (and removed).

Steve-Mcl commented 1 month ago

@robertsLando is there something I need to do to permit tests to run?

robertsLando commented 1 month ago

@Steve-Mcl sorry I was on vacation till yesterday. I have to approve your PR in order to allow test to run, done now. I will also do a quick review

robertsLando commented 1 month ago

I know there have been another try to do this in the past: https://github.com/mqttjs/MQTT.js/pull/1147 then reverted https://github.com/mqttjs/MQTT.js/pull/1217

Problem is that it has been reverted as it caused many compatibility issues. We need to track all possible issues related to this change as I'm pretty sure I will get lot of reports if/when I merge this