This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-26
Channels
- # asami (2)
- # babashka (1)
- # beginners (31)
- # calva (11)
- # clj-together (3)
- # clojure (43)
- # clojure-europe (6)
- # clojure-norway (1)
- # clojurescript (14)
- # core-async (3)
- # core-logic (24)
- # cryogen (6)
- # datascript (2)
- # datomic (3)
- # fulcro (35)
- # honeysql (2)
- # hyperfiddle (12)
- # kaocha (3)
- # lsp (11)
- # off-topic (10)
- # pathom (2)
- # reagent (14)
- # releases (1)
- # sci (11)
- # shadow-cljs (27)
- # tools-deps (7)
@borkdude found this maybe-bug with SCI via Clerk… I built custom JS with this namespace:
(ns mathbox.clerk-ui
(:require ["three" :as three]
[nextjournal.clerk.sci-env]
[sci.ctx-store]
[sci.core :as sci]))
(def three-ns
(-> (into {}
(map (fn [[k v]] [(symbol k) v]))
(.entries js/Object three))))
(sci.ctx-store/swap-ctx!
sci/merge-opts
{:namespaces {'three three-ns}})
then, in my clerk viewer, I can call constructors with the new
keyword:
(js/console.log (new three/Color 0xff4136))
and I seebut if I do (three/Color. 0xff4136)
instead I get
It may be better to use add-class!
for JS things rather than imitating a Clojure namespace
See:
https://github.com/babashka/sci/blob/master/doc/async.md
I think so, transitively via the latest Clerk
no rush!!
will do