cljdoc

lread 2023-01-05T12:17:28.914779Z

I guess we should rotate our secrets for cljdoc @martinklepsch? https://circleci.com/blog/january-4-2023-security-alert/

mkvlr 2023-01-05T12:30:46.981459Z

@lee thank you! Think the main issue Clerk is running into is not everything on Clerk’s classpath can be analysed successfully. Wondering if a best-effort analysis is something you ever considered?

mkvlr 2023-01-05T12:32:12.350689Z

with clerk I have cljs files like https://github.com/nextjournal/clerk/blob/main/src/nextjournal/clerk/render.cljs on the classpath, the deps aren’t part of the regular classpath but only in an alias

mkvlr 2023-01-05T12:32:37.352819Z

but tagging the class as :no-doc also felt wrong to me which is where I stopped

lread 2023-01-05T12:33:49.249869Z

Ah that was what I was wondering. So that is part of your public API therefore :no-doc is not appropriate?

mkvlr 2023-01-05T12:34:28.541339Z

yeah, I ship them with the jar so folks can jump to definition and get docs for them

mkvlr 2023-01-05T12:34:46.763989Z

(though there’s still a lot of holes in the docs)

mkvlr 2023-01-05T12:36:01.003079Z

for debugging things locally running the cljdoc analyzer was good but felt a bit indirect to have to build a jar after every change, wondering if it could also be possible to make it work against a local dir maybe?

mkvlr 2023-01-05T12:36:34.314719Z

(sorry for this braindump, not trying to put this work onto you)

lread 2023-01-05T12:36:56.372089Z

Cljdoc learns about an API by actually loading nses. This allows it to discover load time generated vars (potemkin import-vars type stuff). But not every project needs this. Static analysis via clj-kondo would be suitable for most projects, I think. I would love to get around to implementing that as an option for cljdoc.

mkvlr 2023-01-05T12:38:14.446839Z

that sounds like a great strategy I’ve also employed to great success: outsourcing the work to the one and only @borkdude 🙃

lread 2023-01-05T12:38:55.274809Z

> for debugging things locally running the cljdoc analyzer was good but felt a bit indirect to have to build a jar after every change Yeah, can't disagree. Testing locally replicates production but is slow and awkwardish.

mkvlr 2023-01-05T12:39:42.114659Z

but seriously: would be a good fit for clerk for sure

lread 2023-01-05T12:40:46.189219Z

Yeah, @borkdude suggested this AGES ago. I've actually done quite a bit of looking into it. I wanted to get to a point where the APIs I am discovering are the same for dynamic vs static (except for load time generated vars). And was almost there I think.

mkvlr 2023-01-05T12:41:32.740009Z

yeah, doesn’t sound too bad

borkdude 2023-01-05T12:44:14.472659Z

@mkvlr @lee Since you have summoned me, here is a preview of what you can get out of clj-kondo analysis https://github.com/nextjournal/clerk/blob/api-md/API.md

lread 2023-01-05T12:44:42.955649Z

I think I might have got distracted by some other project. I was looking into when a ClojureScript API should include a Clojure macro... I think... https://github.com/cljdoc/cljdoc/issues/543... Anyway would love to get back to this.

borkdude 2023-01-05T12:44:49.453159Z

$ time bb quickdoc
bb quickdoc   0.07s  user 0.02s system 62% cpu 0.150 total

mkvlr 2023-01-05T12:47:08.563489Z

yeah seems to cover everything cljdoc needs? Except dynamically imported vars like @lee says but maybe that can be the opt-in case?

lread 2023-01-05T12:48:06.421209Z

Yep, I was thinking static would be the new default and the current dynamic would be an optin.

borkdude 2023-01-05T12:48:36.152399Z

tbh I don't see why we need a centralized service like cljdoc that needs devops, etc, if you can just dump an API.md in your repo ;)

lread 2023-01-05T12:49:07.182849Z

Yeah I think you lost patience for cljdoc a long time ago!

lread 2023-01-05T12:49:49.692239Z

I actually winced when you were summoned here.

mkvlr 2023-01-05T12:51:09.956219Z

agree that docs are most helpful in your editor, which is why I haven’t invested time into making cljdoc work, but it does come up at times so…

mkvlr 2023-01-05T12:52:09.609189Z

but yeah making the static analysis just work:tm: without needing to do anything special for cljdoc would ideal I think

lread 2023-01-05T12:52:26.893049Z

Yep, think so too.

borkdude 2023-01-05T12:53:20.598149Z

Not to disparage the work done on cljdoc, I appreciate it. A centralized database could be helpful in navigating the clojure ecosystem's dependencies etc.

lread 2023-01-05T12:54:33.390769Z

I have spent quite a bit of time on cljdoc, so I must see its value. Right? simple_smile I do like it for discovery of libs, consistent display of docs, search-ability.

borkdude 2023-01-05T12:54:54.810389Z

something that seq-find is doing with clj-kondo analysis could happen in cljdoc, much more like that could be done I think https://seqfind.com/repo-list-page?_rp_=WyJeICJd&

lread 2023-01-05T12:56:36.485629Z

Yeah, like the discontinued... what was it called?... that site where you could browse the Clojure source ecosystem.

borkdude 2023-01-05T12:56:43.174489Z

crossclj

lread 2023-01-05T12:56:49.591259Z

Right!

lread 2023-01-05T12:57:35.205359Z

That would be perhaps a pivot for cljdoc which is currently only concerned with public APIs.

lread 2023-01-05T12:57:52.898689Z

But I loved crossclj

borkdude 2023-01-05T12:57:58.256329Z

public API is good enough for starters

lread 2023-01-05T12:59:58.005439Z

Something to think about...

lread 2023-01-05T20:24:10.260209Z

The https://mobile.twitter.com/crossclojure which includes old screenshots. Gives a glimpse of its features. And apparently only cost $10/month in server costs.

borkdude 2023-01-05T20:26:13.231089Z

I think having as much of those things as static assets instead of having to run a server helps in driving those costs down and lowering maintenance. 4clojure was also taken down but https://4clojure.oxal.org/ won't likely ever go down (or can be easily hosted elsewhere since it's just a bunch of files)

lread 2023-01-05T20:59:09.767489Z

Hmmm... yeah. Worth thinking about that aspect too.

lread 2023-01-06T20:32:33.307969Z

https://github.com/phronmophobic/dewey is another project that is exploring this space (analyzing all Clojure sources).