Fork me on GitHub
#clojurescript
<
2017-07-06
>
mfikes00:07:00

@qqq Not that I'm aware of.

valyagolev01:07:33

----  Could not Analyze  src/shyster/core.cljs   line:17  column:3  ----

  clojure.lang.Keyword cannot be cast to clojure.lang.IObj
 

16  (defn log-from-channel [ch]
  17    (go (log (<! ch))))
        ^--- clojure.lang.Keyword cannot be cast to clojure.lang.IObj

valyagolev01:07:07

(:use-macros 
               [clojure.core.async :only (go <!)])
and
[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.9.542"]
                 [org.clojure/core.async  "0.3.443"
                  :exclusions [org.clojure/tools.reader]]

dnolen01:07:25

@valyagolev wrong macros, you want cljs.core.async.macros

valyagolev01:07:49

this worked! thanks

fabrao03:07:41

Hello all, how do I iterate with this (.querySelectorAll js/document ".mdc-ripple-surface:not([data-demo-no-js])")

grav07:07:27

Should the closure-library work in NodeJS? Seems goog.net.DefaultXmlHttpFactory.createInstance relies on XMLHttpRequest being present, which it isn’t in Node

thheller08:07:33

@grav those aren’t supposed to work no. most of it is safe to use but the browser specific stuff isn’t

the-kenny09:07:21

Suppose I want to build a om.next application without using IQuery (by passing all props to children explicitly, etc., just like in om.core: Can I use om/transact! for mutations safely? Initial tests tell me I can, although I get scary warnings like Invariant Violation: transact! should be called on a component that implements IQuery or has a parent that implements IQuery

danielcompton09:07:28

@the-kenny try #om as well, you might get a response there?

grav15:07:11

@thheller Ok, thanks, I won’t make a bugreport then 🙂

grav15:07:07

I’m using funcool/httpurr. Wonder if a PR regarding nodejs compatibilty would make sense? What do the funcool peepz think?

grav15:07:42

Hmm, or maybe it does have node compatibility, and I’m just doing something wrong …

grav15:07:53

Indeed I am, httpurr works fine with node, as long as the correct client is used 🙂

witek17:07:15

Hi. Some time ago I have read about a ClojureScript REPL which runs in a browser and is shared between multiple users. Anyone knows which one this could be? Tank you!

alice18:07:15

So does anyone have any clues on how I'd generate a thumbnail of a webpage from a link?

thheller18:07:12

you can write that in CLJS of course 😉

grav19:07:10

From cljs-testing docs: > NOTE: You cannot have more than one async test per deftest form or only the first one will run Any ways to get around this apart from creating more deftests?

grav19:07:58

Maybe creating a deftest' macro that will generate a deftest for each sub-expression?

dnolen19:07:02

not going to change anything around async test macro

dnolen19:07:17

“You cannot have more than one async block” is really what it means

dnolen19:07:28

you can have as many testing assertions as you like

grav19:07:44

Yes. I wasn’t planning on adding deftest' to Clojure, just wondering if a home-made macro would do the trick.

grav19:07:38

The thing is that my tests run both for clj and cljs, so I try avoiding having to rewrite them for the sake of cljs.

grav19:07:06

They’re executed synchronously in clj, though.

dnolen19:07:00

@grav it could work, just depends on how you’re writing them so that they could be shared reasonably

grav20:07:38

@dnolen Something like this?

(defmacro deftest' [name & body]
          `(do ~@(->> (interleave (repeat `deftest)
                                  (repeat (symbol (str name "_" (gensym))) )
                                  body)
                      (partition 3))))
(macroexpand-1 '(deftest' my-test (is (= 2 2)) (is (not= 2 3))))
=> (do (clojure.test/deftest my-test_G__49180 (is (= 2 2))) (clojure.test/deftest my-test_G__49180 (is (not= 2 3))))

dnolen20:07:00

something like that yes

vikeri21:07:24

I know I can’t use resolve in cljs in runtime due to :advanced compilation. But is there a way to accomplish a similar thing it in a macro? In theory using it in a macro would address the munging problem since the macro is expanded before the cljs->js compilation step?

dnolen21:07:06

@vikeri already exists in the latest release

dnolen21:07:23

and yes, it’s advanced compilation safe

anmonteiro21:07:21

it’s not dynamic though

anmonteiro21:07:25

you can’t pass resolve a variable

vikeri21:07:18

Ok, great timing! When was it added?

qqq21:07:50

what is the current status of cljs + https://github.com/mikera/core.matrix ?

qqq21:07:01

do we have ndarray + blas for cljs yet ?

chouser22:07:58

Is there a convenient way to export a compiler environment from clojurescript and feed it into a bootstrap-cljs environment? That would lock me out of advanced optimizations on the cljs side -- would it be better to send selected namespaces as cljs text to the browser for compilation by bootstrap-cljs?

chouser22:07:04

I guess the latter sounds less complicated, so I guess I'll attempt that first.

chouser22:07:48

@richiardiandrea Can you guess the context of my question? 🙂

richiardiandrea22:07:52

are you talking about sending the state remotely? I have always had this idea but never realized it...and yes...what you are doing is super cool 😄 😄 🆒

dnolen22:07:18

@chouser the design more or less was designed around that

dnolen22:07:26

since bootstrapped benefits from analysis caching too

dnolen22:07:46

that’s all the analysis caches are - partitioned compiler state by namespace

chouser22:07:25

compiler state -- basically I've got a namespace (just one for now, but ...) that is currently compiled by clojurescript via boot that I'd like to have available in the replumb repl for autocomplete, redefining, etc.

dnolen22:07:29

it’s also why eval is async, so you can sort out what parts you need to get

dnolen22:07:56

@chouser we already emit analysis caches per ns so you can just use that, either EDN or Transit

dnolen22:07:52

this is why Planck & Lumo can boot quickly

dnolen22:07:02

the compiler doesn’t do anything, it just evals JS and reads analysis cache

anmonteiro22:07:44

Just like David said, Lumo lazy-loads the analysis cache

anmonteiro22:07:13

as part of the (Boot) build process we partition those core caches into smaller things that we load as needed: https://github.com/anmonteiro/lumo/blob/master/build.boot#L102

anmonteiro22:07:36

in this case we call Node fs functions, but you can easily modify it to do a network request or something

chouser22:07:27

It's really amazing what you folks have done. I really don't understand what I'm doing, but nevertheless I've got clojurescript running beautifully in the browser, even with source maps.

wistb23:07:03

is the figwheel kind of facility available to non clojurescript stacks for front end development ? How much of a big deal it is really to have figwheel for your ui development. I have not done any UI development, so, I dont know. But, I get the feeling that it is a "big deal" that folks who are looking to choose a stack should really need to sit and take notice ..

wistb23:07:08

How do I sell clojureScript to someone looking at node/angular etc ?