This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-19
Channels
- # bangalore-clj (1)
- # beginners (8)
- # boot (102)
- # cider (1)
- # clara (14)
- # cljs-dev (2)
- # cljsrn (2)
- # clojure (49)
- # clojure-poland (3)
- # clojure-russia (4)
- # clojure-serbia (1)
- # clojure-spec (5)
- # clojure-ukraine (1)
- # clojurescript (181)
- # core-async (4)
- # cursive (2)
- # datomic (7)
- # dirac (34)
- # figwheel (3)
- # fulcro (21)
- # hoplon (5)
- # om (1)
- # parinfer (4)
- # planck (27)
- # re-frame (30)
- # reagent (11)
- # rum (6)
- # shadow-cljs (22)
- # spacemacs (4)
- # unrepl (26)
After a 2 year break from working with clojurescript and Om, I'm looking to get back into it. Fulcro looks like a great fit, and I've been lurking in the channel for a bit so I gather that 2.0 is the way to go if I want to dive in. Before I do, does anyone know if the devguide working for 2.0?
@djjolicoeur No, start at 1.0. 2.0 is coming soon, but it won’t be appreciably different…just has some improvements.
2.0 should go into alpha in a month or so (maybe even a few weeks), but it won’t be ready probably till the end of the year for wider adoption
Dynamic query support is the main thing that is different, but you can build some pretty big things without ever needing that
No I went back to 1.0. But I'll give it another go later on today. I guess hard to say what caused my issue with undefined calls stack trace. This time I might have a better outcome as I'll be a bit smarter about the process...
ok, thanks for trying. Like I said, it is working with todomvc, the demos, the dev guide, and such…so I expect it to work without significant issue
thanks @tony.kay, I'll stick with 1.0 for now
@tony.kay: Upgrading to 2.0 worked fine this time. For the searching and replacing I used some Clojure functions: https://gist.github.com/chrismurrph/9c30ab2c842fb9f60a4347ba98e2746d
@tony.kay I'm playing with the defmutation
macro, I like how with that cursive can detect the symbol definition, so we auto-complete on usages 🙂
but at same time, because the env
param is at the inside functions, cursive doesn't understand and then can't bind the variables...
what about we move the env to the top? so the binding would be picked up, like this:
(defmutation my-mutation [env params]
(action []
(do-something!)))
we could keep the current version working, so we don't break things, but also support this second one, so we don't love things like renaming (I do a lot of keyword renamting, those cases would not be currently contemplated)
@cjmurphy Are you saying that worked better, or that you were just bored and wanted to code it?
@wilkerlucio The problem with that is the docstrings…the docstrings would indicate the mutation was a function of two arguments then (and actually more seriously: would show usage errors when in transact because you wouldn’t even pass two parameters…in fact it would be an error to do so). But I agree, though, that it isn’t ideal that it doesn’t understand env as a result. It’s such a hard thing: macros end up making some things nicer, but hide other things that are already simple. In this particular case I felt it was much more useful to get the call-site to declaration navigation, docstrings, and code completion. If you want the bindings to work inside of the action, just wrap them in a destructuring in let:
(defmutation boo [p]
(action [env]
(let [{:keys [state ...]} env]
...)))
good idea!
@tony.kay Yours didn't work for me out of the box: it completed but did not make any changes. And I wanted to be able to reverse changes and exclude a directory. And I was thinking about how to do that in Clojure rather than getting into the script. I posted it up because it could be useful, especially as it will work on any OS.