api-diff icon indicating copy to clipboard operation
api-diff copied to clipboard

Optionally compare by Clojure dialect

Open lread opened this issue 4 years ago • 1 comments

Proposal Some libraries expose a different API for different dialects of Clojure. It could be interesting to allow comparison of API by Clojure dialect.

Vested interest examples:

  • How does the rewrite-clj v1 API differ for clj and cljs?
  • How does rewrite-cljs API differ from rewrite-clj v1 cljs API?
  • How does the rewrite-clj v0 API differ from rewrite-clj v1 clj API?

Some other details I did support such a feature in lread/diff-apis, but my implementation is, IMHO, unnecessarily complex, and I'd like to migrate to this project, if I can.

Implementation ideas We already have :path1 :path2 and :v1 and v2. I suppose we could add :lang1 :lang2?

For same lib comparison :v1 and :v2 (or :path1 and :path2) could specify the same target:

clj -M:api-diff :lib rewrite-clj/rewrite-clj :v1 1.0.699-alpha :v2 1.0.699-alpha :lang1 cljs :lang2 clj

Compare rewrite-cljs to rewrite-clj v1:

clj -M:api-diff :path1 <path to rewrite-cljs jar> :path2 <path to rewrite-clj jar> :lang1 cljs :lang2 cljs

(I suppose we could introduce :lib1 and :lib2 but I won't scope creep that in for this issue).

Compare rewrite-clj v0 to rewrite-clj v1:

clj -M:api-diff rewrite-clj/rewrite-clj :v1 0.6.1 :v2 1.0.699-alpha :lang1 clj :lang2 clj

Next steps I could take a stab at this, if this idea makes sense and is of interest.

lread avatar Oct 12 '21 16:10 lread

Seems good to me!

borkdude avatar Oct 12 '21 20:10 borkdude