clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
2020-11-24T00:05:29.379500Z

@smith.adriane Hmm...that channel seems empty?

phronmophobic 2020-11-24T00:05:57.379700Z

bootstrapping is pain and it's not done very often

phronmophobic 2020-11-24T00:06:44.379900Z

I have posted odd questions and gotten responses from mike fikes within a few days

2020-11-24T00:07:34.380100Z

@smith.adriane Ah, okay then. I'll ask there. Thanks.

phronmophobic 2020-11-24T00:08:05.380300Z

his blog is also a good resource, but you may have to do some digging, https://blog.fikesfarm.com/tags/Bootstrap.html

phronmophobic 2020-11-24T00:08:43.380500Z

I would try to help more, but I'm pretty unfamiliar with npm and bundle

phronmophobic 2020-11-24T00:09:15.380700Z

and it seems like the issue might be related to using the bundle target

2020-11-24T00:12:08.381Z

@smith.adriane No worries. I'll dig a bit on his blog then ask.

2020-11-24T00:12:14.381200Z

I do appreciate the help. πŸ™‚

2020-11-24T00:12:25.381400Z

(Or at least the attempt and the resources. πŸ˜‰ )

πŸ‘ 1
2020-11-24T01:56:28.382Z

Okay, in the meantime, is there anyway to use figwheel-main with 1.10.741?

2020-11-24T01:56:45.382400Z

(It seems to jump from 1.10.339 to 1.10.773)

2020-11-24T01:57:25.383100Z

figwheel-main 0.2.9 being cljs 1.10.339 and figwheel-main 0.2.10 being cljs 1.10.773

2020-11-24T16:29:52.401700Z

I think that that error is supposed to be related to the :target passed into the opts parameter: http://cljs.github.io/api/cljs.js/#eval-str

2020-11-24T16:30:06.401900Z

(Although I'm not entirely sure.)

2020-11-24T17:43:03.402300Z

When I try to require both figwheel-main and cljs in my deps.edn file, the repl never actually appears.

2020-11-24T17:43:23.402500Z

Although the page does load and operate normally.

p-himik 2020-11-24T07:55:11.383800Z

Seems to work in 758 and to break in 764. Probably commit be792c95 in CLJS. But given that your code explicitly uses target bundle, I don't think it was supposed to work in the first place.

Emil 2020-11-24T12:33:26.388Z

Possible question for the #beginners channel, but I'm trying to figure out how one would go about executing cljs builds using clojure tools/deps.edn without shadow, lein etc. Something like this (I'm aware of the fact that you can run cljs.main with :main-opts set)

{:paths ["src"]
 
 :deps 
 {org.clojure/clojurescript {:mvn/version "1.10.758"}}


 :aliases
 {:build/release 
  {:exec-fn cljs.build.api/build
   :exec-args {:src "src" :opts {:optimizations :advanced} } }}}

udit 2020-11-24T14:45:23.394600Z

I am trying to build a browser based cljs evaluator against which tests assertions could be run. So essentially I want to run tests against the functions that user just typed in the evaluator. For instance:

(cljs.js/eval-str
  (cljs.env/default-compiler-env)
  "(ns something)
   (defn foo [] 9)"
  nil
  {:eval cljs.js/js-eval}
  prn)

(deftest test-something
  (is (= 9 (something/foo))))

udit 2020-11-24T14:46:37.395400Z

One obvious problem is that in my test I do not have access to the something namespace.

udit 2020-11-24T14:48:51.397500Z

So instead I tried populating the initial env with my test’s namespace, so that it has the dynamic code and the static tests together. This works if the test ns is not dependent on anything else. I can call the fns defined in the test ns from the dynamic code.

udit 2020-11-24T14:48:55.397800Z

But not the other way round.

udit 2020-11-24T15:35:09.401300Z

So I tried flipping the problem on itself. I am now using the compile-str function to evaluate the dynamic code and put it in the compile-state

;; this works. I can see my-state getting updated
(cljs.js/compile-str my-state "(defn bar [] 18)" "foo" {:ns 'foo} prn)


;; this doesn't work and complains about foo not being defined.
(cljs.js/eval-str my-state "(bar)" "foo" {:ns 'foo} prn)

Jazzer 2020-11-24T19:00:53.406300Z

Is there a particular space/channel for re-frame? Or is this the best place to ask re-frame questions?

lilactown 2020-11-24T19:04:14.406900Z

#re-frame

πŸ‘ 1
Jazzer 2020-11-24T19:21:17.408500Z

Almost like I don’t know how to use Slack with the channel search feature πŸ₯Ί

lilactown 2020-11-24T19:22:47.408700Z

πŸ˜„ no worries

Rina 2020-11-24T21:58:06.411300Z

Hi, I'm looking for a simple clojurescript tests coverage tool. I found this https://github.com/cloverage/cloverage/ but it does not support clojuresciprt files. Are there any other tools?