Fork me on GitHub
#clojurescript
<
2015-12-16
>
virmundi02:12:44

Hello. I think I'm not getting requiring macros. I get this warning Use of undeclared Var dommy.core/selector

virmundi02:12:01

My ns has this line (:require-macros [dommy.core :refer [sel sel1]])

virmundi02:12:05

The dommy docs have (:require [dommy.core :refer-macros [sel sel1]])

virmundi02:12:59

If i do it the dommy doc way, I get it to work

bensu02:12:55

@virmundi: what is the problem? sel and sel1 are macros, you need to tell ClojureScript to get them from dommy/core.clj instead from dommy/core.cljs

virmundi02:12:58

Isn't that what (:require-macros) does?

bensu02:12:54

ahhh I missread.

virmundi02:12:17

It's odd that the second way works while the first doesn't

bensu02:12:37

if you only require the macros, you might be missing the clojurescript namespace that contains dommy.core/selector

denisj05:12:22

Anyone have an example of how to get the caller of a cljs fn , somewhat like in JS you can do

function Hello()
{
    alert("caller is " + arguments.callee.caller.toString());
}

cjmurphy05:12:16

I just did a search for 'bureaucracy clojurescript' and could not find the framework.

cjmurphy05:12:50

But I know it exists because I saw a talk on it at Sydney Clojure meetup.

cjmurphy05:12:21

I'd better try harder, should be on Github...

cjmurphy05:12:57

It is a framework where the view is a state machine...

mikethompson05:12:34

Sam Roberton gave that talk.

mikethompson05:12:49

I think it is still a work in progress

mikethompson05:12:08

Not sure if the repo has made it into the public yet

ashercoren11:12:32

I'm trying to use a non-minfied version of a library (`cljsjs/react-with-addons`) even when my app is compiled in advance compilation mode. Is there a way to do that?

martinklepsch12:12:28

@ashercoren: not with the default cljsjs packages I think. You can fork the packages repo and make sure the minified build is not downloaded, then rebuild locally: boot package build-jar

dnolen13:12:29

@denisj: not recommended but (.toString js/arguments.callee.caller) will work

ashercoren13:12:12

@juhoteperi: I saw that link. The only way that worked for me was when I modified the src/cljs/deps.cljs of the cljsjs package. That is the same as @martinklepsch suggested. Isn't there a way to do it while using the original package?

mfikes13:12:50

Very cool: @sherbondy has ClojureScript running on Apple TV, driving Ejecta UI and manipulating it via a REPL. (Cool thing for all of us is that the workflow for this target platform is the same we all know and love.): https://youtu.be/eaWy5mliO38

dnolen13:12:26

@mfikes: haha that’s awesome

mfikes13:12:57

When will it stop? Unbelievably new things keep occurring simple_smile

dnolen13:12:58

@mfikes very cool to see Rich Hickey’s goal for ClojureScript bearing fruit

mfikes13:12:33

Yes, reach is undeniable. How did Rich know?

jaen13:12:07

Well, node was out for 2 years. Phonegap is about as old as Clojurescript. It was not an unreasonable guess things will keep going that way, I suppose. Cool to see it was on mark.

juhoteperi13:12:40

@ashercoren: Looks like it's not possible to override Cljsjs deps.cljs from local deps.cljs, but overriding using compiler-options :foreign-libs should work

ashercoren13:12:37

@juhoteperi: I tried that as well :foreign-libs [{:provides ["cljs.react"] :file "cljsjs/development/react-with-addons.inc.js"}]. Didn't work

juhoteperi13:12:06

@ashercoren: You need to provide both file and file-min, because deps.cljs and local options are merged with merge

danbunea13:12:48

Hi, I'm trying to undestand why an exception is not caught (new to cljs, but I think it is what I've been searching all my life). I explained it here: http://stackoverflow.com/questions/34312417/clojurescript-reagent-handling-errors . Basically, the code is like: '(defn change-title [title] (try (swap! app-state #(-> % (assoc :text title) ((fn [state] (throw "there is an error"))) )) (catch js/Object e (swap! errors conj e))))'

danbunea13:12:09

(change-title "a")

danbunea13:12:16

never catches the error

juhoteperi13:12:36

@ashercoren: Tried it and can't get it working myself. But should work...

ashercoren13:12:47

@juhoteperi: Still didn't work. It still compiles the minified version

mfikes13:12:35

@danbunea: (js* "'hi' instanceof Object”) evaluates to false.

dnolen14:12:32

@danbunea: if you want to catch all errors you need (catch :default e …)

mfikes14:12:59

On the subject of throwing, is cljs.core/ex-info idiomatic, or at least common, to use?

mfikes14:12:09

Looks like if you want to portably use ex-info the data argument should be a map.

dnolen14:12:34

@mfikes: yes ex-info is a way to write portable error handling

danbunea14:12:57

didn't know about ex-info, so thank you again!

jindrichm15:12:58

I need cljs-http.core/jsonp not to keywordize response keys (https://github.com/r0man/cljs-http/blob/master/src/cljs_http/core.cljs#L116). What would you suggest to do?

dnolen15:12:18

@jindrichm: if there’s not an official way to do that, file an issue

dnolen15:12:53

fwiw I do not bother with these kinds of libraries if it’s not buying me some shared abstraction across Clojure(Script) Google Closure is not that hard to use.

jindrichm15:12:56

@dnolen: OK, thanks for the hint.

mfikes17:12:34

I wrote a post about @sherbondy’s Apple TV work and also submitted it to HN. “ClojureScript on Apple TV” http://blog.fikesfarm.com/posts/2015-12-16-clojurescript-on-apple-tv.html

jaredly18:12:37

> However, "encapsulating" the run-time state of your application inside the code that renders its views is like encapsulating your keys down the back of the couch https://github.com/samroberton/bureaucracy/blob/master/doc/Motivation.md 😄

puppybits18:12:57

I finally wrote a post on ClojureScript, RxJS and CLJS interop w/ vanillaJS & React. I’m not sure I’ve conflated issues but I’d love if anyone has feedback on what we’ve been doing at Capital One. http://bit.ly/whats-after-rxjs

dnolen19:12:12

@puppybits: thanks for writing that up!

dnolen19:12:30

@puppybits: small typo FPR instead of FRP in one place

dnolen19:12:42

is this already advertised to the world?

puppybits19:12:07

doh. thanks. I’ve got a bit of dyslexia.

puppybits19:12:24

I posted it 30 minutes ago.

jaredly19:12:37

@puppybits: very interesting read, thanks!

jaredly19:12:53

> Functions used in a transducer don’t know {their -> they’re} in a transducer. Basically I can {reusable -> reuse}

puppybits19:12:43

thanks. I’m not sure if it’s good or bad but it seems to work well for us. I’m sure there’s room for improvement.

puppybits19:12:07

crap. I should really get someone to proof read my post before I send them out.

jaredly19:12:10

I’ve been thinking a lot about Observables vs CSP lately, and this was a great perspective

puppybits19:12:08

The atom watchers have been great for the observables usually we have a component that has one or two atoms for caching. The JS world can pass in a callback to get notified when it changes.

puppybits19:12:01

Usually there’s one or 2 smart components on the page in the willMount and didUnmount call triforce.accounts(accounts => this.setState({accounts}). If there’s accounts cached in the cljs component it triggers right away and anytime there’s a change it triggers the callback again.

jaredly19:12:14

cool! I hadn’t thought of atoms as an obervable-replacement before, but it makes sense

zane19:12:50

Is ClojureScript: Up and Running still the best comprehensive resource for people who want a longform hand-holding guide to getting started with the language?

maria19:12:42

@zane: ClojureScript Up and Running is a bit outdated, so I would instead have a look at modern-cljs (https://github.com/magomimmo/modern-cljs) and ClojureScript Unraveled (https://funcool.github.io/clojurescript-unraveled/)

puppybits19:12:45

I used Andrew Antukh’s online book: https://www.niwi.nz/cljs-workshop/ and the Joy of Clojure (super dense and covers everything).

vlza20:12:27

Hey everyone. Does anybody knows where can I find good examples of om-next (docs, projects, videos)? Thanks.

dnolen20:12:07

@vlza there is an #C06DT2YSY specific channel

hugobessaa22:12:54

Finally using ClojureScript at work :)

hugobessaa22:12:17

Anybody needed a rest mapper already?

hugobessaa22:12:35

Looking for better ways to deal with an API

hugobessaa22:12:55

Taking a look right now

darwin22:12:46

I have just open-sourced Dirac give it a try: https://github.com/binaryage/dirac this is still a rough pre 0.1, but promising @jaen @bhauman @shaunlebron ^

darwin23:12:00

@dnolen: thanks, got tired waiting for https://code.google.com/p/chromium/issues/detail?id=484261, decided to bend DevTools on my own

richiardiandrea23:12:47

it looks awesome, thanks!

jaen23:12:59

@darwin: wowowow, this is so awesome; I see it has figwheel in dependencies - how tightly coupled it is? (just wondering how hard would it be to use with The Other Build Tool)

jaen23:12:02

Also, is that Cljs REPL aware of the current stack framew when debugging? Or if not - is that something that could be done?

darwin23:12:49

@jaen: it does not talk to figwheel directly, it talks to cljs-devtools and cljs-devtools talks to figwheel, so that can be extended in the future to talk to some other tool, or replace cljs-devtools completely

darwin23:12:01

This is current API Dirac can call (actually just eval and warm-up-repl-connection): https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/api.cljs This is current code providing information to Dirac: https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/dirac.cljs In the beginning I wanted Dirac to be able to connect directly to nREPL, but that seemed like a lot of work, because there is no nREPL cljs library.

darwin23:12:30

> Also, is that Cljs REPL aware of the current stack framew when debugging? that is my next goal, it will be pretty easy, will just need to send compiled cljs to dirac, not eval-ing it in client javascript context

darwin23:12:30

this will require another figwheel patch, because eval will have to be async

jaen23:12:37

High levels of whoa; being able to eval Clojurescript in the context of currently debugged code is about the only thing lacking from seamless debugging experience.

jaen23:12:12

I'll have to see if boot-cljs-repl offers a similar API to figwheel, would be cool to be able to use that.

darwin23:12:29

@jaen I’m not familiar with boot-cljs-repl, I’m still stuck with lein, because I don’t want to give up figwheel

darwin23:12:24

there were only two difficult things on figwheel side: 1) how to hook into REPL loop (reading from std-in is blocking) 2) how to capture stdout and stderr exactly, so it can be presented on client-side as it appeared in the terminal (there are some weird cases where some code prints directly to out and err (imagine a macro printing warnings using println, or a code handling exceptions printing directly to err), so to be done properly it must be done on pretty low level))