News for hackers. Stuff that matters.

DiffLens: Language Aware Diffs on GitHub Pull Requests

Hi HN! We were frustrated with text diffs on GitHub PRs, so we made DiffLens (https://github.com/marketplace/difflens) to produce language aware diffs on PRs. DiffLens constructs an Abstract Syntax Tree for each file, and uses that semantic information to intelligently diff changes. Checkout the demo on our website (https://www.difflensapp.com/difflensDemo2_849ca26f9ee09faa084cbdcdc90b6f90f8ce8495). If you review code, especially TypeScript, JavaScript or CSS, give DiffLens a try, it's free!

We're looking for feedback from developers. If you share our frustrations with reviewing code changes, we'd love to talk to you. Most developers already have a favourite diff tool installed locally but there exists very little for reviewing code changes online, so we worked on DiffLens slowly over a number of years. We use it to review our own code changes, and we love it. We'd really appreciate thoughts and insights about the idea and its execution from developers and will answer any questions that come up. Thanks for reading!

( 4 comments | 10 points | on HN )
Re:DiffLens: Language Aware Diffs on GitHub Pull Requests by gus_massa on Wednesday June 08, 2022 @01:42PM (#31671179)
Please change the title to something like "DiffLens: Language Aware Diffs on GitHub Pull Requests". It's fine to post your stuff here, but it's better that it's clear that it's a post and not a question.

About the project: It was difficult to understand what it is doing looking at the 3 screenshots in the page. After a few hops I reached the demo https://www.difflensapp.com/difflensDemo2_849ca26f9ee09faa08... that is easier to understand.

Re:DiffLens: Language Aware Diffs on GitHub Pull Requests by difflens on Wednesday June 08, 2022 @01:52PM (#31671356)
Done. Thanks for the feedback about the screenshots. That makes sense! I'll update the text to include the demo :) Let me know if you have thoughts on the app itself!
Re:DiffLens: Language Aware Diffs on GitHub Pull Requests by jshawl on Thursday June 09, 2022 @08:45AM (#31680523)
I was curious about trying out my own diff so I went to the home page: https://www.difflensapp.com/ and didn't see an option.

It would be interesting to be able to append a github compare / pr / tree-ish link to see the diff via difflens, so maybe something like:

https://www.difflensapp.com/github.com/rails/rails/commit/7d...

would render that diff via diff lens. just an idea to get more people testing.

Re:DiffLens: Language Aware Diffs on GitHub Pull Requests by difflens on Thursday June 09, 2022 @01:56PM (#31684534)
Ah yea we had the same thought a while back so, yes, that's in the works :) The biggest drawback here is that there are rate limits to the GitHub API. It should work for just trying out some diffs though. Thanks for the feedback!