Fork me on GitHub
#cljdoc
<
2020-12-03
>
Jakub Holý (HolyJak)20:12:32

Hi @martinklepsch! I have learned that #fulcro has experienced quite a few issues with Cljdoc such as 👇 I have browsed through the GH issues but do not see anything that would seem relevant, weirdly. Is for example this one a known issue? And are there some know limitations to cljs support? Thanks! (I love both Cljdoc and Fulcro so it would be great if they could work together.)

martinklepsch21:12:04

Thanks for checking in and yeah, definitely happy to help with this as much as I can. Could you point me to the source file for this? One issue I immediately think of is that if the file is a cljc file #js is basically invalid syntax

martinklepsch21:12:36

We could could probably add a data reader to support #js

martinklepsch21:12:40

Even if some files are invalid we don’t necessarily care about guaranteeing correctness or something like that

Jakub Holý (HolyJak)21:12:32

I think that was the point - yes, #js is invalid in clj, therefore there is added a custom reader to make it acceptable also in clj. The file and line: https://github.com/fulcrologic/fulcro/blob/4da887d934d8f9c8a225f3b972a375d634a18138/src/main/com/fulcrologic/fulcro/components.cljc#L845

martinklepsch22:12:54

I’d be open to do something like that for cljdoc 👍

martinklepsch22:12:01

Don’t have a pointer where that would be done from the top of my head but maybe @UE21H2HHD has a pointer :)

martinklepsch22:12:04

But maybe there’s also a way to properly pick up data_readers from analysed projects

Jakub Holý (HolyJak)07:12:28

How do you read in the code? E.g. the EDN reader (which you don't use) can be provided with a list of data readers. And you know where those are declared, in data_readers.clj[c] at the top of the classpath.

Jakub Holý (HolyJak)07:12:49

I don't know if it would be possible to have a fallback data reader that simply replaces everything unknown with nil, that would be I assume good enough for analyzing the code and simple. > Default reader tags are defined in https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/default-data-readers but may be overridden in data_readers.clj or by rebinding https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/%2Adata-readers%2A. If no data reader is found for a tag, the function bound in https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/%2Adefault-data-reader-fn%2A will be invoked with the tag and value to produce a value. If default-data-reader-fn is nil (the default), a RuntimeException will be thrown. so it should be possible

lread13:12:08

Interesting! If you folks don’t figure this out I’ll take a peek, but it might not be for a bit because I am trying to focus on rewrite-cljc at the moment.