Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reqwest dependency against ureq #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kijewski
Copy link
Contributor

This PR removes reqwest, and its transitive dependencies like tokio, and uses ureq instead. The latter library uses curl as HTTP client. libcurl should be installed by default on all current Windows and MacOS installations, and most likely by all serious Linux distros, too.

libcurl is only loaded at runtime instead of being a hard dependecy. This way, if libcurl is not installed, the program will still run just fine, but the self update will fail.

This changes makes the github example much smaller:

1808048 github.master
1127536 github.patch
-680512 bytes or -38%
$ size github.master github.patch
   text    data  bss      dec  filename
1738914   52288  529  1791731  github.master
1078768   31784  465  1111017  github.patch
-660146  -20504  -64  -680714

This PR removes `reqwest`, and its transitive dependencies like `tokio`,
and uses `ureq` instead. The latter library uses `curl` as HTTP client.
`libcurl` should be installed by default on all current Windows and
MacOS installations, and most likely by all serious Linux distros, too.

`libcurl` is only loaded at runtime instead of being a hard dependecy.
This way, if `libcurl` is not installed, the program will still run just
fine, but the self update will fail.

This changes makes the `github` example much smaller:

```text
1808048 github.master
1127536 github.patch
-680512 bytes or -38%
```

```text
$ size github.master github.patch
   text    data  bss      dec  filename
1738914   52288  529  1791731  github.master
1078768   31784  465  1111017  github.patch
-660146  -20504  -64  -680714
```
@CosminPerRam
Copy link

CosminPerRam commented Jan 10, 2024

bump, any updates regarding merging this?

@jaemk
Copy link
Owner

jaemk commented Jan 11, 2024

Can you make this a pair of features to enable either ureq or reqwest? If someone already has tokio in their dep tree, they may prefer using reqwest over depending on libcurl

@Kijewski
Copy link
Contributor Author

Can you make this a pair of features to enable either ureq or reqwest?

Yes, that would have been a good idea from the get-go. Will do, but I cannot tell you an ETA.

@CosminPerRam, if you are free, and you are interested, maybe you would like adopt the PR? No pressure if you decide later that you don't want to do the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants