Fork me on GitHub
#fulcro
<
2021-02-11
>
andre.richards09:02:09

Just a quick thank you to @tony.kay and everybody that contributed to Fulcro. I have been working through the Fulcro and Fulcro-RAD documents, and playing with Fulcro-RAD together with Datomic. My mind is blown! It is a truly remarkable piece of design and engineering. Thank you!!!

💯 19
❤️ 15
Adam Helins10:02:52

Has someone written a Clj-Kondo hook for defmutation by any chance?

borkdude10:02:10

@adam678 I'm glossing over the syntax and it seems similar to defn? So you can use {:lint-as {.../defmutation clojure.core/defn}} perhaps. Feel free to contribute config here: https://github.com/clj-kondo/config/blob/master/resources/clj-kondo.exports/clj-kondo/fulcro/config.edn This config can also live in fulcro itself if the author is willing to receive a PR, so you will get it (almost) automatically when linting the classpath.

Adam Helins10:02:15

@borkdude Almost but I believe a hook is needed:

(defmutation foo [_]
  (action [env] ...))
It accepts forms such as action which should be rewritten as fn in the hook (I guess that should do the trick). I can do it but wanted to be sure it wasn't done before. All I found is this mention: @tvaughan https://clojurians-log.clojureverse.org/clj-kondo/2020-12-08

borkdude10:02:07

Yeah, it's been mentioned a couple of times, but so far I have seen no real PR coming in ;)

👍 4
😁 4
tvaughan10:02:07

I haven’t done any work on this

Adam Helins11:02:47

Wow, this is a big deal actually! If you did it, then congrats to you

🙏 4
martinklepsch12:02:03

For those on Mac I can also recommend https://kapeli.com/dash to access API documentation with a global shortcut (for ~any library on Clojars)

❤️ 4
tony.kay17:02:20

Something change in cljdoc to support the cljs ecosystem better?

Jakub Holý (HolyJak)19:02:36

I've implemented a fix for Cljdoc to be able to deal with unknown tag literals such as #js

👍 3
tony.kay00:02:39

Nice. Good work man!

❤️ 3
avocade15:02:10

Hey, we're trying to use wrap-form-element with the react-select dropdown (https://react-select.com), but we have an issue with it losing focus when we have selected a new value. This behavior does not appear if we use the straight createElement fn instead, then it keeps the focus after having selected a value. (But if we use createElement instead, we get another issue where we're not being able to directly set a new value on the select. We've tried using :value, :defaultValue, :inputValue, :selectOption, but nothing actually switches the selected option after it's been mounted even if the props change. So we're a bit stuck 😂)

tony.kay17:02:39

Try a non-wrapped (create-element) and a sync transact!!

Adam Helins16:02:37

This Clj-Kondo hook for defmutation seems to work https://gist.github.com/helins-io/52d03847157b0dc95c6987844a74dd68 I'll use it a bit in a real project before PR'ing it to @borkdude. @tony.kay In the longer term, would you consider a PR adding support for Clj-Kondo?

😻 4
tony.kay17:02:42

Certainly not opposed…I think someone else was asking that as well..have not seen anything

borkdude17:02:09

If you need help with this, just ping me either here or in #clj-kondo

tvaughan17:02:55

This is working for me @adam678 Thanks!

tvaughan17:02:00

Oops. Spoke too soon. I see that some functions within defmutation are reported as unused. For example, I refer transact! and use it in ok-action. clj-kondo reports transact! as unused

tvaughan17:02:23

I added {:analyze-call {com.fulcrologic.fulcro.mutations/defmutation fulcro.hooks/defmutation}} under :hooks in config.edn, fyi

borkdude17:02:09

@adam678 I suggest you PR the config to the clj-kondo/config and let's iterate on that for a while. When we are mostly happy, we can migrate this to fulcro proper.

borkdude17:02:25

It doesn't have to be perfect the 1st time in the clj-kondo/config repo

borkdude17:02:48

and then we don't have to bother Tony too much with this :)

👍 3
Adam Helins08:02:18

@tvaughan Indeed I noticed some false positives regarding unused vars. I wrote a second version yesterday and they are gone. Have you been using that latest version?

tvaughan10:02:52

Just tried the new version. This seems to do the trick. Nice work @adam678!

borkdude16:02:15

FYI, adding "support" means adding a directory resources/clj-kondo.exports which contains the relevant config + optional hook code for clj-kondo. As an example: https://github.com/wilkerlucio/pathom/blob/master/resources/clj-kondo.exports/com.wsscode/pathom/config.edn Clj-kondo will find this automatically on the classpath when you lint the library in question and then will suggest to the user to include it.

alex-eberts19:02:47

Hi everyone - I just published a beginner-level EQL tutorial to the fulcro-community guides. Corrections and feedback welcome! https://github.com/fulcro-community/guides/blob/main/tutorials/eql-pathom-overview.org

🎉 17
stuartrexking23:02:29

@tony.kay I asked this question https://clojurians.slack.com/archives/C0744GXCJ/p1613082907119400 and couldn’t get an answer. How do you kill and paste like you do here? https://youtu.be/3dZK5seIaVI?t=1238