fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
2021-02-11T09:02:09.334900Z

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!!!

💯 5
❤️ 4
Helins 2021-02-11T10:00:52.335700Z

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

borkdude 2021-02-11T10:04:10.337100Z

@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.

Helins 2021-02-11T10:22:15.339900Z

@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

borkdude 2021-02-11T10:23:07.340300Z

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

👍 1
😁 1
tvaughan 2021-02-11T10:55:07.341600Z

I haven’t done any work on this

Jakub Holý 2021-02-11T11:01:58.342400Z

You might not believe it but https://cljdoc.org/d/com.fulcrologic/fulcro/ Enjoy!

🎉 10
Helins 2021-02-11T11:05:47.342800Z

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

🙏 1
martinklepsch 2021-02-11T12:23:25.343800Z

Great work @holyjak! 👏

martinklepsch 2021-02-11T12:24:03.344Z

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)

❤️ 1
avocade 2021-02-11T15:25:10.351900Z

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 😂)

Helins 2021-02-11T16:28:37.356600Z

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?

😻 1
Helins 2021-02-12T08:02:18.376300Z

@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?

tvaughan 2021-02-12T10:57:52.376600Z

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

borkdude 2021-02-11T16:32:15.358300Z

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.

tony.kay 2021-02-11T17:32:42.359Z

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

tony.kay 2021-02-11T17:33:39.359200Z

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

borkdude 2021-02-11T17:34:09.359400Z

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

tony.kay 2021-02-11T17:34:20.359600Z

Something change in cljdoc to support the cljs ecosystem better?

tvaughan 2021-02-11T17:45:55.359900Z

This is working for me @adam678 Thanks!

tvaughan 2021-02-11T17:53:00.360100Z

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

tvaughan 2021-02-11T17:54:23.360300Z

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

borkdude 2021-02-11T17:55:09.360600Z

@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.

borkdude 2021-02-11T17:55:25.360800Z

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

borkdude 2021-02-11T17:55:48.361Z

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

👍 1
Jakub Holý 2021-02-11T19:16:36.361300Z

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

👍 1
2021-02-11T19:34:47.362700Z

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

🎉 5
stuartrexking 2021-02-11T23:39:29.364Z

@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