This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-03
Channels
- # aws (27)
- # beginners (64)
- # boot (14)
- # calva (10)
- # cider (36)
- # cljs-dev (13)
- # cljsrn (79)
- # clojure (58)
- # clojure-berlin (8)
- # clojure-france (1)
- # clojure-italy (18)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (29)
- # clojurescript (55)
- # core-async (20)
- # cursive (5)
- # datomic (105)
- # emacs (17)
- # figwheel-main (13)
- # fulcro (20)
- # graphql (4)
- # hoplon (1)
- # hyperfiddle (2)
- # jobs (7)
- # jobs-discuss (110)
- # off-topic (23)
- # pathom (1)
- # perun (2)
- # re-frame (87)
- # reitit (2)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (118)
- # vim (11)
anybody that can tell me what the correct interop would be for something like this $('.ui.sidebar').sidebar('show');
@restenb you have jQuery added to externs (or from cljsjs) already?
What’s the best way for writing a predicate to check if something implements the ILookup
protocol?
cljs.user=> (satisfies? ILookup {:a 1})
true
cljs.user=> (implements? ILookup {:a 1})
true
so I’m trying to write an app that interacts with some other bits outside of it’s code base. This seems to work when I’m testing it in a development build, but when I try and do a release build and put it on a page, it breaks:
(defn ^:export start! [node]
(a/go-loop []
(let [ev (a/<! (gobj/get js/window "PUNK_IN_STREAM"))]
(println ev)
(dispatch ev)
(recur))))
lost the error, reproducing so I can paste it… it gives a fairly indecipherable error out the take on the channel
punk.js:10623 Uncaught TypeError: Cannot read property 'pop' of undefined
at punk.js:10623
at $JSCompiler_StaticMethods_cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2$$ (punk.js:10632)
on the page I have another app that has this in it:
(gobj/set js/window "PUNK_IN_STREAM" (a/chan))
(defn ^:export start! [node in-stream]
(a/go-loop []
(let [ev (a/<! in-stream)]
(println ev)
(dispatch ev)
(recur))))
(defonce in-stream (a/chan))
(def start-punk! (gobj/getValueByKeys js/window "punk" "ui" "core" "start_BANG_"))
(start-punk! container in-stream)
well, first I put a pre assert. I just added a println…
(defn ^:export start! [node in-stream]
{:pre [(not (nil? in-stream))]}
(println in-stream)
(a/go-loop []
(let [ev (a/<! in-stream)]
(println ev)
(dispatch ev)
(recur))))
could there be conflicts because I have two CLJS apps on the same page, one passing a channel to another?
in my second app, which is trying to use this release-built one, I have this:
(defonce in-stream (a/chan))
(println in-stream)
(def start-punk! (gobj/getValueByKeys js/window "punk" "ui" "core" "start_BANG_"))
(start-punk! container in-stream)
#object[cljs.core.async.impl.channels.ManyToManyChannel] core.cljs:192
#object[Object [object Object]] punk.js:756
@lilactown you can't have two apps on the same page
so I have one app that has been built and released. I’m trying to use it on a page with another app, which I am developing
my built and released application otherwise appears to work, except that it can’t seem to accept this channel created by the second app
it’s kind of important that this first application be built separately from the second, since it’s meant to be a 3rd party application that in the future will utilize self-hosted CLJS. I don’t want to impart the burden of configuring that on the consumer
interestingly, passing in a map from the second (dev time) app to the first (released) app results in different printing behavior:
#object[Object {:foo "bar"}] ;; foreign map
{:baz asdf} ;; map created in the same build
I wonder if the way CLJS protocols operate is somehow scoped to the build they are produced in. so a CLJS data type created in one build does not seem to interop in another build
this wasn’t really helpful at all @U11BV7MTK. I’m asking a specific question.
But I wouldn't expect much to work between two different advanced compiled apps, unless you're passing thing via edn/transit
Has anyone managed to successfully mix Rust/Wasm32 + CLJS for web development? I'm looking for a model where the high performance / "foundational" code is written in statically typed Rust, with some API layer of structs / traits exposed -- then being able to interactively develop CLJS on top of this (via figwheel or the like).