This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-19
Channels
- # admin-announcements (1)
- # arachne (3)
- # atlanta-clojurians (5)
- # beginners (6)
- # boot (37)
- # braveandtrue (1)
- # cider (128)
- # clojars (3)
- # clojure (224)
- # clojure-belgium (5)
- # clojure-boston (43)
- # clojure-czech (8)
- # clojure-france (2)
- # clojure-greece (17)
- # clojure-hamburg (4)
- # clojure-russia (285)
- # clojure-seattle (1)
- # clojure-uk (12)
- # clojurescript (209)
- # core-async (2)
- # core-matrix (8)
- # core-typed (1)
- # cursive (2)
- # data-science (2)
- # datascript (1)
- # datomic (18)
- # emacs (12)
- # events (2)
- # hoplon (15)
- # immutant (1)
- # jobs (1)
- # ldnproclodo (23)
- # leiningen (10)
- # mount (8)
- # off-topic (7)
- # om (126)
- # onyx (6)
- # overtone (2)
- # parinfer (5)
- # proton (24)
- # re-frame (16)
- # reagent (14)
- # untangled (105)
- # yada (1)
@naomarik: compile it with :pseudo-names true
and :pretty-print true
, this should tell you more
Hi. Is there any tool that allows running (compiling and auto-reloading) (1) Node.js on the server (2) ClojureScript with REPL on client (for web development)?
Or, would I need to run two compilers anyway (in separate windows) to achieve this?
I'm having issues when I attempt to compile-str
the contents of a file containing cljs and dump the output to a js file. When I attempt to run my output .js file with node, I get "cljs is not defined" if I reference any fn from the cljs.core namespace. Is there a way to have the cljs.core ns compiled into the output js with compile-str
, or do I need to take a different approach?
Someone recommended to me a library to work with secretary to push state into the history bar... any idea what that was? 😞
So so many issues. 😞 So, I have secretary working in that (dispatch! "/example")
will take me to the correct page, but it won't update the URL bar -- it stays http://localhost:3449
I'd also like to figure out how to get http://localhost:3449/example working, but that can wait 😄
I’m pretty sure secretary doesn’t do that, I’m using secretary with https://github.com/venantius/accountant and I believe accountant is handling the url bar update
@amonks, I was following http://yogthos.net/posts/2014-08-14-Routing-With-Secretary.html
(accountant/configure-navigation! {:nav-handler (fn [path] (sec/dispatch! path))
:path-exists? (fn [path] (sec/dispatch! path))})
@slester you need to change whatever you want to trigger the change to use accountant instead of secretary
I imagine that your onclick
event is still using sec/dispatch!
, instead change it to use the the function @amonks mentioned
I’m kind of liking that approach, didn’t know about accountant. I can see how it can make it easier to test other routing libraries
well, now clicking anything that isn't a link sends me to / ... so that's weird, but still progress!
I wish there were less demos and more projects though 0.o not complaining I still appreciate it.
> once the mechanics for extruding to 3D have been established, extruding to 4D is a relatively simple proposition
@naomarik: when encountering issues with advanced and other things are loaded on the page :output-wrapper might help
Does anyone know a web-based EDN/clojure data structure viewer? Basically pretty print in a browser with the ability to collapse/expand nested stuctures?
@pesterhazy: cljs dev-tools ?
@nxqd: hmm I'd prefer not to tie it to chrome
Any good books to read up on to start with programming UI?
@nxqd: you can use uuid
in ClojureScript now
@danielcompton: nice 😄
Hoping maybe someone can help me with this: https://clojurians.slack.com/archives/clojurescript/p1461035091000281 any takers? not quite sure how to get result I'm looking for this self hosted cljs problem. For the moment I'm "working around" it by injecting a few lines of JS at the top of my output file that load the compiled js dependencies produced with cljsbuild (`:optimizations :none`) of a stub cljs project.
is there a way to check inside a macro whether it's being used in Clojure or ClojureScript?
@plexus: you can use a reader-conditional to yield different values in clj/cljs - http://clojure.org/reference/reader#_reader_conditionals
oh, yeah, oops - not thinking hard enough
I'm looking if I can solve this long-standing issue https://github.com/jaycfields/expectations/issues/54
hacky maybe, but is there some cljs-compiler state you can examine ?
I'm curious when would you choose to use say an atom or r/ratom over datascript and vice versa.
@kspear did you try using export on the functions you want to appear outside? this might help http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
@plexus: maybe this helps? https://github.com/plumatic/schema/blob/master/src/clj/schema/macros.clj#L10-L19
an alternative way to check for CLJS / CLJ
I’ve had luck with such approach
Any ideas why simply requiring clojure.repl.browser would throw me a "SyntaxError: invalid range in character class" at runtime?
@anmonteiro: thanks, it seems that's exactly what I need
Hello all, I´ve been reading lots of informations about Circular Dependency and I realy don´t know if there is a clean solution about it. So, in my clojurescript project, do I have to put all the UI in the same namespace file?
Does anyone know if externs.js
file, (when :advanced
optimizations) have impact on dead code removal or is it just for not renaming symbols?
@madvas: I believe just renaming. It should be easy to put together a very simple test though.
Hello, guys! I'm new to ClojureScript but now I'm JS dev and familiar with functional programming a little bit. So, could you recommend some materials to get into ClojureScript. Thank in advance!
@bhauman: When I “lein repl” and use the sidecar api to start-figwheel, it doesn’t seem to pick up any of my config. I’m not merging from profiles: it’s all there at the top level.
@thebeatcoder: Any Clojure resources (r.g. https://aphyr.com/tags/Clojure-from-the-ground-up and http://www.braveclojure.com/introduction/).will do For ClojureScript specifics try https://github.com/clojure/clojurescript/wiki/Quick-Start and https://github.com/bhauman/lein-figwheel/wiki/Quick-Start.
Clojure and ClojureScript overlap ~90 - 95% and really only differ on host (JVM vs. JavaScript) and low level details (protocols and types)
Yeah, it's kind of nice how much is the same between clojure and clojurescript- a big selling point, IMHO.
Quite a while back I wrote some web stuff with the server in CL, and the client js generated with a cl lib called parenscript, and it was in some ways a very nice system, but... clojurescript does a much better job of treating js as a compile target.
@zentrope: so you are saying that when you run lein repl
and then run (start-figwheel!) it doesn't pick up your config?
and then try this (into {} (map vec (partition 2 (drop 3 (read-string (slurp "project.clj"))))))
I’ve got a couple of functions in there to calculate the hostname so I can reach my websocket app from other machines without explicit setting (in a dev context).
Yeah, but I don’t want to have to set the hostname explicitly for every machine I might run the software on in a dev context.
https://github.com/bhauman/lein-figwheel/commit/9c20f9331abef2bc66928e5bb409008818da2df7
Ah, okay. Hm. I also set a closure-define so that my own app (which uses websockets) can find a host.
reading defproject raw is definitely confusing but including leiningen core into the running application is not so great either.
basically reading defproject raw is a convenience from the REPL. since the repl lives in a different process from leiningen
In the #C0617A8PQ channel @rmuslimov is using user.clj to launch a dev version of figwheel, then keeps project.clj as strictly a way to build for production.
Yeah, if you wanted to fix it, you’d just have to read all the forms, then only pick out the one starting with defproject, I guess obviously enough. ;)
the user.clj method is the best I'm thinking about having the template generate it and a piggieback cider connection
figwheel.edn: Of course, I have the same issue, needing to pass the hostname into the running app so it can find its web-socket server host.
I like the separation of project.clj for a good build, and user.clj for all the messy dev stuff. Makes both easier to read.
the user.clj is the best solution because as your app grows you dev requirements will out grow a declarative approach
Guys, is it normal, when I just require some cljsjs
library in some namespace, don’t use any of its methods, and compiler still includes whole js file minimized into final app.js
. It doesn’t do any dead code removal. (when :advanced
optimisations)
@thebeatcoder: If you are using Reagent, this is a good start. https://github.com/reagent-project/reagent-cookbook
If I have an atom with vector like (def a (atom {:g [["A" 90]["B" 10]]})) how do I update :g with new vector?
No problem! I use https://clojuredocs.org/ for a lot of my own questions like that, searching atom
will give you lots of examples and leads to the swap!
page too.
this might be a really dumb question, but does https://github.com/dakrone/clj-http support cljs?
I see no indication of such in the http://read.me, but it seems to be the defacto standard of http libs for clj
https://github.com/r0man/cljs-http this is cljs version
ok, it’s not version of that library, but it looks like it follows convensions from clj-http
i’ve been using https://github.com/JulianBirch/cljs-ajax because it provides :interceptors
out of the box
@numberq: What if you just want to update one field or add to the atom above and not replace it?
@yatesj9: when you’re operating on the value in an atom, you can do whatever to it you’d do to the same value outside an atom
hello, how do I create an issue/pull-request for a specific docs page (and my subtle implication is why is there no link to the source on the docs page)? Example: http://clojure.org/reference/atoms