Fork me on GitHub
#clojurescript
<
2015-06-29
>
shaunlebron00:06:43

@jamiei: do you have example code?

shaunlebron00:06:29

seems dependent on what you’re doing in the defroutes

Paco01:06:47

Hey guys is there a library or a tutorial that I can use for learning how to handle touch events in clojurescript?

Paco01:06:31

My reagent components only have on-click events and I am wondering if I should use something like this: http://benhowdle.im/touche/

Paco01:06:43

or handle them myself.

shaunlebron04:06:08

@kidpollo: I’ve used the popular hammer.js for touch events in cljs

Paco04:06:25

cool cool thanks

jamiei09:06:47

@shaunlebron: Something like this example: http://pastebin.com/iaHCRCMh - Do I need to use shared state to communicate which contact id is being viewed to the component view?

braai engineer10:06:03

@sander, thank you! The :nrepl-port setting was commented out in my project.clj.

braai engineer11:06:37

I refactored a util namespace into a folder, so that qt.utils -> qt.utils.core, and now I'm seeing Uncaught ReferenceError: goog is not defined in the browser console on force-reload, but everything compiled OK. I have tried lein clean, a bazooka rm -rf of public resources and (reset-autobuild). What am I doing wrong?

braai engineer11:06:23

Looks like this was related to trying to run a cljs-repl from Cursive 😕

braai engineer12:06:09

@cfleming: when I stopped my Cursive cljs-repl and relied on the repl in lein figwheel only, it started working again. But it could have been some weird repl state.

braai engineer12:06:43

Does anyone have a "time remaining" function lying around that humanises seconds to "5 days", "4 hours", "32 minutes"? Would save me some time.

cfleming13:06:48

@petrus: There was a lib mentioned in the Clojure Cookbook, but I don’t remember the name - humanize, perhaps?

rauh13:06:28

@petrus: goog.date.duration

escherize14:06:40

wow this is #3 on HN right now: https://news.ycombinator.com

jonpither15:06:15

^ Apologies for the spam simple_smile

tcrayford15:06:32

@jonpither: if you want more upvotes, note that votes that come from a direct link to stories on HN don't count directly (it's better to direct folk to /newest or the homepage) 😉

tcrayford15:06:45

H A C K E R N E W S H A C K I N G

shaunlebron15:06:16

@rauh: that’s neat, do you generally find useful things in goog by looking through tests?

rauh15:06:44

@shaunlebron: Actually, yes that's the first think I consult. Github's search made a few things obsolete for me. The goog closure docs are aweful all together. I just entered "hours minutes" in the search box in the closure github repo and it came right up

shaunlebron15:06:36

I thought this was a good attempt: http://www.closurecheatsheet.com/

rauh15:06:45

A global github search with "extension:cljs" or "filename:project.clj" is done many times a day simple_smile

shaunlebron15:06:56

missing some things though

escherize15:06:59

noted + changed link: thanks @tcrayford

rauh15:06:03

@shaunlebron: Yeah that cheat sheet is cool indeed. I always like examples. I bookmakred that the other day. But I forgot it exists already simple_smile

shaunlebron15:06:48

@rauh, I guess the global search you just mentioned is not related to your closure searching?

rauh15:06:42

@shaunlebron: No, i sometimes use one or the other. When I need more examples for cljs then I do a global wide search limited to extension and search for "require goog.foo.bar" for instance

shaunlebron15:06:11

wow, that’s powerful, never thought to do that

rauh15:06:32

I even added a search keyword to chrome so I can search it really really quick

rauh15:06:51

I do the same for emacs lisp often. There is just soo many examples out there

txus17:06:13

hey! I’m using om-sync and, following the Readme example, I get two strange things:

txus17:06:38

anything I tag with :create ends up sending the whole :coll to the server, not only the element I tagged ([:create new-element])

txus17:06:58

and anything I tag with :delete sends nothing, even if I tag it with [:delete thing-i-just-deleted]

txus17:06:06

any ideas? :S

denik17:06:14

@txus maybe best ask in #C06DT2YSY chan

txus17:06:24

oh nice! didnt know

shaunlebron18:06:27

added a new wiki entry for using Google Closure Library in ClojureScript (based on @bostonou’s blogs, and @rauh’s searching strategies): https://github.com/clojure/clojurescript/wiki/Google-Closure-Library

shaunlebron18:06:35

corrections and stuff appreciated!

rauh18:06:34

Thanks for that! simple_smile

shaunlebron18:06:50

@jamiei: it has to go in your app state somewhere or shared state when your defroute is executed

shaunlebron18:06:58

check out #C06DT2YSY chan to see what they say

mfikes20:06:39

If you are interested in beta testing Replete, doing signups now. simple_smile https://github.com/mfikes/replete/wiki/Beta

arohner21:06:24

when I’m chasing down an advanced compilation bug, I typically have to lein do clean, cljsbuild once prod, i.e. auto prod doesn’t seem to pick up changes to my externs.js file. Is there a faster way?

arohner21:06:31

a full recompile takes ~120s

brettevans21:06:26

@mfikes awesome! Running it now, I might have to make a lisp keyboard for this...

mfikes21:06:06

@brettevans: That would be useful!

braai engineer22:06:16

I'm struggling to run my cljs tests using is from cljs.test. Trying to run tests from the REPL throws: cljs.test Cannot read property 'do_report' of undefined> clojure.core/ex-info (core.clj:4591). Running lein test runs zero tests. How do I get lein test to run my ClojureScript tests or fix my code so I can run tests from the REPL?

andrea.crotti22:06:30

@petrus I think it's should be "lein cljsbuild test" instead

andrea.crotti22:06:55

You can make an alias in your project.clj

dnolen23:06:46

@arohner: I would verify that built-in auto-building (a la Quick Start) exhibits the same issue.

dnolen23:06:52

that said, ~120s to build seem excessive to me (I've never seen it take that long even for super massive projects).

dnolen23:06:32

If you're not compiling 60,000 lines of ClojureScript, usually means you need to tweak your JVM settings.

arohner23:06:03

@dnolen: are there any CLJS-specific optimizations, or just the usual stuff about -server, Xmx, GC algo?

dnolen23:06:26

@arohner: Google Closure advanced compilation is very RAM hungry. Try 1g, then 2g etc.

dnolen23:06:15

@arohner: would also use the :verbose compiler option to get a view into where things are stalling. There are a couple of other known issues if your project is large.

arohner23:06:08

I only have 1-2k of CLJS

arohner23:06:26

but I’m also using jQuery as a foreign lib

dnolen23:06:27

yeah 120s doesn't make sense then

dnolen23:06:41

Closure will never see jQuery

dnolen23:06:50

the other issue, a known polynomial problem with :recompile-dependents. Try setting this to false.

dnolen23:06:52

@mfikes: so awesome! And only 3 day after EuroClojure simple_smile

dnolen23:06:53

yes the iOS REPL

mfikes23:06:29

@dnolen: simple_smile I was away from computers for a week (London trip). Perhaps I pent up the need to do something related to ClojureScript. But, seriously, you enabled this. simple_smile Joel pushed it over the edge.

mfikes23:06:26

@dnolen: I had / have a fear of Apple rejection based on the app being too “simple.” But there are many human-years of effort underneath it enabling it to exist.