Skip to content

Investigate gradual migration path of crux_http to http #357

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

Open
charypar opened this issue May 2, 2025 · 1 comment
Open

Investigate gradual migration path of crux_http to http #357

charypar opened this issue May 2, 2025 · 1 comment

Comments

@charypar
Copy link
Member

charypar commented May 2, 2025

The HTTP capability currently uses http-types, which does not look actively maintained, and probably isn't the first choice for common HTTP types today. We also rely on a custom fork to avoid compatibility issues with emscripten (see #195).

From a quick look, it may be possible to switch to http, but maintain backwards compatibilty with http-types temporarily under a feature flag. That way we wouldn't force people to migrate or stay behind. It's not easy to see whether this is possible and how hard it might be without trying, which is what this issue is about.

It is quite likely to make the code very annoying to read for the duration of maintaining both versions.

Sketch implementation:

  • introduce a http-types feature flag to crux_http
  • guard all uses of the types from the crate with a feature flag and...
  • switch to either an equivalent from http or to our own type if an equivalent doesn't exist (I think this is the case for the Body type, which is just a generic argument in http)

If this becomes far too messy, we will have to just bite the bullet and make people migrate the types as a step change, providing helpful conversion traits where we can, etc.

@charypar
Copy link
Member Author

charypar commented May 2, 2025

A few hours investigation suggests this should be reasonably possible, but will require a few days work.

I'll open a PR some time in the following days or weeks.

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

No branches or pull requests

1 participant