Skip to content

breaking: Replace reqwest with ureq. - #200

Merged
milesj merged 3 commits into
develop-nextfrom
next-async
Aug 20, 2026
Merged

breaking: Replace reqwest with ureq.#200
milesj merged 3 commits into
develop-nextfrom
next-async

Conversation

@milesj

@milesj milesj commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Swaps reqwest for ureq behind the url feature. ureq is blocking, but it never builds a
runtime of its own, so loading a URL from inside an async runtime now blocks the calling thread
instead of panicking.

# reqwest::blocking, called from inside #[tokio::main]
thread 'main' panicked at tokio/src/runtime/blocking/shutdown.rs:51:21:
Cannot drop a runtime in a context where blocking is not allowed.

That panic is what an earlier async-loading experiment on this branch was working around. Switching
clients removes the need for it, so the loader stays entirely synchronous.

Fixes HTTPS for everyone downstream

reqwest was declared default-features = false with only blocking, which leaves it without a
TLS backend. The rustls feature was only present in dev-dependencies, so HTTPS worked in this
repository — where Cargo unifies the two — and nowhere else.

A standalone crate depending on schematic with features = ["config", "url"] fails on any HTTPS
request before this change and loads fine after it. Since is_secure_url rejects anything but HTTPS
outside of loopback, the feature was effectively unusable as published. ureq enables rustls by
default.

Behaviour changes

  • ConfigError::ReadUrlFailed now carries a ureq::Error rather than a reqwest::Error. Breaking
    for anyone matching on it.
  • A non-2xx response is now a ReadUrlFailed. reqwest returned Ok regardless of status, so a
    404 previously handed its error page to the parser and surfaced as a confusing parse error.

Dependencies

Net 47 fewer packages — the tokio, hyper, and h2 stack drops out, taking roughly 540 lines of
Cargo.lock with it.

Tests

Three added to url_sources_test: loading from inside an async runtime, which pins the property
this swap exists for; the 404 case; and the existing network-backed suite continues to pass
unchanged. tokio is a dev-dependency solely to drive the first one.

Also corrects a stray claim in the book that the url feature is enabled by default — it is not,
and never has been.

🤖 Generated with Claude Code

@milesj
milesj merged commit b7df3f8 into develop-next Aug 20, 2026
6 checks passed
@milesj
milesj deleted the next-async branch August 20, 2026 21:52
milesj added a commit that referenced this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant