xfbs / diff.rs

Web application to render a diff between Rust crate versions. Implemented in Yew, runs fully in the browser as WebAssembly.
https://diff.rs
MIT License
86 stars 6 forks source link

Support diffing across crates #16

Open epage opened 1 year ago

epage commented 1 year ago

Someone pointed out a fork of clap called palc and I wanted to diff it against clap to see if anything changed, whether for good or ill intent.

I could do this myself but I thought it might be useful to support this more generally in diff.rs

xfbs commented 1 year ago

Hey Ed,

that's a really interesting idea, I had not thought of that usecase before. I think that makes a lot of sense actually, I've come across a lot of forks of crates on crates.io. Sometimes they are just patching something or adding new functionality, but they could also be malicious or namesquatting.

I think this would be very trivial to implement per se, although the UI would possibly have to change a bit. From the diffing perspective, we could add a route such as:

/crate_a/version_a/crate_b/version_b/filename

From the diffing logic's perspective, it doesn't really care if the CrateSources come from the same crate, so this would be fine.

We would however need to tweak the UI so that you can enter multiple crate names. Should not be too hard.

I could probably draft something up on the weekend and create a pull request with a screenshot.

Thank you for coming up with this idea!

xfbs commented 5 months ago

I'm going to work on this today. My idea is to change the routing so that you can do:

diff.rs/crate_a/0.1.0/crate_b/0.1.0

I'm not sure I'll get around to putting in a proper UI for this (although it should not be too hard).