Fork me on GitHub
#clojurescript
<
2015-07-28
>
danielcompton00:07:01

@shaunxcode: paredit support has gotten a lot better, particularly in the most recent releases

shofetim02:07:09

Is there a cursive equivalent to emacs prelude? (or maybe Cursive is to IntelliJ what prelude is to emacs?)

shofetim02:07:04

@roberto: Guess I should only ask one question at a time, to which where you responding ?

roberto02:07:24

the latter

danielcompton06:07:24

@petrus: did you ever figure out Mixpanel tracking from cljs?

p14n07:07:29

@dnolen: Did you set up emacs key bindings or just adopt the standard intellij ones? I've found it awkward to try and mix the two, and seem to be constantly stumped and reaching for the mouse...

danielcompton07:07:47

@p14n I set up Emacs paredit bindings, REPL commands, and a few window management ones and I was away

gphilipp07:07:47

I can’t seem to find a Bidi clojurescript example, can anyone point me to any extract of code using it ?

mhuebert08:07:24

compiling an empty repo (:optimizations :simple) with cljs.js as a dependency creates a 1.7mb file in build 3620, 6.2mb in 3652

casperc09:07:27

Does the import macro only work for Google Closure classes? I have a class in google maps, e.g. google.maps.Map, but doing (:import [google.maps Map]) doesn’t work.

casperc09:07:28

And (:import [google.maps.Map]) doesn’t make a difference - it works without and I still have to use the full name with it

bensu10:07:59

I was wrong last time when I said that cljsjs.google-maps included the source, I forgot about it. In the gist there is a way to get the source using your API key.

Petrus Theron10:07:36

I plan to do a talk on ClojureScript at a local university in two weeks (University of Cape Town) to a non-Clojure audience. Any tips for structuring a sub-40 minute talk for maximum impact/adoption?

casperc10:07:34

@bensu: Thanks. It is slightly different from what I have working now. The problems I was having before was not having the google maps <script…> tag before the application one (doh)

Petrus Theron10:07:42

Yeah live coding would be awesome. I was thinking something with reagent for web dev, but snake is more fun!

casperc10:07:47

@bensu: I am using externs file from the google closure compiler people, so it actually works with advanced compilation as well.

robert-stuttaford10:07:27

@petrus: livecoding a game with figwheel that takes advantage of an undo stack is a pretty good call

robert-stuttaford10:07:31

chess is great for this

robert-stuttaford10:07:45

simple data model, well understood domain

casperc10:07:47

@bensu: I might try the foreign-libs thing - I am not sure what the pros and cons are though. Any idea? Do you still need to include the <script…> thing, or does that replace it?

bensu10:07:13

@casperc: I'll look at my markup.

Petrus Theron10:07:50

hmm chess could be a great one (I happened to have written a Chess AI in Java: https://github.com/pate/chessmate)

bensu10:07:01

@casperc: you don't need markup. Also, when it is included in foreign-libs now the compiler knows about, you can :require it and it gets pulled in the dependency graphs. If you are including <script "http://cdn.google.maps" > you are not puting the code through the closure compiler.

casperc10:07:56

@bensu: Yeah, so I guess it could actually optimize the google maps sourcein advanced mode (assuming they wrote it so that it is possible)?

bensu10:07:10

s/graphs/graph

bensu10:07:28

I'm not sure, I'd have to check if what I have is doing that or not.

bensu10:07:39

I'll get back to you, gotta work now simple_smile

casperc10:07:51

Alright, thanks simple_smile

dnolen11:07:42

@p14n: I just use the Emacs binding set and then I’ve a added bunch of my own things. I don’t really care about overriding the IntelliJ defaults as they are nearly always things I don’t use or things I would rebind anyway.

dnolen11:07:01

@p14n: the thing I’ve found most useful on OS X anyway for a more Emacs like experience - I just disable all the chrome. Then I add explicit bindings for everything I use all the time - Project Drawer, Debugger, Action Menu, Find Symbol, Run…, Terminal, Version Control.

dnolen11:07:47

Action Menu is one of the best since that’s effectively Meta-x

p14n11:07:13

It was watching your chromeless version in om.next that switched me back on to cursive simple_smile

Petrus Theron14:07:59

What are peeps using for games in ClojureScript? Reagent?

borkdude15:07:10

@dnolen: I thought it would be good if your webinar could be added to the README of core.async.

borkdude15:07:26

it already has a 'presentations' section

borkdude15:07:28

jira patch needed?

dnolen15:07:10

@borkdude: would have to check w/ other folks first but sure to the patch.

bensu15:07:12

@casperc: from what I can tell, there is no goog.closure compatible version of google.maps The google.maps call is just a loader for other code. The setup I sent you works with :optimizations :advanced as long as I don't have any google.maps symbols in my top forms, that get loaded before the maps code is.

ul16:07:43

@malcolmsparks: why do you use [& {:as params}] destructuring in bidi methods like path-for? I like bidi, but things like passing constructed map of route-params to path-for is pain, because I need to use smth. like (apply path-for (mapcat identity m))

ul16:07:32

And case when constructed map is passed is more frequent, and extra {} in inline case are not too tedious to write.

coyotespike16:07:52

How are y'all organizing your Secretary routes? Do you have a routes.cljs, leave them in core.cljs, or define them in each file/namespace?

coyotespike16:07:05

Not a critical question, I've just been wondering. So far I'm mainly leaving them in the individual page files.

ul16:07:51

@malcolmsparks: Thank! Scanned it, but not found pros of kv-args, only cons like I've described above.

ul16:07:15

So, if you count votes, my one is for map instead of kv 😉

tcrayford16:07:24

@ul it looks a bit cleaner. imo map is much better than kv though

malcolmsparks16:07:47

(mapcat identity m) is nice, haven't seen that before - I use (apply concat m) - but if you're calling path-for with constructed args, you're already jumping through hoops so the thinking is that one more is ok

ul16:07:03

who knows, one hoop less when there are lot of them is always nice 😉

tcrayford16:07:43

(all the libs are clojure rather than cljs, but still)

ul16:07:08

@malcolmsparks: sorry for my tone, i have no offensive intention, just bidi is the first library with kv convention which I started to use a lot in production, and not get used with need to make extra function calls, so feel some sort of pain

cfleming16:07:19

More debate than you ever wanted about kwargs vs explicit map here: https://groups.google.com/d/topic/clojure/yzLCZh-GiQ8/discussion

ul16:07:21

oh, no, this thread is older and longer than previous. i fear that a few year back more it should be a veeeeery long discusssion 😃

tcrayford16:07:33

re my (shameless) link: I read all of those threads in order to write that post simple_smile Tried to summarize it a bit.

lvh16:07:12

I’m trying to use Clojurescript to produce greasemonkey scripts that deal with a pretty gross existing DOM. Any suggestions for parsing stuff? Seems like hickory might be a good idea since it parses stuff to hiccup-style data structures which are probably a lot easier to deal with than native DOM objects...

lvh16:07:01

I’m not sure if I should just parse & hide and replace this entire DOM heap of junk, or if I should just play nice with the existing DOM (just thinking out loud, I appreciate that’s not really a useful point for anyone to meaningfully comment on)

ericnormand17:07:55

I got my om+core.async+cljs.js app "functional" last night

ericnormand17:07:27

with :simple optimizations, it compiles to 8MB

ericnormand17:07:44

but gzips to ~700KB

ericnormand17:07:48

which is acceptable

ericnormand17:07:16

the gui is not where it needs to be, but it's working

ericnormand17:07:26

I'll have a demo soon

teslanick17:07:33

gzip does a really good job with cljs with all those .call(s in there.

ericnormand18:07:20

Actually, I just rewatched it. It's "We are inside your thing."

lazy-lambda19:07:50

what should be equivalent clojurescript of $(‘id’).on(‘click’, function (e) { dosomething(); });

Pablo Fernandez19:07:44

When writing ClojureScript tests, is there a way to generate methods like if the application was being exercised by the user, like clicking a button?

bostonaholic20:07:06

@pupeno: easiest thing would be to extract all logic from the actual click handler. then wrap in tests the function that is called from the handler

teslanick20:07:37

@lazy-lambda: Using jQuery in clojurescript, or you want to know how you might do that in an idiomatic way in cljs?

Pablo Fernandez20:07:19

bostonaholic: doing it like that would test the function but not test the application. That would be a sad workaround. I’m looking for what options are out there to test clojurescript apps.

bostonaholic20:07:14

I don't know of any clojurescript specific web automation libraries, but any will do

Pablo Fernandez20:07:42

I haven’t found any yet, hence me asking.

lazy-lambda20:07:10

@teslanick: Using jQuery in cljs

teslanick20:07:25

(.on (js/$ "id") "click" (fn [_] (js/doSomething))) Alternatively:

(-> (js/$ "id")
    (.on "click" (fn [_] (js/doSomething))))

lvh20:07:19

If you’re greenfielding that’s probably not what you want to do though

lvh20:07:26

(consider using dommy instead)

chancerussell20:07:37

@lvh: Any feelings on goog.dom? I'm trying to get a sense for how widely used it is.

teslanick20:07:16

Or (js/document.querySelector "sel")

lvh20:07:05

dommy is p much just a set of macros that does the right thing (e.g. js/document.querySelector) at compile time

lvh20:07:13

chance: It’s around simple_smile

lvh20:07:32

chance: But Clojure(script) has non-screwy dependency mgmt so that’s not as strong of an argument

lvh20:07:08

It works, it does a thing, but it’s still goog.dom under the hood, i.e. it doesn’t really take advantage of all the cool compile-time stuff you can do in a lisp

lvh20:07:14

It’s great that it’s available thouhg

teslanick20:07:30

Yeah, that's a good point -- I tend to use the raw DOM API because it's what I'm really familiar with and I figure that when it starts causing me pain, I can transition to something smarter.

chancerussell21:07:06

@teslanick: Is that interop syntax (`(js/document.methodname)`) usually how you do it? Does that work in Clojure?

teslanick21:07:46

Yeah; periods are de-facto allowed in symbols, even though the spec says they aren't.

dnolen21:07:31

@chancerussell: does not work in Clojure and it will never change in ClojureScript

dnolen21:07:43

would cause massive amounts of breakage at this point

chancerussell21:07:55

@teslanick @dnolen Thanks. Think I'll stick to the other syntax and save some brain space.

dnolen21:07:54

for the curious, this form of property access has been there since Rich did the first version of ClojureScript in 2011 far as I know

Joe R. Smith21:07:05

My understanding is it is the idiomatic way to call constructors that are properties on object(s)

danielcompton23:07:16

@dnolen: is this just establishing parity with Clojure 1.7 while keeping the current release strategy?

dnolen23:07:37

@danielcompton: yep this is not about semantic versioning or anything