Fork me on GitHub
#clojurescript
<
2015-11-02
>
samumbach00:11:03

@dnolen: I'm happy to file a JIRA card, etc; I'm just not familiar with the process

cfleming01:11:29

Is anyone here depending on explicit snapshot versions using lein, like 0.1.5-20151023.100204-2 instead of 0.1.5-SNAPSHOT?

cfleming01:11:00

Someone told me that pinning to specific snapshot versions was common in the CLJS world.

jaju02:11:28

Thanks @dnolen! Yes, I knew of the JAR format, and once I could see the CSS in there, I started looking for ways to have them available. I’ve always been too scared of Javascript, but thanks to you guys (Clojurescript FTW!), I dared to do my stuff with electron (+ node etc.) quite confidently! I had found this - http://hoplon.discoursehosting.net/t/how-do-i-include-the-css-from-a-cljsjs-package/443 - but a leiningen solution would be useful for me. This place was obviously the one to check if anyone’s done it before. Thanks again for all the awesome stuff! simple_smile

nowprovision04:11:40

@mfikes, thanks wasnt sure what it was called

sgrove04:11:10

Bit of a strange idea, but can I force clj-side evaluation of a form by requiring it in the same ns?

sgrove04:11:23

Here’s the code I’m working on:

(ns kandan.config
  #?(:clj  (:require [clojure.java.shell :as shell]
                     [clojure.string :as string]))
  #?(:cljs (:require [kandan.config :refer [git-version]])))

#?(:clj
   (def git-version
     (-> (shell/sh "bash" "-c" "git log --oneline -n 1")
         :out
         (string/split #" ")
         first)))

#?(:cljs
   (def navigator-desc
     (let [navigator (.-navigator js/window)]
       {:appCodeName         (aget navigator "appCodeName")
        :appName             (aget navigator "appName")
        :appVersion          (aget navigator "appVersion")
        :cookieEnabled       (aget navigator "cookieEnabled")
        :hardwareConcurrency (aget navigator "hardwareConcurrency")
        :language            (aget navigator "language")
        :languages           (js->clj (aget navigator "languages"))
        :maxTouchPoints      (aget navigator "maxTouchPoints")
        :onLine              (aget navigator "onLine")
        :platform            (aget navigator "platform")
        :product             (aget navigator "product")
        :productSub          (aget navigator "productSub")
        :userAgent           (aget navigator "userAgent")
        :vendor              (aget navigator "vendor")
        :vendorSub           (aget navigator "vendorSub")
        :client-git-sha      git-version})))

sgrove04:11:49

Trying to figure out a way for the :cljs form to have access to git-version

mfikes06:11:25

@sgrove: Perhaps employ a macro which—when evaluated—has the side effect of running the git command.

sgrove06:11:15

Thanks! I’ll give it a try in a bit (working on another problem right now) - something about my setup causes an issue when cljs files try to require cljc files on a fresh compilation, but works if the repl/figwheel is running

thheller07:11:08

@sgrove easiest way would probably be a (goog-define git-version "something") which you set to the proper version when compiling via :closure-defines

dnolen13:11:55

@samumbach: there’s a #C07UQ678E channel. Just open a ticket in JIRA with some minimal steps to reproduce. It should require nothing but ClojureScript itself (issue code only, no cljsbuild, no boot, etc.)

samumbach14:11:10

@dnolen: sure thing; I'll see you on #C07UQ678E

chadhs15:11:20

is there a way to have natal list out the repl port when you launch a project? could be handy for connecting from an editor.

roberto15:11:46

is there a cannonical way of doing debounce without using underscore?

amacdougall15:11:01

I don't think there's anything in the language core. If you can find a library that does it, just use it. Or implement it yourself. CLJS isn't mature enough to have de facto standards like underscore, which gives us the fun (or "fun") of writing our own.

dnolen15:11:42

@amacdougall: well that’s not entirely true, Google Closure Library

amacdougall15:11:57

Oh, good point—I keep forgetting how much is built into that.

r0man15:11:21

@dnolen: Hey David, is there a ClojureScript release planned any time soon? I'm still on 0.0-3308 because of the module regression. A prerelase would also help simple_smile

dnolen15:11:44

@r0man: use the release prior to the last one

amacdougall15:11:49

I also keep forgetting that part of the point of Clojure and CLJS is that you can and should just use Java or JavaScript libraries wherever they make sense.

dnolen15:11:20

@r0man: and yes another release is planned, there’s only one more ticket to sort out so probably Friday.

r0man15:11:00

@dnolen: cool. looking forward to this and trying the other one for now. thx

dnolen15:11:51

@roberto there’s not a standalone debounce thing in Google Closure Library far as I can tell.

roberto15:11:46

@dnolen: thank you. I’ll try to implement something then. Didn’t want to put energy into it if there was an easier way to do it.

roberto15:11:43

right now I have a channel that only calls a function if the length of the string in the channel is over a certain size. I think I can maybe add some sort of timeout there.

roberto15:11:22

(go-loop []
  (let [v (<! search-term-ch)]
    (when (> (-> v seq count) 2)
      (dispatch [:search-recording v]))
    (recur)))

dnolen16:11:22

@roberto yeah, google "debounce core.async" you’ll get a lot of examples

roberto16:11:57

@dnolen thank you. I got some inspiration from the core async webinar repo you created

roberto16:11:28

it is my go to reference for most of my core.async needs

asolovyov16:11:58

strange thing is going on for me. :closure-defines works nicely on my laptop, but on my CI server it just does nothing. I'm quite unsure what to do about that...

martinklepsch17:11:25

@asolovyov: any wrong versions being used can’t be the case I guess?

asolovyov17:11:10

martinklepsch: well, as much as you can be sure with lein...

asolovyov17:11:48

I guess should be fine!

richiardiandrea17:11:49

Hello guys, is there any battery included responsive css layout toolkit for ClojureScript? How do folks handle this usually?

martinklepsch17:11:48

@asolovyov: don’t really have any smart ideas, maybe check downloaded jars for correct versions of cljs etc?

richiardiandrea17:11:35

@darwin was it for me? I saw mesh but it looks overkill for my use case..I will check basscss thanks!

darwin17:11:07

@richiardiandrea: no, just announced my fresh wiki page simple_smile

asolovyov18:11:40

@martinklepsch: I will, but it still is really weird 😞

bhauman18:11:22

A lot of emphasis on making figwheel usable from Clojure.

bhauman18:11:56

Would love folks to kick the tires a bit simple_smile

asolovyov18:11:04

@bhauman: that list of changes, wow!

bhauman18:11:08

yeah some things just didn't work before, I'm hoping I got them under control

asolovyov18:11:15

> you can opt out of .clj or .cljc macro reloading hmm... to be honest, this never worked for me

asolovyov18:11:35

change of .clj or .cljc always spat exception and I had to restart my build process

asolovyov18:11:40

never investigated why though

asolovyov18:11:51

I guess I need to check that with 0.5 simple_smile

bhauman18:11:01

@asolovyov: it was more than likely a classpath issue

asolovyov18:11:31

hm! well, it did say 'can't find file named whatever.clj', is this known thing?

asolovyov18:11:52

> java.io.FileNotFoundException: Could not locate vars__init.class or vars.clj on classpath.

asolovyov18:11:03

(file is called vars.cljc)

bhauman18:11:05

@asolovyov: you are using figwheel from the REPL right?

asolovyov18:11:22

well I start it myself in my app

bhauman18:11:29

So you have to add all your source file directories to the classpath

asolovyov18:11:46

that makes sense simple_smile

asolovyov18:11:52

I'll check if I'm doing that...

bhauman18:11:38

so If you are using lein run or lein repl you have to add all your cljs source paths to :source-paths

bhauman18:11:21

This is something that the cljsbuild plugin and figwheel plugin both do

bhauman18:11:49

If you keep everything in "src" you are fine but ...

asolovyov18:11:14

yeah, you're right

asolovyov18:11:10

@bhauman: heh, weird, but it's in :source-paths. Anyway, I'll try 0.5 first, and then will try to find out what's going on for me there

bhauman18:11:43

@asolovyov: in the top level :source-paths?

bhauman18:11:02

that is strange

asolovyov18:11:49

hm, top level?

bhauman18:11:10

not in the cljsbuild config but top level of project.clj

asolovyov18:11:21

ah, it contains 'src' and I keep everything there

asolovyov18:11:33

except for one single file...

asolovyov18:11:38

maybe that ruins everything?

bhauman18:11:21

not sure. it seems strange

richiardiandrea19:11:53

is there a channel for re-com/ re-frame (on irc maybe) ?

darwin19:11:16

#C073DKH9P ?

richiardiandrea19:11:05

I swear I looked it up in the channel list