This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-15
Channels
- # 100-days-of-code (7)
- # beginners (58)
- # boot (1)
- # cider (12)
- # clojure (69)
- # clojure-nl (1)
- # clojure-serbia (1)
- # clojure-spec (34)
- # clojure-uk (3)
- # clojurescript (14)
- # clojutre (3)
- # core-async (1)
- # core-logic (6)
- # cursive (44)
- # datomic (1)
- # defnpodcast (1)
- # emacs (16)
- # figwheel-main (3)
- # fulcro (14)
- # immutant (3)
- # leiningen (9)
- # mount (1)
- # nrepl (19)
- # off-topic (4)
- # pedestal (2)
- # re-frame (73)
- # ring (2)
- # shadow-cljs (40)
- # tools-deps (14)
- # yada (4)
When receiving responses from a datomic-backed server, the db/id
are large numbers such as 44143192831950917
. Looks like fulcro is converting them into goog.math.Long
under the hood. The problem is that when I use the bidi-based routing it does not know how to handle those goog.math.Long
No protocol method ParameterEncoding.encode-parameter defined for type object: 46157498134036548
Is there a way to convert these into strings when received after a load?@pvillegas12 you can convert load data with a post-mutation.
Fulcro uses transit. See the conversion table here: https://github.com/cognitect/transit-cljs
@pvillegas12 https://github.com/juxt/bidi/blob/master/src/bidi/bidi.cljc#L34 is what you need to deal with
@tony.kay I’m using the datomic generated ids in my fulcro UI. Those ids are used for routing, replacing the datomic payload with an initial-state
one with the same data worked correctly (does not use the implicit conversion to goog.math.Long
I suppose. I’ll look into extending the protocol
Any pointers for using the shadow-cljs version of the fulcro template with emacs?
It seems like I have to start both a lein nrepl connection and a shadow-cljs nrepl connection (in both clj + cljs mode) to get everything to work, is there anything more straightforward?
@fiddlerwoaroof no idea about the emacs side but you can run use the lein nrepl server and use the embedded version https://shadow-cljs.github.io/docs/UsersGuide.html#_embedded_nrepl_server https://shadow-cljs.github.io/docs/UsersGuide.html#embedded
Cool, server/start!
was the piece I was missing
lein with-profile +cljs repl
user> (go)
user> (require '[shadow.cljs.devtools.api :as shadow])
user> (require '[shadow.cljs.devtools.server :as server])
user> (server/start!)
user> (shadow/watch :main)
Now I just need to figure out how to duplicate that inside cider