XAMPPRocky / octocrab

A modern, extensible GitHub API Client for Rust.
Other
1.02k stars 253 forks source link

Feat: split out octocrab models into a separate crate #627

Open jkelleyrtp opened 2 months ago

jkelleyrtp commented 2 months ago

This PR splits out the octocrab models into its own crate. The intention here is specifically to work around the issues with jsonwebtoken not working in wasm for the usecases where some data has been cached and is being loaded in an environment where it doesn't make sense to request against the github api.

Note that if you accept this PR you'll also need to release the crate, and this will start to add burden up you as a maintainer.

I also opted for a very simple workspace setup. It might make more sense to do a proper workspace.

As an alternative, I could just disable all the hyper/bytes stuff, but that seemed like a much more complicated change than just pulling out the types into their own crate.

Anyways, I'd like to follow this PR up with a new PR that removes feature-flags out the auth stuff to get this crate compiling on regular wasm. Longer term of course, somehow fix the upstream jsonwebtoken crate or patch over it in a way that lets us do more complex auth in the browser. That being said, I think CORS might get in the way for web auth, so the non-auth cases are easy to support.