Fork me on GitHub
#clojurescript
<
2015-09-04
>
phil_r09:09:21

@bhauman: I use C3.js because I'm lazy and it's already packaged up on CLJSJS.

afhammad10:09:52

@emil0r: As a customer I’m not a fan of subscription based desktop software, i’d rather pay once and use that version for as long as I want and pay for updates if needed. As a developer though, I understand the need for it to run a sustainable business.

viesti10:09:12

hmm, defmacro in a .cljc file in windows seems to cause pains

xificurC11:09:16

any thoughts on lighttable? Is it worth setting up for a cljs environment?

dnolen11:09:15

@xifi it was languishing there for a bit but it seems to be picking up steam again from the community. IMO the best environment for ClojureScript these days is Cursive. That said Figwheel makes pretty much any text editor a decent ClojureScript environment.

dnolen11:09:53

@xifi that plus Chrome Canary, you’ll get syntax highlighting and dependable debugging.

xificurC12:09:43

@dnolen: is (and will be) cursive free?

xificurC12:09:23

chrome canary, interesting, thanks for the tips

borkdude12:09:55

can you run chrome canary alongside 'normal' chrome?

borkdude12:09:11

oh, I read it now. yes

dnolen12:09:11

eventually the syntax highlighting bits will land in Chrome

wilkerlucio13:09:24

hello people, I just published a post where I talk a bit of things about the development of Musicoacher: http://wilkerlucio.github.io/clojure/2015/09/04/marking-of-musicoacher/

tolbrino13:09:05

Hi, I'm looking for a good reference to read up on testing a clojurescript/om application. Any hints?

dnolen13:09:42

@wilkerlucio: my only suggestion is that I find it a bit distracting when the code isn’t formatted for the dimensions of the page, i.e. wrapping.

tolbrino13:09:40

@wilkerlucio: just fyi, it says "marking" in your url

wilkerlucio13:09:19

@dnolen: thanks for the feedback, I think you are right, it happens that I have big screen and here nothing wraps so I didn't noticed, , I'll try to improve the layout by later today

wilkerlucio13:09:22

@tolbrino: ups, thanks for noticing, but since I already spread this link I'll leave it as is to don't break now

afhammad13:09:40

@tolbrino: Don’t know of any reading material but maybe checkout how CircleCI handles testing: https://github.com/circleci/frontend

tolbrino13:09:42

@afhammad: Good idea, their frontend seems to include quite some test code. Thanks!

bhauman13:09:20

@wilkerlucio: awesome post!! Wow. Describing devcards is at best difficult. You did a great job.

dnolen13:09:43

@bhauman: @wilkerlucio: agreed the benefits make a lot more sense to me now. Seems like a much better way to test UIs to be honest.

dnolen14:09:26

I guess TestCards doesn’t sound quite as snappy as DevCards

bhauman14:09:51

@dnolen: yeah laying out a set of components with notes for dev and QA seems much better and more realistic than selenium integration tests

dnolen14:09:33

@bhauman: aren’t you talking about DevCards at Strange Loop? simple_smile

wilkerlucio14:09:48

@bhauman: thanks, I'm glad I can help with it somehow, from what I saw people talking on the maillist it seemed that people were not getting it, so I tried to say it in other way, hope it works simple_smile

bhauman14:09:16

@wilkerlucio: great stuff really

bhauman14:09:47

Well @wilkerlucio's post is on HN on the second page of the new section I guess if folks want to vote now is a good time

bhauman14:09:30

its called "The making of music coacher" and its a really great read

Doug Kirk15:09:26

@bhauman: Is there a way to have Figwheel auto-reload updated css compiled from less on the server side?

cfleming15:09:21

emil0r: Thanks, I just saw that

bhauman15:09:03

@kirked: if i understand your question correctly, as long as less it outputting css files to a dir that figwheel is watching then it should work OK

Doug Kirk15:09:18

@bhauman: Hmm, must be a setup problem then. Thanks very much!

bhauman18:09:31

@tcrawley: I'm getting some clojars funkiness

bhauman18:09:43

@tcrawley: nevermind I figured it out 😉

jrychter18:09:11

Ok, I'm making some progress in narrowing down the strange warnings:

(rum/defc test-component-1 [params]
  (let [{:keys [a b]} params] ;; This line causes a 'WARNING: No such namespace: clojure.lang.PersistentHashMap, could
                              ;; not locate clojure/lang/PersistentHashMap.cljs, clojure/lang/PersistentHashMap.cljc, or
                              ;; Closure namespace ""' to be generated, pointing to the line above (with the defc).
    [a b]))

(rum/defc test-component-2 [params]
  (let [a (:a params) ;; This component does not generate any warnings.
        b (:b params)]
    [a b]))

jrychter18:09:17

It's the destructuring in the let form that causes the warning to appear. But it is somehow environment-dependent, as it only happens when using figwheel, and then only when started via a function called from the repl, not via lein figwheel. I guess I now have to look into what sablono is doing.

thomasdeutsch18:09:20

i am stuck, trying to call a function multiple times on a js/object.

thomasdeutsch18:09:46

I use pixi.js and for the rendering, i need a stage (new js/PIXI.Container), now i want to add childs to that stage, but i am not able to do this like (map (fn [c] (.addChild stage c)) children)

bhauman18:09:39

@thomasdeutsch: thats a lazy call right?

niquola18:09:09

Hi, cljs nub question - how to run figwheel and clojure repl in same process?

bhauman18:09:32

@nicola: please don't do that if you are new

bhauman18:09:49

@nicola: i say that with the intention of trying to be as helpful as possible

bhauman18:09:49

@nicola: but the answer to that question is in the readme and the wiki on the figwheel github site

bhauman19:09:26

@jrychter: it looks like some funky macro expanding is going on there

niquola19:09:05

@bhauman thx, I'm not new to clj, so I'll try ;)

bhauman19:09:19

@nicola: yeah I saw that ... and felt kinda stupid. Lots of people chew off too much at the start and I react quickly to that.

thomasdeutsch19:09:41

@bhauman: That is right, i should use doseq. I made the chage in my code to (doseq [c [children]] (.addChild stage c)) but sadly, that comes with some pixi errors. children is a vector containing js/objects - could this be a problem?

bhauman19:09:18

@thomasdeutsch: is children originally a vector? then you don't have to wrap it in another vector

thomasdeutsch19:09:47

no, they are js/objects that i put in a vector

bhauman19:09:54

@thomasdeutsch: what is the type of children? if its a vector or coll do this: (doseq [c children] (.addChild stage c))

thomasdeutsch19:09:22

yes, that is it! thanks. BTW. Thanks a lot for your work!

bhauman19:09:00

Cool. I saw that you are quite the adventurer, you took a pretty big bike trip right?

bhauman19:09:26

Your welcome simple_smile

thomasdeutsch19:09:28

yes, that is true. 16500 km from germany to china. now i am working on a clojurescript app - i worked very hard on it for 8 months now - soon to be released (build with figwheel, rum, datascript)

bhauman19:09:47

thats really awesome stuff, adventure on both fronts

thomasdeutsch19:09:09

that is right - need to do my own thing i guess

bhauman19:09:05

here's to doing our own thing !!

bhauman19:09:19

thats where figwheel came from

jrychter19:09:42

That's where most good things come from.

thomasdeutsch19:09:27

i will write a short blog post on my experience using figwheel and datascript - in 3 months from now.

bhauman19:09:54

awesome, looking forward to it

timgilbert21:09:45

Hey, can someone help me with a simple js interop problem? I’m trying to use the showdown Markdown parser to generate some html. It’s packaged up in cljsjs, but I can’t for the life of me figure out how to instantiate a new converter

timgilbert21:09:13

I’m require’ing [cljsjs.showdown] in my ClojureScript file, but trying to access Showdown or js/Showdown is failing

timgilbert21:09:29

Basically what I want to do is this, but in ClojureScript:

var converter = new showdown.Converter(),
    text      = '#hello, markdown!',
    html      = converter.makeHtml(text);

darwin21:09:20

(js/showdown.Converter.) should work

timgilbert21:09:55

Aha! That’s it, thanks @darwin. It’s actually (js/Showdown.converter.) since the externs has it capitalized

darwin21:09:17

did a quick github googling, bhauman has another solution - this is the second thing I would try: https://github.com/bhauman/devcards/blob/master/src/devcards/util/markdown.cljs#L10-L11

timgilbert21:09:18

I always get confused by the slash and dot rules

dnolen22:09:57

@timgilbert: slash always means namespace

timgilbert22:09:44

I guess the thing that always surprises me is that I’d expect to (require '[cljsjs.showdown :as showdown]) and then (showdown/converter.) or something

phil_r22:09:30

i do that all the time despite knowing that cljsjs jars don't actually contain any clojure namespaces 😕

dnolen22:09:34

@timgilbert: random JS libraries don’t have namespaces though

darwin22:09:37

@timgilbert: IMO someone would have to make a friendly cljs wrapper from showdown for it to behave like you would expect cljs library to behave, but don’t forget that you are using raw foreign library, it does not follow cljs conventions, you have to drop into js interop, which needs a bit of understanding

timgilbert22:09:02

Yeah, in theory I know there aren’t namespaces in js libraries, but in practice I always forget the syntax and formula to access them. It’s probably more of a problem with me than with js interop, honestly. 😐

dnolen22:09:53

@timgilbert: not saying it’s particularly intuitive but also we couldn’t come up with a good solution for this case.

timgilbert23:09:35

Totally, I agree. Maybe I’ll write up a quick refresher on this stuff for the cljsjs site.