karelkryda / universal-speedtest

The Universal Speedtest library allows you to measure the speed of your internet connection using Ookla speedtest.
https://www.npmjs.com/package/universal-speedtest
GNU General Public License v3.0
15 stars 5 forks source link

Update convert-units NPM #26

Open manipandi opened 9 months ago

manipandi commented 9 months ago

Describe the bug Since we have a dependency on the convert-units NPM they made the new release last week. it has breaking changes.

To Reproduce Install NPM and try to use the method its throwing error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

karelkryda commented 9 months ago

Hello, thanks for the report. I once created a version of Universal Speedtest 3.0.0, the primary goal of which was to try to solve a usability problem with this library in React Native, for example. Unfortunately, I was unable to resolve this issue and so version 3.0.0 was never officially released. I am aware that the last version was released quite a long time ago and it would be a good time to modernize the library.

If you agree, I would try to upgrade the library over version 3.0.0, which you could then test from the build branch here on GitHub. A significant change was the use of Date.now() instead of performance.now() just because of React Native, but I'm considering whether to revert this change - or check if this incompatibility would disappear with a newer version of the urllib library (perf-hooks are in fact used in urllib and therefore I was not able to solve the problem from my side).

Let me know if you would be interested in doing it this way.

karelkryda commented 9 months ago

I just noticed that in version 3.0.0 I started using the convert library instead of convert-units. In theory, you could test the version right from the build branch. However, I have the impression that there are changes in method names, but you could certainly figure that out without the modified documentation.

manipandi commented 8 months ago

Hi Thanks for replying and for the suggestions we will try to experiment with the build changes.

karelkryda commented 8 months ago

I understand, I am currently considering changing how the tests work. Now I use the urllib library to test using http, but this method is obsolete according to Ookla and I should use websockets.

With this change, I would be able to allow the library to be used in perf_hooks-free environments and hopefully provide greater test accuracy. However, I am currently exploring the possibilities.

I also plan to publish a multipackage for both cjs and ems types.

karelkryda commented 1 month ago

Hello @manipandi, I just released the release candidate of version 3.0.0. You can install and test the library using:

npm install --save universal-speedtest@next

The new documentation can be found here: https://karel-kryda.gitbook.io/universal-speedtest/v/3

I hope everything will work as expected 😉.