This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-25
Channels
- # admin-announcements (19)
- # alda (73)
- # announcements (1)
- # aws (16)
- # beginners (22)
- # boot (109)
- # cljs-dev (1)
- # clojure (79)
- # clojure-art (3)
- # clojure-czech (2)
- # clojure-russia (233)
- # clojure-sweden (2)
- # clojurescript (161)
- # clojurex (25)
- # core-async (2)
- # cursive (4)
- # datomic (11)
- # editors (17)
- # emacs (3)
- # funcool (4)
- # hoplon (72)
- # ldnclj (29)
- # off-topic (1)
- # om (9)
- # onyx (13)
- # reactive (10)
- # reagent (13)
- # yada (4)
https://github.com/josf/cljs-xml/blob/master/src/cljs_xml/core.cljs <= definitely lots of code using that ns
hey guys, is it possible to find out the line number of an error when I get that error in a minified Google Closure Compiler file?
in Quick Start, the example node_repl.clj
doesn’t include :target :nodejs
in the cljs.build.api/build
spec. therefore, after running it, node out/main.js
doesn’t work since it’s built for the browser. can i fix the tutorial or am i wrong?
@raspasov: have you got sourcemaps setup?
@raspasov: yes source maps work with advanced compilation too.
I've setup a (failing) test project for that, see https://github.com/bsteuber/ciderfig
@bteuber: sort of
let me find a link...
@bteuber: some good notes in https://github.com/bhauman/lein-figwheel/issues/244 - my (semi-working config is in the last comment)
yeah, 0.4.0 no longer hard-depends on piggieback so you need to add that in
I think so. I have cobbled this together from https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl
and the front page for piggieback and figwheel github projects
but I certainly haven’t studied all the different options in depth.
@colin.yates: btw. what do you mean "semi-work"? Sth. like getting an ns-as-map dispatch error every now and then?
no, I don’t get that, but if I open up a Clojure and a ClojureScript REPL then all evaluation goes to the Clojure REPL.
I wanted to share this little gem:
(goog.string/createUniqueString)
extremely usefull when wrapping js component which demand id'sOw just figured out gensym
Hi everyone, I'm looking for an explanation on how do figwheel, piggieback, weasel, austin, nrepl, sidecar etc compliment/differ/overlap with each other. ATM I'm using figwheel and realised I probably need piggieback to make it work with vim-fireplace. I'm still confused though which part does what and what would constitute a good setup.
Hello, anyone knows what mori-export
does and the difference in using that vs (def ^:export ...)
? https://github.com/swannodette/mori/blob/master/src/mori/macros.clj#L18
From the looks of the macro it looks like it specializes on arity for speed i.e. assoc
and assoc.f3
Thanks @spinningtopsofdoom . So it is basically equivalent to ^:export
but more performant ? Is there a tradeoff that you are aware of (or can we expect :export
to behave like that in the future) ?
Are arguments passed from javascript to clojurescript alway copied ? Or only when using js->clj
, or on the first time we assoc
something to it ?
If you're talking about arguments passed to a compiled CLJS function (e.g. CLJS (ns foo) (def ^:export bar [n] (assoc n :a 1 )
and JS foo.bar(null)
) then the arguments are passed in as is just like normal JS. No conversion or copying is done.
@spinningtopsofdoom: thanks for the confirmation
NP glad I can help
hey all! So I wonder if it's possible to have something like :preamble, but for :optimizations :none? I need some polyfills for nodejs and I'm not really sure what's the best way to install them...
@asolovyov: I'd look at the Google Closure library first to see if the polyfill exists there. Look at`:foriegn-libs` for polyfills from third party JS https://github.com/clojure/clojurescript/wiki/Dependencies
@spinningtopsofdoom: my polyfill is literally 5 lines of javascript, I just don't know how to apply it nicely
just requiring it at the top unfortunately doesn't work, namespaces load in weird order anyway
The link I sent you shows how to polyfill (the example used is around the size of the code you're talking about)
This can help for eval 5 lines of js
@delaguardo: js*
is what I use! But namespace with it loads too late!
@spinningtopsofdoom: I'm not sure I see how :foreign-libs will help me...
Put the JS polyfill you need in a file and then reference that file from the CLJS compiler.
If you want to use it like a normal CLJS file then put a goog.provide("my.ns")
on the top of the file. Don't use js*
it's an implementation detail for CLJS and can ply havoc with your code later on
Sorry misread that you needed it to load before all other ns. If you need it for :optimizations :none
why not use <src="mypolyfill.js"></script>
?
before your CLJS is loaded
I'm assuming you're needing this for a browser since you're talking about a nodejs polyfill
@spinningtopsofdoom: because I don't have any html, that's shim for node.js
Ah I read your needs backwards. You have :main :my.ns
if you're using :optimizations :none
, correct?
@asolovyov: this is what :preamble
is for.
@asolovyov: there’s no reason to not support :preamble
under :none
@asolovyov: actually it appears this was already fixed in master by @pupeno
@dnolen: you're talking about https://github.com/clojure/clojurescript/commit/c72e9c52156b3b348aa66857830c2ed1f0179e8c ?
@asolovyov: it calls cljs.closure/add-header
under Node.js and c.c/add-header
calls c.c/make-preamble
@dnolen: sorry, am I doing this right?
java -cp ~/.m2/repository/org/clojure/clojure/1.7.0/clojure-1.7.0.jar:~/.m2/repository/org/clojure/clojurescript/0.0-SNAPSHOT/clojurescript-0.0-SNAPSHOT.jar:src/mk/fe:src-node clojure.main build.clj
it says Could not locate cljs/build/api__init.class or cljs/build/api.clj on classpath.
my require has single quote, obviously
@asolovyov: I wouldn’t do it that way
note version that gets installed in your local Maven, use this version in your project.clj
right, it just my cljsbuild spits out error which is not really understandable, so I'm trying to get nude cljs to work, so that I can read original stuff
@asolovyov: if you’re trying to do a minimal check as above then use ./script/uberjar
@asolovyov: awesome!
@gigasquid: you are needed at the book signing
In the boot cljs repl how do I enable the :repl-verbose option of the clojurescript compiler?
Probably a dumb question: what's the easiest / clearest way to serialize and unserialize ClojureScript data to a string? I want to attach a small map to a dataTransfer object on a drag event
I guess (cljs.reader.read-string)
?
@timgilbert: that's what i use
Thanks @pandeiro. Are you just using (str)
to serialize?
Ah, that makes sense. Thanks!
hi all - I am using transit (json) to send messages from the server to the client and it is working great except my UUIDs don’t seem to be coming across:
cljs.user=> id #uuid "9e7200f4-419c-461e-a9e5-f6b07f8dcd8f" cljs.user=> (type id) #object[Function "function (high, low) { this.high = high; this.low = low; this.hashCode = -1; }"]
previously (type id) would return cljs.core/UUID)
according to transit UUIDs should be transformed automatically, but it seems they aren’t - any suggestions?
I forgot this is a bit of ghost town whilst everybody parties at the conference so I have also posted to https://groups.google.com/d/msg/clojurescript/_B52tadgUgw/7r6uCh_EBgAJ
@colin.yates: might be related to this - https://github.com/tonsky/datascript/issues/110
that looks like it might be it - thanks @jaen!
howdy
I haven’t tried - I am just about to crawl up to bed to be honest (midnight here and a long day :-)). I will try first thing tomorrow morning though.
https://github.com/cognitect/transit-cljs/blob/master/src/cognitect/transit.cljs#L103-L129
It isn’t a great deal if the type has changed, it just made me think ‘woah…’ that’s all.
but thank you for your help
(currently battling immutant and wildfly)
wasn’t cljs.core.UUID a ‘real’ type?
(that sounded snarky, it wasn’t meant to :-)).
actually i might take that back... its after beer time so i am not sure how helpful i am 😉
he he - beer and tiredness - that’s when the most amazing coding sessions happen!
never mind i just check the git history in cljs.core and that does not seem to be the case
actually, I just realised that the http://README.org on https://github.com/cognitect/transit-cljs just explicitly state the types, and yes they are com.cognitect.transit. I should have noticed that - bleary eyed.