Fork me on GitHub
#clojurescript
<
2016-06-21
>
urbanslug06:06:46

Doesn’t cljs async have <!! ??

tap06:06:55

@urbanslug: No. It would block the whole js runtime

pvinis07:06:36

how do i import react components in reagent?

wilkerlucio11:06:14

hello, since cljs 1.9.76 something went wrong on the cljs.spec.test/check-var, the implementation tries to use fn-specs, which was removed at some point. the CLJ version uses a fn-spec function that I don't see available on cljs as well, currently any call to cljs.spec.test/check-var seems to fail for this reason

mfikes12:06:47

@wilkerlucio: Likely a regression. I’d suggest a dropping simple REPL-based repro in JIRA.

dnolen13:06:50

already done 🙂

wilkerlucio13:06:09

haha, you got me on a refresh delay 🙂

royalaid15:06:48

Just posted this in the #C077KDE3A channel but figured I might ask for help here. I am playing around with Luminus and Sente and am currently trying to setup login+auth. I was wondering how you are supposed to actually to the authentication for the user. I found https://github.com/ptaoussanis/sente/issues/118#issuecomment-87378277 which kinda explains what I need to do but my app always seems to need the page to be refreshed for the session to actually be recognized. Any advice?

lwhorton17:06:51

hey guys - i’m at a loss for where to get started to solve this problem and I’m hoping someone can point me in the right direction: I want to use stylus-lang’s programmatic API (or even the CLI) to compile some .styl files, but I want to be able to do that from within a portable boot task. If there doesn’t exist a clojars wrapper around the API, how can I make one? The conceptual problem I’m having is “how do I run a node-only API from within clojure.. and how can I explicitly list node as a dependency?"

martinklepsch17:06:04

@lwhorton: you can shell out inside boot tasks and call node scripts. There's no built in dependency mechanism but it's not to hard too build your own, see boot-notify which checks if the terminal-notifier program is available: https://github.com/jeluard/boot-notify/blob/master/src/jeluard/boot_notify.clj

lwhorton17:06:08

Aha. That’s probably way simpler than what I was about to do. A big help as always @martinklepsch

martinklepsch17:06:19

@lwhorton: what did you intend to do?

lwhorton17:06:40

I’m in the middle of a real poop-storm. I have a working boot-task that takes all .styl files, compiles them to css-modules, and generates clojurescript modules with a tiny runtime to manage things. As I move to a second project I really want to reuse this task without copy/pasting from 1 boot file to another. I haven’t ever managed or published a boot task, though, so i’m bumping into hurdles left and right. The tasks is kinda a patchwork of whatever I could get to work — stylus’ cli, some conch execution, etc.

lwhorton17:06:24

My plan was to build a task that has a clj and a cljs component, and somehow use the cljs runtime to execute the node api I need.

martinklepsch17:06:37

Yeah, if possible just using Stylus' CLI stuff will likely be much easier 🙂

dnolen21:06:07

@wilkerlucio: I just cut a pre-release 1.9.88 if you’re looking for something with the fix

wilkerlucio21:06:16

@dnolen: thanks, since this morning I was using it from the sources, had no issues since then

kenny21:06:35

Is forward declaration from a var in another namespace possible in cljs?

darwin21:06:37

@kenny: I would drop to js lands and use interop to break the cycle

kenny21:06:37

@darwin: How is that possible when working with cljs files? Wouldn't that break with advanced compilation?

darwin21:06:16

no, it will work just fine, instead of forward declaration, implement a getter function, which uses js-interop to retrieve the value

darwin21:06:53

well, assuming your interop code is understood by closure advanced compiler the same way as your generated javascript from clojurescript sources

kenny21:06:31

I think I would need to ^:export the fn.

darwin21:06:53

that would be a safe bet, but it should work either way IMO

kenny21:06:24

What is it initially getting the val from? js/???

darwin21:06:56

@kenny: don’t understand the question

kenny21:06:44

I believe it is js/window.

(aget js/window "my" "ns" "myfn")

darwin21:06:19

yes (in browser)

darwin21:06:46

but you should not be using aget if you care about advanced optimizations

darwin21:06:16

you must use direct js interop, so your names participate in the renaming

darwin21:06:30

you want to use .- or .. notation

peterschwarz22:06:25

Scripting question: So I am using the cljs.build.api functions for building my project, and I would like to fail my build (for CI purposes) on certain (or maybe all) warnings - e.g. missing var. These currently don't cause a build failure. Can anyone point me to an example for this, or at least the path I could follow to implement this in my scripts?

peterschwarz22:06:02

I'm not seeing any compiler options for elevating warnings to errors, so I'm guessing I need to handle this myself somehow?

darwin22:06:54

Not sure if there is any built-in solution, but I would probably capture stdout of the child process and use a dirty regex to detect warnings.

darwin22:06:45

or if it runs in-process, you could probably capture it with with-out-str or similar

darwin22:06:35

just some wild ideas, never used cljs.build.api myself