Fork me on GitHub
#clojurescript
<
2017-06-14
>
samueldev00:06:31

Are there any static analysis tools for cljs yet to find things like unused bindings and otherwise dead code?

samueldev00:06:41

eastwood and yagni don't seem to have cljs support as of yet

samueldev00:06:22

unrelated question: has anyone had any luck with phantom js for their test runner?

samueldev00:06:28

i'm finding a number of annoyances with it

samueldev00:06:01

1. the (testing "...") string for a failed test is not outputted, making it pretty pointless to include at all 2. unable to do more than 1 async test in a (deftest) 3. poor error output on exceptions being thrown in tests, but there appears to be an issue for this already: https://github.com/crisptrutski/boot-cljs-test/issues/59

Oliver George04:06:07

How do you build the clojurescript compiler on Windows?

minikomi05:06:10

Hmm.. is double-bundle style still the way to go for integrating / experimenting with npm libraries?

minikomi05:06:11

Or, really, if I want to live on the bleeding edge, is :npm-deps viable for non-node.js cljs?

minikomi05:06:39

Oh, it works 😄

minikomi05:06:32

A W E S O M E parrot

minikomi09:06:00

ah damn, this js module relies on builtins (events, util)… not sure how to get around that .. seems browserify / webpack inject shims when they’re required

mike_ananev11:06:32

Hi! I'm using Spacemacs and opened two repl processes: 1- jvm, 2-cljs +figwheel. When I send cljs S-exp to REPL I got a stacktrace, cause S-exp is evaluated in JVM repl. How to send CLJS S-exp to appropriate repl?

dnolen11:06:57

@minikomi you can probably make it work by explicitly adding the shims you need no?

minikomi11:06:53

tried adding them to npm-deps but didn’t seem to be able to get it to work.. moved on to another similarly-purposed library instead

grumplet14:06:24

How to access this in a js react-component from a Rum component? I’ve dropped a gist of the problem here: https://gist.github.com/gmp26/619b8bbf0be2244f151e4c5cee01f4bb

weavejester16:06:47

Out of interest, what does setting goog.DEBUG to false actually do?

darwin16:06:52

AFAIK various bits of closure library get elided by setting it

darwin16:06:49

you can also use it in your own code to elide some stuff in non-debug builds, this eliding is done by closure compiler, nothing to do with cljs compiler

darwin16:06:41

I prefer to use macros in cljs (when I have full control over the code and it is in ClojureScript), it is more predictable

naomarik18:06:36

@darwin macros as opposed to closure-defines?

darwin19:06:35

@naomarik yes, a macro can decide what cljs code to emit based on compiler options

zilti20:06:30

In enfocus, is it possible to use (at ... (html-content ...)) but have the current html-content available?

zilti20:06:27

As in I have five divs with the same class, and for each want to read, transform and store the content back into the div

dominicm20:06:07

Not sure if this has been discussed. As of Firefox 54 Dirac/Devtools should now work in Firefox 🎉

darwin20:06:50

@dominicm sounds like a science fiction to me 🙂

dominicm20:06:35

@darwin I'm sure you can also use the fact there's an additional sidebar api added if Fx. https://hacks.mozilla.org/2017/06/firefox-54-e10s-webextension-apis-css-clip-path/

dominicm20:06:10

Oh wait. The sidebar api is completely separate from the devtools api 😆

darwin20:06:49

Dirac is not going to work, I cannot imagine this could be possible except for Firefox to use Chromium codebase and change the icon 😉

darwin20:06:32

cljs-devtools maybe, if they implemented custom formatters feature from Chrome

darwin20:06:56

doesn't look like this could happen anytime soon: https://bugzilla.mozilla.org/show_bug.cgi?id=1262914

wistb20:06:16

Hi, basic question:

wistb20:06:55

I created a new reagent project, started lein figwheel, could see the page.

wistb20:06:23

wanted to add a new route that invokes a new component

wistb20:06:31

added the following :

wistb20:06:45

(defn simple-component [] [:div [:p "I am a component!"] [:p.someclass "I have " [:strong "bold"] [:span {:style {:color "red"}} " and red "] "text."]])

wistb20:06:53

(secretary/defroute "/simple" [] (reset! page #'simple-component))

wistb20:06:21

expecting to see the output when I visit localhost:3449/simple

wistb20:06:10

but, seeing Not Found.

wistb20:06:33

tried by rerunning figwheel, but, same issue

Roman Liutikov21:06:58

That's client side routing, not server side

Roman Liutikov21:06:40

You should probably have a link that points to specified route

wistb21:06:43

@roman01la Thank you. I found a handler.clj in which I added the following and now I see the page.

wistb21:06:52

(GET "/simple" [] (loading-page))