This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-22
Channels
- # aws (5)
- # bangalore-clj (3)
- # beginners (84)
- # boot (31)
- # carry (1)
- # cider (6)
- # cljsrn (7)
- # clojure (188)
- # clojure-conj (1)
- # clojure-dev (3)
- # clojure-dusseldorf (8)
- # clojure-greece (10)
- # clojure-italy (7)
- # clojure-nl (3)
- # clojure-russia (45)
- # clojure-spec (5)
- # clojure-uk (64)
- # clojurescript (83)
- # clr (9)
- # core-async (45)
- # cursive (55)
- # datomic (8)
- # devops (1)
- # emacs (7)
- # graphql (1)
- # hoplon (3)
- # jobs (1)
- # jobs-discuss (37)
- # lein-figwheel (3)
- # leiningen (4)
- # luminus (6)
- # off-topic (5)
- # om (2)
- # onyx (33)
- # pedestal (13)
- # re-frame (9)
- # reagent (28)
- # rum (15)
- # specter (4)
- # unrepl (38)
- # vim (3)
Hiya! Trying to follow this tutorial. https://medium.com/@matus.lestan/how-to-create-decentralised-apps-with-clojurescript-re-frame-and-ethereum-81de24d72ff5 made it pretty far! but got stuck when it told me to start using the Dispatch function in the figwheel REPL
I get this error: cljs.user=> (dispatch [:contract/fetch-compiled-code [:contract/deploy-compiled-code]]) ---- Compiler Warning on <cljs form> line:1 column:2 ---- Use of undeclared Var cljs.user/dispatch 1 (dispatch [:contract/fetch-compiled-code [:contract/deploy-compiled-code]]) ^--- ---- Compiler Warning ---- #object[TypeError TypeError: Cannot read property 'call' of undefined] "nil"
@mattgeb I guess that article references re-frame.core/dispatch
which is not in cljs.user
namespace but rather in re-frame.core
namespace - you need to require re-frame.core
namespace
then changed the dispatch call to (re-frame.core/dispatch [:contract/fetch-compiled-code [:contract/deploy-compiled-code]])
now there's a new error! log4j:WARN No appenders could be found for logger (onelog.core). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
@lxsameer this maybe what you are looking for https://github.com/thheller/shadow-cljs/wiki/ClojureScript-for-the-browser#module-loader
Anyone having experience integrating websockets with re-frame? I was trying to integrate Sente, but not sure how do it it correctly.
and I'm extracting my code in https://github.com/Codamic/hellhound
take a look at https://github.com/Codamic/hellhound/blob/master/src/cljs/hellhound/connection.cljs
and https://github.com/Codamic/hellhound/blob/master/src/cljs/hellhound/handlers/app_db.cljs
take a look at https://github.com/Codamic/oneiri
@vargaradu it goes well with re-frame anatomy
Ok, got the hang of it in the end, still took some github issue readings to figure out everything. Thanks for the code, it was very helpful!
@vargaradu I'm using sente
@dsapoetra probably missing externs
@thheller no, itâs with :whitespace
{:id "desktop"
:source-paths ["src-cljs-desktop"]
:compiler {:main app.core
:output-dir "resources/public/fe/js/compiled/out-desktop"
:output-to "resources/public/fe/js/app-desktop.js"
:closure-defines {"goog.DEBUG" false}
:optimizations :whitespace
:pretty-print false}}
at Object.132 (app-desktop.js:78176)
at s (app-desktop.js:61161)
at app-desktop.js:61161
at Object.50.132 (app-desktop.js:69527)
at s (app-desktop.js:61161)
at app-desktop.js:61161
at Object.64.50 (app-desktop.js:70690)
at s (app-desktop.js:61161)
at app-desktop.js:61161
at Object.75.157 (app-desktop.js:72639)
any recommendations on how to overwrite default behavior for cljs.pprint/pprint when it prints functions?
(def dummy-print-fn-sentinel (fn [] "<omitted>"))
(defn dev-disable-fn-print
"HACKS."
[]
(let [old js/Function.prototype.toString]
;; Skip the following lines, don't judge:
(when-not (identical? dummy-print-fn-sentinel old)
(set! js/Function.prototype.toString dummy-print-fn-sentinel)
(js/setTimeout
#(set! js/Function.prototype.toString old)
500))))
I'm a clojurescript/figwheel noob and I'm stuck on a problem: How do I get multiple pages working with figwheel? I suppose I can have a page2.html
and refer to a different .js file and start things that way but:
1. I'm having trouble getting the project.clj to generate two different .js files with different :main functions.
2. I can't quite figure out how to get modules https://clojurescript.org/guides/javascript-modules to do the trick.
am I thinking about this the wrong way?
@husain.mohssen figwheel does not support :modules
in development
so I should just use different profiles to compile different .js files?
shadow-cljs
does however if you want to give that a try https://github.com/thheller/shadow-cljs/wiki/ClojureScript-for-the-browser
@husain.mohssen you could do that but ideally you want to be able to share code between the pages
{:common {:entries [cljs.core]}
:page-a {:entries [my.app.page-a] :depends-on #{:common}}
:page-b {:entries [my.app.page-b] :depends-on #{:common}}}
Is there an equivalent of (let [some-sym# (my-func)]` that works for macros that are used by CLJS? I have a macro that works in Clojure that uses the # syntax but the value of (my-func) isnât getting bound to it in CLJS
is there anything like criterium for benchmarking fns in ClojureScript?
ActuallyâŚmight be an unrelated issue đŹ
this is probably a dumb question, but how do i go about combining sente with figwheel? figwheel accepts a ring handler, but it doesn't seem to kick off the web socket setup with http-kit.
one option is not to use figwheelâs http-server for your code - let figwheel worry about its websocket, and create your own with your own http server for sente
this might not be the most elegant option, but it works for my app
yeah, thatâs how I do it