-
Notifications
You must be signed in to change notification settings - Fork 123
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
Move model into a separate rspotify-model crate #191
Conversation
I like the idea. Other libraries are much more modular than But shouldn't we use workspaces rather than a crate in |
Yeah. Just making the change as small as possible right now. Setting up a workspace would mean moving rspotify proper into its own directory which I'm open to doing once this has gotten a green light. |
Sounds good to me, we just need to know @ramsayleung's opinion. We could move some parts of the code into crates, like the HTTP client as The only part I can see getting worse is the documentation. We would have to add a link to Also, if you want to fix the CI you should merge with master. |
With the
Will do, thanks! |
Oh that is great, thanks. We have some models that are supposedly private (those with Also, you answered just after I edited my comment, I think you missed this:
|
Sure. I already have a client that is integrated into the project https://github.com/udoprog/OxidizeBot/blob/main/bot/src/api/spotify/mod.rs. It uses an 17 month old copy of the models provided in rspotify. |
Oh ok that makes sense. Why not just use |
It's a good idea to seperate rspotify-model :) I agree with Mario's point:
Or we could refactor the HTTP client into Since the architecture of We could seperate
or
How about this idea? |
As indicated earlier I don't have anything against doing the move as long as thing change is approved. But since I won't be using either the client, auth, or http components I'm not best suited for moving the other crates. I also don't know if there is an expressed need for breaking things up further, but this is of course up for you to decide. I can try and introduce a workspace and do |
Don't worry, we were just discussing I don't see that many problems by introducing workspaces. It should be as easy as a rename, adding cargo files, and perhaps changing the CI a bit, and we can help you with that. These things shouldn't conflict with the rest of the PRs. We should merge #166 and #189 before this, but I still don't think we'll have that many conflicts. As to #176 and #178, I will probably take them into account with the OAuth rewrite and copy parts of them, but I don't think they should be merged now. |
Any progress on this, @udoprog? |
No. Anyone else interested in doing the split can feel free to! |
Sure, I'll give it a try this weekend if I have time. |
Are you guys working on split this crate into workspace? If not, I could take time to do that :) |
Hi! Yes, I tried it two weeks ago, but failed to, in this branch https://github.com/ramsayleung/rspotify/tree/separate-crates. I split up the library into So we should only have I was going to try to do that but I didn't end up having enough time. You can give it a try if you want, as the branch is still there and you can make a new one based on Another thing to take into account is that the GitHub Actions workflows should be modified, because the features are now for the specific crates, and I was implementing the whole thing inspired on how https://github.com/bevyengine/bevy does it, which I really like in terms of how it's structured. You can take a look as well for your attempt if you like. Sorry about that! |
Since you are working on separating this library into individual crates, we could wait util #173 is merged :) |
This has been superseded by #199, so closing the PR. |
Description
This extracts the models used into a separate crate, so they can be used separately from the client implementation.
Motivation and Context
I have a separate client which is not suitable for general use that does not need the client bits, but could benefit greatly from the models.
Type of change
Please delete options that are not relevant.
This also requires that the next release of
rspotify
releases therspotify-model
crate. The separated crate is being re-exported with the same API as before. A few models have been modified from beingpub(in crate)
to just bepub
.How Has This Been Tested?
Just built for now. I don't have the necessary plumbing to run the integration tests, so we'll see if they pass through Github Actions.