Fork me on GitHub
#clojurescript
<
2015-10-30
>
dvcrn03:10:48

what's the best way to GET load some stuff inside nodejs?

dvcrn03:10:23

can't use the XhrIo because XMLHttpRequest is not available

nowprovision04:10:53

using secretary, I do secretary/dispatch! /blah/id and it seems to work as desired (fires the right route etc..) but the url doesn't change, what am i missing

nowprovision05:10:21

okay so I have the secretary html5 history working correctly now, but in my main method I still have to do (sec/dispatch! (-> js/window .-location .-pathname)) is this normal?

nowprovision05:10:31

to get the initial load correct

dvcrn05:10:16

@nowprovision: that still relies on XMLHttpRequest which isn't available on node

dot_treo07:10:42

@dvcrn: why don't you just use a node module directly? https://nodejs.org/api/http.html#http_http_get_options_callback looks like it would be pretty simple to use

dvcrn07:10:37

yep that's what I ended up doing but was hoping there is something more clojure-ey

dot_treo07:10:23

there is probably a node js wrapper module that provides the api of XMLHttpRequest so cljs-ajax could be made to work, but if you use the node specific code only in one place that might be too much work

bhauman17:10:25

@dnolen: anybody out there simple_smile

richiardiandrea17:10:38

hello @dnolen, @mfikes , can I ask you if I need to worry about:

Oct 30, 2015 10:07:33 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ...../replumb/repl.js:782: ERROR - @define variable cljs.core._STAR_target_STAR_ assignment must be global
cljs.core._STAR_target_STAR_ = "default";
when I compile with :advanced and if I can solve it? I set it with set! at the moment inside a function:
(set! *target* "default")

mfikes17:10:24

@richiardiandrea: I don't know what that error is. I stick with :none for self-host FWIW

dnolen18:10:28

@cfleming: you’re probably busy but have you had a chance to look at Socket REPL support yet?

cfleming18:10:37

@dnolen: No, it’ll be post-conj at this stage I think.

ckirkendall19:10:43

I feel like I am late to the party, I didn't know this existed until today. simple_smile

shaun-mahood20:10:56

Pretty sure I'm doing something dumb, wondering if anyone can give me some troubleshooting hints. I'm trying to get figwheel running through a script as in the om.next tutorials, but on an existing project. I can get lein figwheel working fine, but when I run it through the script I get the error

Could not locate figwheel_sidecar/repl__init.class or figwheel_sidecar/repl.clj on classpath.
I've tried all the things I can think of, and have it working fine in the om-tutorial. There's just something here I'm missing.

otijhuis20:10:29

@shaun-mahood: did you add figwheel-sidecar to the dependencies?

thosmos20:10:13

I'm trying to compile a simple mies hello world app into modules, but I keep getting a java.lang.NullPointerException during the build. The error is on the README of the git repo: https://github.com/thos37/moduletest This is my build script: https://github.com/thos37/moduletest/blob/master/scripts/release.clj see anything wrong?

otijhuis20:10:12

@shaun-mahood: hmm, would be helpful to see your project configuration

shaun-mahood20:10:12

@otijhuis: Going to try 1 or 2 more things and will post it if they don't work

thosmos20:10:20

@shaun-mahood: did you add figwheel sidecar to the global deps or just a dev profile?

thosmos20:10:03

also, did you try lein clean, rm -rf target, etc?

shaun-mahood20:10:35

@thosmos: Included in global deps, lein clean etc. didn't fix it.

thosmos20:10:14

also is this from the commandline or an IDE?

thosmos20:10:13

I've found that I've had to manually refresh the leiningen projects in Cursive to get deps updated

shaun-mahood20:10:14

I've narrowed it down to a problem with figwheel-sidecar, can't include it in any cljs file without breaking it.

otijhuis20:10:57

@shaun-mahood: I take it you are using something like lein run -m clojure.main script/figwheel.clj to start it?

shaun-mahood20:10:49

Trying to get it running through cursive, but pretty sure it's not seeing figwheel-sidecar properly at all.

otijhuis21:10:36

Probably a classpath issue then I'd guess. Try it from the commandline first. Should work.

shaun-mahood21:10:13

Back to the quick start I guess to figure out what basics I've gotten wrong this time simple_smile

chrisn21:10:08

When I try to use :optimizations :whitespace with cljsbuild test I get an odd error: goog.require could not find cljsjs.react.

thosmos21:10:13

@shaun-mahood: did you manually refresh the leiningen project file from the Cursive side panel?

shaun-mahood21:10:47

@thosmos: Yeah, didn't help. It's something going on with requiring figwheel-sidecar, might have to leave figuring it out until next week though.

shaun-mahood21:10:42

At least now I know where the issue is, before I was thinking it was an issue with either cursive or my figwheel script. Thanks @otijhuis and @thosmos for the help

r0man21:10:55

Just pushed sablono 0.4.0-SNAPSHOT to Clojars. It doesn't depend on a specific version of React anymore. It should now work with om.next.

otijhuis21:10:15

Anyone know how I can get the analysis environment of the current running repl?

artemyarulin21:10:20

does anybody know - can I use core.typed with clojureScript?

thosmos21:10:02

yeah literally just reading that now

thosmos21:10:20

thanks for the tip anyway though simple_smile

bensu21:10:37

@thosmos: sorry! the regression is fixed on master, if you want to try it.

bensu21:10:18

@chrisn: avoid :whitespace unless you now why you want it. try :simple instead, it might work better

chrisn22:10:32

I thought it would make life easier. Turns out this is definitely not the case. I am trying to build a docker container that will allow us to run our tests against various deployed backends, and in the process learned about output-dir and asset path. Works at this point simple_smile which means I just need phantomjs and then I have a test runner and I can run a subset of our unit tests on any machine against any machine.

bensu22:10:18

@chrisn: cool! one thing, I don't think :asset-path influences :whitespace or :simple at all. It's there only for :none (or :output-dir for that matter)

chrisn22:10:40

I reverted to none. I couldn't for the life of me figure out :whitespace

bensu22:10:11

hmmm that's strange, :simple is usually easier to get going in a testing environment

bensu22:10:32

the compilation works well and it produces only one artifact, which reduces the chance of linking errors

bensu22:10:40

but if it works don't touch it 😄

thosmos22:10:57

@bensu: 1.7.160 worked! thanks simple_smile

bensu22:10:47

@thosmos: cool! it was a rather straightforward fix

cfleming23:10:23

@thosmos: Have you found that you have to manually refresh dependencies before running the REPL? Are you using a lein REPL or a clojure.main one?