This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-12
Channels
- # announcements (65)
- # aws (1)
- # babashka (12)
- # beginners (111)
- # bristol-clojurians (1)
- # cider (32)
- # clj-kondo (55)
- # clojars (3)
- # clojure (71)
- # clojure-europe (17)
- # clojure-france (4)
- # clojure-italy (36)
- # clojure-losangeles (8)
- # clojure-nl (6)
- # clojure-uk (115)
- # clojurescript (2)
- # datomic (99)
- # fulcro (32)
- # graalvm (12)
- # graphql (20)
- # hoplon (203)
- # meander (56)
- # mount (3)
- # off-topic (17)
- # pathom (17)
- # reitit (22)
- # shadow-cljs (32)
- # spacemacs (9)
- # tools-deps (19)
- # vim (25)
- # vscode (3)
How can I implement component methods like: https://adazzle.github.io/react-data-grid/docs/examples/custom-editors
the output of defsc
is a js class, which is nothing more than a function that has crap in .-prototype
and such. See js docs. If you’re asking me “How do I get defsc
to let me write methods on the class?” The current answer is “it won’t”. You could easily write an (add-method! cls nm (fn ...))
function that adds a method to the class. Just look at how you’d do that operation in js and mimic it. Roughly this:
(ns util
(:require
[goog.object :as gobj]))
(defn add-method! [cls nm f]
(set! (.. cls -prototype nm) f))
(defn add-methods! [cls map-of-methods]
(gobj/extend (.-prototype cls) (clj->js map-of-methods)))
...
(defsc X ...)
(add-methods! X {:newMethod (fn [] (this-as this ...))
:otherMethod (fn [] ...)})
The component options map is technically open. I’d consider a PR to let you add them there, I just have never needed it myself.
I think gobj/extend
has been deprecated in favor of something…oh right, Object.assign
…whatever
For those playing with RAD: The alpha-8 release of the Datomic adapter (and the latest demo on develop of the demo repo) have some useful changes:
1. rad-datomic now has much more extensive tests
2. You can now put ::datomic/native-id? true
on an identity attribute to have to map to :db/id
in the database (you should still give the ID an application domain name like :person/id
)
3. The demo now uses Datomic free in memory, with no dep on postgresql or running an external transactor. This makes it much easier to get started with the demo, as it is now a zero-install experience.
I’d appreciate it if someone was willing to clone the demo and try the Datomic instructions. It should be a clone, yarn, shadow-cljs, clj sequence that should work without hassle (or separate downloads).
That's what I get from starting off with npx shadow-cljs watch main
and following its instruction exactly.
It all works for me now, at usual uri for shadow and making sure no index.html for the client.
(Having the shadow server running at http://localhost:9630/)
No - just ran the instructions, but w/out yarn and with the shadow-cljs server already running.
I can log in but when I press My Account I get an error. But that's another thing I guess.