This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-19
Channels
- # aws (2)
- # beginners (135)
- # boot (20)
- # chestnut (7)
- # cider (18)
- # clara (5)
- # cljs-dev (50)
- # cljsrn (30)
- # clojure (252)
- # clojure-italy (9)
- # clojure-losangeles (5)
- # clojure-russia (8)
- # clojure-spec (33)
- # clojure-uk (5)
- # clojurescript (32)
- # clr (4)
- # cursive (5)
- # data-science (1)
- # datascript (1)
- # datomic (40)
- # emacs (1)
- # fulcro (18)
- # graphql (11)
- # hoplon (3)
- # lein-figwheel (2)
- # lumo (47)
- # off-topic (2)
- # om-next (3)
- # onyx (10)
- # pedestal (22)
- # protorepl (6)
- # re-frame (7)
- # reagent (38)
- # ring (1)
- # ring-swagger (5)
- # rum (3)
- # spacemacs (19)
- # specter (5)
- # vim (13)
- # yada (16)
is there a library for state management along the lines of reagent/re-frame without the UI pieces?
Tuck is a minimalistic one: https://github.com/tatut/tuck
(reagent being a dependency is a dealbreaker for me - i'm writing a console application)
Some folks at nilenso wrote this small lib recently: https://github.com/nilenso/wscljs. Thoughts?
To be fair I don’t really see the point of using this how it’s now since it’s so minimal. There is no reconnect, and no check if the channel is open before sending. It’s nice to see it’s specced. I use the js websocket in my current webproject with a nginx websocker in the back-end.
Yeah, I think the idea is to add retries for connection and some basic error handling as well. It’s in the issues.
I spent the night trying to figure out how cross-module code motion works with cljs 1.9.908 but I can't solve my problem and need some help. I have a simple build with two modules as in :
{:output-dir "resources/public/js/out"
:asset-path "/js/out"
:optimizations :whitespace
:modules {:core {:entries #{app.core}
:output-to "resources/public/js/out/core.js"}
:pages {:entries #{app.pages}
:output-to "resources/public/js/out/pages.js"}}}
So this produces 3 files, core.js
, pages.js
and cljs_base.js
. But here is the trick: on :optimizations :none
everything works fine. By 'fine' I mean that cljs_base.js
is successfully evaluated by the browser, then core.js
and pages.js
.
But on :optimizations :whitespace
or :advanced
some namespaces are moved down the deps tree to one of the splits, even if they are required by namespaces that ends up in cljs_base
. The produced cljs_base.js
is broken and fail to load in the browser with (in my case) :`Uncaught Error: goog.require could not find: goog.color.names`.
Building modules …
entries from the compiler's logs did shown me that some namespaces got moved down while they should stay in the cljs_base
. I don't understand why …I'm really struggling with that and I start to suspect a bug .
I'll make a small project and try to reproduce this
does defmethod
belong in the clj portion of the code or the cljs?
I think it depends
so confusing
@gfredericks if I understand your question correctly, you can use defmulti
/`defmethod` both in clj and cljs. It works the same way. What do you find confusing in this feature ?
@ggaillard I'm dealing with something more subtle. If I understand it correctly, cljs.test/assert-expr is a clj multimethod, so it has to be extended from clj code in the same place that you put macros. And this is problematic for a cljc project where you can't assume cljs.test exists
I think I fixed it with dynamicity, but it's unfortunate to have to resort to that
:thinking_face: indeed. cljs.test/assert-expr
is defined in a cljc
file, it will be expanded during the compilation phase (phase 1, clojure side) into cljs code that will then be compiled to js (phase 2). If you try to implement macros on top of it you can put them in a cljc
file and use reader conditionals #?{:clj …, :cljs …}
. This way you can ensure that cljs.test
exist.
I don't think reader conditionals works
you have to put everything in the :clj side
to be clear my code has (defmethod cljs.test/assert-expr ...)
in it, and that needs to go on the :clj
side
I think this is the same as the more traditional problem of macros that are sensitive to which environment you're in
but apparently requires more tricks to solve
And when you put (defmethod cljs.test/assert-expr ...)
on the :clj
side, you get an error that cljs.test
do not exist ?
right
although I'm confused what causes that error
everything builds fine for clj and cljs via leiningen, but the maven build for clj fails with that error
even though I see a dependency on clojuscript
you can try it out here if you're interested: https://github.com/clojure/test.check/commit/489d54d10ddf03b3dcc704be223c35529e9a9cd1
the commit before that one fails for mvn test