This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-04
Channels
- # announcements (8)
- # beginners (27)
- # calva (8)
- # cider (26)
- # clara (19)
- # cljdoc (4)
- # cljsjs (1)
- # clojure (221)
- # clojure-dev (6)
- # clojure-europe (11)
- # clojure-gamedev (18)
- # clojure-italy (8)
- # clojure-nl (12)
- # clojure-spec (85)
- # clojure-uk (17)
- # clojurescript (34)
- # community-development (1)
- # cursive (26)
- # datomic (16)
- # dirac (19)
- # duct (6)
- # editors (4)
- # figwheel-main (1)
- # fulcro (68)
- # graphql (41)
- # juxt (16)
- # luminus (11)
- # off-topic (30)
- # pathom (35)
- # planck (2)
- # re-frame (18)
- # reagent (20)
- # remote-jobs (6)
- # rum (1)
- # shadow-cljs (37)
- # spacemacs (9)
- # vim (14)
Hello everyone! Is there a preferred way of starting a ClojureScript Node.js project with figwheel and CIDER support? Something easy to bootstrap like a lein template…
@rastandy Take a look at shadow-cljs which has excellent first class support for node, No figwheel needed as it hot reloads for you. I seem to remember notes on CIDER were also somewhere in the excellent docs
@robert.law thanks, will take a look at that, but would love to use figwheel because I simply love it
@rastandy, I think Fighweel has closed the gap to shadow-cljs somewhat when it comes to node support, but shadow-cljs is lovely. To start it with CIDER support:
shadow-cljs -d cider-nrepl:0.21.2-SNAPSHOT watch app
(replace app
with whatever you name your build).Hi! I have a really strange js output with cljs 1.10.520 (same for 1.10.516). Part of the form is simply removed after usage of var (in compiled js):
(def init-data
(if-let [element (.getElementById js/document "cljs-init")]
(->> (.-textContent element)
(transit/read transit-reader)
(merge {:a nil
:b nil}))))
and I use it in:
(defn render-app []
(when init-data
(swap! initial-state* merge init-data) ; <<<<<< here
(swap! state merge init-data) ; <<<<<< here
(i18n/init state)
(render-components ".cljs-app-component" components)
(nav/init!)))
(render-app)
For some reason code after first use (I’ve tried to change order) gets removed in js, but only til the end of render-app
fn:
if(cljs.core.truth_(hb.front.entry_points.app.init_data)){ //when part
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(hb.front.state.initial_state_STAR_,cljs.core.merge,hb.front.entry_points.app.render_app();
// EOF
As you can see swap!
is called, but first occurrence of init-data
is replaced with render-app
call from the end of this file.
If I replace init-data
with simple (def init-data {})
everything will be fine.
Or if I comment all usages.
On cljs 1.10.439 build is successful.
Any ideas?@il.tmfv Do you have :parallel-build
enabled? (Perhaps something related to multi-threading is causing the compiler to derail on that code.)
@mfikes I’ve tried to turn it off. There is even less data in js file now 😅:
if(cljs.core.truth_(hb.front.entry_points.app.init_data)){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(hb.front.state.initial_state_STAR_,cljs.core.merge,
it just ends here.I do run it for 2 builds 🙂 But now I’ve tried for only 1 and I have the same result cljs 1.10.439 works great with 1 or 2 builds. I clean folders before each build, just in case
Also i’ve tried to inline (def init-data ...)
form to get rid of ->>
and if-let
Result is the same.
Maybe interop stuff is broken?
Yep, I was thinking about it.
Will take a look tomorrow 👍
Just tried to change init-data
to
(def init-data
(merge {:a nil
:b nil} {})
Output is still broken.
But it works for simple (def init-data {:a nil :b nil})

Can anybody point me to the documentation for the js*
interop macro/function/special form?
for inspiration look how it is used in https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc
That’s where I found it, and I thought was able to discern how the substitution works. But, this surprises me: (js* "({} >>> 0)" -319376401)
@U0698L2BU Recommend
(bit-shift-right-zero-fill -319376401 0)
@U08E3BBST that worked. My ClojureScript fu is not strong enough to understand why the unadorned version did not work.