bevyengine / bevyengine/bevy

More modern or configurable HTTP client for bevy

Open
#22,476 1 comment 0 reactions 0 assignees View on GitHub
A-Assets C-Feature S-Needs-Design X-Contentious
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

I feel that ureq has some downsides for bevy, compared to something like reqwest.
(Note this is separate from "Should Bevy have async or sync IO?") I have no horse in that race and reqwest supports both)

I've run into a few issues with ureq since I started using the web assets feature:
1. Asset load performance is _significantly better_ in-browser than on native, because ureq only supports `HTTP/1.1`
2. Related, bandwidth is higher natively because ureq does not support zstd content-encoding

I think that #2 is pretty niche, while not supporting anything past HTTP 1.1 is a pretty big issue.
The author seems to suggest they intend for ureq to be used more as a client for service-to-service requests: https://github.com/algesten/ureq/issues/219#issuecomment-725903997 which is why they don't want to support HTTP/2-3 as it's mostly bulk-request client optimizations. That's fair, but Bevy's use case is that of a client app that makes many asset requests, not one and done.

I totally understand wanting to keep dependency size down, and I don't feel strongly about ureq being the default if it is possible for a user to somehow mod in a different downloader if they need HTTP client tech that has escaped the early 2000s 😄

Anyway, it works even if the performance is not ideal, but I do wince when I see tilemaps load instantly in the browser and... not that natively, despite the app running better overall on native as one would expect.
There are other ways this could be mitigated, of course, if I controlled the asset server. But I don't, and it was not built to handle the limitations of Bevy's cute little HTTP client; it was built for browsers.

## What solution would you like?
Either a more capable client by default.
Or the ability to somehow override the client Bevy uses.

## What alternative(s) have you considered?
I've tried requesting zstd support upstream, and HTTP/2 support had already been requested and rejected.

I see Ureq's maintainer's perspective; I don't think they are really trying to build an HTTP client for a _client_ app; they are trying to build one primarily for service-to-service with few deps, which it excels at.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating Bevy's web assets feature and its ureq-based HTTP client integration, then compare the options of a more capable default client and an overridable client; done would require a decided approach that addresses HTTP/2, compression, or configurability.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.