Fork me on GitHub
#clojurescript
<
2015-11-16
>
danielcompton01:11:27

How can I build a clojurescript JAR from source?

danielcompton01:11:39

I looked at the wiki and couldn’t find any instructions

bherrmann02:11:20

@danielcompton: I presume the QuickStart should contain all the raw information https://github.com/clojure/clojurescript/wiki/Quick-Start

danielcompton02:11:01

script/build looks to be the way though

mbertheau09:11:45

How do I require specter? I added [com.rpl/specter "0.8.0"] to build.boot, but still get an error no such namespace when I try to require specter. I tried (:require [specter :as s]), (:require [com.rpl/specter :as s]), (:require [specter.specter :as s]).

roelof09:11:07

Can I programm in clojure on windows or can I better use a cloud enviroment so I can use Linux ?

martinklepsch09:11:38

@mbertheau: namespaces never contain slashes, check the readme to find out which namespace you need

mbertheau09:11:50

@martinklepsch: There's nothing in the README about that. It's a cljx library. cljs 1.7.0 should be enough for that, right? Do I have to enable something in order to get .cljx-support?

martinklepsch09:11:39

com.rpl.specter

mbertheau09:11:07

That works! Thanks simple_smile

martinklepsch09:11:32

That was the namespace of the cljx file :)

mbertheau09:11:26

So it's basically the path to the clojure(script) file, with dots instead of slashes.

mbertheau09:11:52

In boot repl --client after (start-repl) after doing (:require [some.lib :as s]) I still get "No such namespace s" when I try to use for example s/transform? some.lib/transform works as expected.

martinklepsch09:11:21

This is more of a #boot question.. The reason is that start-repl starts a new clojurescript repl. Any requires/state/other defined thing will be gone

martinklepsch09:11:48

@mbertheau: ^

mbertheau10:11:20

@martinklepsch: I'm doing that in the repl after (start-repl). Shouldn't it work then?

martinklepsch10:11:07

After start repl you will have a fresh cljs repl, requiring you to require things again if wanted.

martinklepsch10:11:31

1. Start repl 2. Require 3. Use :)

mbertheau10:11:16

Ah. My mistake was that I did (:require) instead of (require). Thanks! simple_smile

isaac17:11:12

(defn foo [x] ^:a (fn [])) Unexpected keyword 'return' eval (NO_SOURCE_FILE) planck$repl$caching_js_eval (planck/repl.cljs:369:4) cljs$js$eval_str_STAR__$compileloop (cljs/js.cljs:1693:16) cljs$js$eval_str_STAR_ (cljs/js.cljs:1715:6) cljs$core$IFn$_invoke$arity$5 (cljs/js.cljs:1818:30) planck$repl$process_execute_source (planck/repl.cljs:698:6) planck$repl$execute_source (planck/repl.cljs:738:12) planck$repl$execute (planck/repl.cljs:742:4)

isaac17:11:46

Clojure eval this correctly

tmtwd18:11:07

if clojurescript compiles to itself now, doesn’t that remove the advantages of the closure library, ie having highly portable code across browsers and speed?

martinklepsch18:11:47

@tmtwd: the majority of people still use closure and will continue to. the objective of self hosting is not to make compilation with closure/jvm redundant

tmtwd18:11:17

it is for writing code in the browser?

martinklepsch18:11:44

@tmtwd: yeah. the things where I’ve seen self-hosted clojurescript being used were mostly situations where jvm was not available or practical

martinklepsch18:11:09

@tmtwd: I think there is a wiki page on self-hosting that you probably want to check out simple_smile

richiardiandrea18:11:37

Hey (self-ashamed), there is also replumb to try now 😄 -> https://github.com/ScalaConsultants/replumb

tavistock22:11:25

when using figwheel I got cider emacs connected, but I want to use the cljs.user namespace and it wont let me. What should I try

tavistock22:11:11

I have a figwheel repl open to port 7888 and do m-x connect-cider then go to a repl buffer and can see cljs.{ns} messages from the figwheel but I can’t issue commands to cljs.

clumsyjedi22:11:27

what is the status of cljs.pprint/pprint? I see references to it online, but when I attempt to call it I get Cannot call method 'call' of undefined

clumsyjedi22:11:41

this is with a rhino repl and cljs 1.7.170

noonian22:11:09

make sure you require it

clumsyjedi22:11:30

I have done (require ‘cljs.pprint)

clumsyjedi22:11:07

in my repl I get tab completion for (cljs.pprint/ showing

cljs.pprint/deftype                cljs.pprint/formatter
cljs.pprint/formatter-out          cljs.pprint/getf
cljs.pprint/pp                     cljs.pprint/pprint-logical-block
cljs.pprint/print-length-loop      cljs.pprint/setf
cljs.pprint/with-pprint-dispatch   cljs.pprint/with-pretty-writer

noonian22:11:50

hmm, I’m using it in my browser repl successfully and its being required by my app. I haven’t actually used it from rhino.

noonian22:11:36

try cljs.pprint/pp, that isn’t defined for me so maybe you have a different version of pprint somehow

clumsyjedi22:11:56

org.mozilla.javascript.EcmaError: ReferenceError: "console" is not defined. (rhino.clj#41)

clumsyjedi22:11:10

hmm does this mean pprint has a “proper browser” requirement

noonian22:11:57

Are you sure you are in a cljs repl? I suspect the cljs.pprint that you required is the clj macros file and not the cljs ns since all of those are macros: https://crossclj.info/ns/org.clojure/clojurescript/latest/cljs.pprint.html

clumsyjedi23:11:16

pretty sure,

cljs.user=> (clj->js {:foo :bar})
#js {:foo "bar”}

noonian23:11:53

I just tried from a freshly created figwheel template and it worked for me with lein trampoline cljsbuild repl-rhino. cljs.pprint/pprint was defined even without requiring it in the default user ns.

noonian23:11:02

so definitely doesn’t need the browser

noonian23:11:03

so it sounds to me like your repl is messed up somehow 😕

noonian23:11:51

got it working?

clumsyjedi23:11:08

no, sorry, that was a sarcastic hooray regarding my messed up repl

clumsyjedi23:11:28

I will poke at it some more, see if I can remove some bits and see what is “special” about my setup

clumsyjedi23:11:04

it works using lein do clean, trampoline cljsbuild repl-rhino

clumsyjedi23:11:33

but not when I use piggieback, which is what I was doing

noonian23:11:50

Ah, I see. I don’t have any experience with nrepl or piggieback so I probably can’t help you there.

clumsyjedi23:11:19

thanks for your help so far, it’s been informative