This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-18
Channels
- # admin-announcements (3)
- # announcements (7)
- # aws (1)
- # beginners (76)
- # boot (340)
- # cider (9)
- # clara (35)
- # cljs-dev (7)
- # cljsjs (16)
- # cljsrn (11)
- # clojars (1)
- # clojure (192)
- # clojure-dev (6)
- # clojure-madison (8)
- # clojure-russia (373)
- # clojurebridge (1)
- # clojured (9)
- # clojurescript (172)
- # community-development (1)
- # core-async (2)
- # cursive (7)
- # data-science (2)
- # datomic (12)
- # devcards (1)
- # dirac (63)
- # emacs (3)
- # events (10)
- # gsoc (3)
- # hoplon (1)
- # jobs (1)
- # juxt (20)
- # ldnclj (4)
- # lein-figwheel (12)
- # leiningen (1)
- # off-topic (21)
- # om (232)
- # onyx (64)
- # parinfer (8)
- # proton (21)
- # re-frame (8)
- # reagent (1)
- # ring (3)
- # ring-swagger (3)
- # slack-help (4)
- # spacemacs (6)
- # testing (3)
Is there an equivalent to java.util.Properties
in JavaScript?
@ag just read "KEY=VALUE" (multiple)
yes I can use ClojureScript split, etc, etc, but just for curiosity
no no just asking if there was an equivalent, but it is actually clunky to use and will use split
on lines, it's easier đ
that's ok đ
You need to make sure its building your devcards build, so if you have two builds âdevâ and âdevcardsâ should be lein figwheel devcards
@noonian: Thanks - neither of those work. Iâm getting:
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate cljs/analyzer__init.class or cljs/analyzer.clj on classpath: , compiling:(figwheel_sidecar/utils.clj:1:1)
at clojure.lang.Compiler.load (Compiler.java:7142)
clojure.lang.RT.loadResourceScript (RT.java:370)
clojure.lang.RT.loadResourceScript (RT.java:361)
⌠etc etcâŚ
According to the readme, just going into the directory and running lein figwheel
should work.
@cfleming: my bad, I didnât read you original question closely enough and didnât realize you meant the demos in the devcards repo. I just cloned the repo and lein figwheel
worked fine to build the demos so it must be something wonky with your environemt. Maybe you have Clojurescript pinned at an older version in .lein/profiles.clj
or something like that?
Nothing springs to mind. It seems like a dependency version conflict thing though, but very strange that it works for me and not you. I assume you are running Java 8?
lein classpath shows clojurescript 1.7.170 in the classpath, so I have no idea why it wouldnât find that file.
I get the same problem with a new project created with lein new devcards hello-world
@cfleming: check out this issue: https://github.com/bhauman/lein-figwheel/issues/285
might be some info there that can help, seems there could be a couple things causing it
Is there a setting I can change to make the autobuilding refresh happen faster with figwheel?
Currently when I save, it takes up to about 5 seconds - I assume thatâs the polling frequency of the autobuilder.
@cfleming: do you have .cljc
files in that project?
@anmonteiro: No, just cljs
not aware of any option, then. I've had problems where rebuilding projects with .cljc
files pulled in more dependencies than it should
hence my question
I guess these days there are probably cljc
files in dependencies, but they shouldnât be changing.
yes, it would matter if they were on your project
no idea then, sorry
@cfleming: It looks like you can control watching behavior a bit in your figwheel config (I havenât tried it myself): https://github.com/bhauman/lein-figwheel/blob/30c78fdfc017a0996886cf785b4fc665bd85f2bf/example/project.clj#L139
@noonian: I was just checking that - that implies that by default it uses FS events.
yeah, it uses the hawk library under the hood: see https://github.com/wkf/hawk#polling-watches
Iâm on OSX, it says it should use the barbary lib by default but I wonder if itâs actually polling instead.
Ok, I can explicitly set the watcher to :barbary
, but it doesnât seem to improve things much.
Looking at the server log, it looks like the compilation of the file is taking anywhere from 1.8-2.5 seconds
I'have problem at connecting cljs repl in project created with command "lein new duct +example +cljs"
lein repl
(go)
; open localhost:3000/example
(cljs-repl)
this gives me error : java.net.UnknownHostException: E
"E" is the drive letter which my project resides
Anybody knows about this ? or What am I doing wrong?@cfleming depending on your project try :recompile-dependents false
, that usually speeds up the build but makes it less reliable
Is there simpler, more idiomatic way to translate something like [user [name email] foo bar [baz]]
into [[user [name email]] [foo nil] [bar [baz]]]
than with this massive transducer I just wrote? https://gist.github.com/Jannis/e30374115f1065edea11
It seems to me that using reduce
and building pairs on the fly in the reducing function via a result map would be simpler. But here I am, thinking 'hey, transducers are better!' đ
@jannis: You might look at something like flatten
and then constuct what you need with the results.
flatten
would drop the hierarchy from the input, which is essential grouping information in this case. I'm not sure how that helps.
(partition-all 2 1 input)
-> ((user [name email]) ([name email] foo) (foo bar) (bar [baz]) ([baz]))
. That's an interesting starting point. Drop a few from that, transform a few and that might be it.
@meow: The input is just an example, it's an arbitrary combination of standalone symbols and symbol-vector pairs.
@slipset: That's a good idea. Insert nil
in between any two consecutive standalone symbols.
@meow: Sorry, I should have been more explicit about it. Perhaps I thought "something like ..." was enough. đ
@jannis: I'd take the source of dedupe
and edit it and insert a nil
upon seeing two consecutive symbols. Then all that's needed is a partition.
@rauh: Really nice. Checking for type equality rather than value equaility also ensures that nil
in inserted between [foo] [bar]
.
I always like to generalize and in case this comes up again at some point. Then I can re-use it
With that, my reducing function will now receive either [foo nil]
or [nil [bar]]
(invalid case but trivial to catch now) or [foo [bar]]
. That's awesome.
I guess I want nil
instead of ::none
for comparing types. Other than that - I like it! Thanks @rauh
I'm getting ANALYSIS ERROR: Invalid token: :
from one of my files, with no obvious cause (I don't have any :
s with whitespace on either side). Any chance that's something that's come up before? I feel like I must be doing something dumb, but I can't figure out what.
Oh. Is that :
part of the error message and not the invalid token? I'm not sure where to look to figure that out.
Yeah, that's what I'm doing. I just thought there was a chance this was something others had hit with a known solution.
I can imagine corrupted UTF-8 encoding or something like that (a wild speculation) or any chance that some macro emitted â:<space>â?
With cljsbuild I get a full stacktrace, but no information about the location in my file
Caused by: java.lang.RuntimeException: Invalid token: :
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.EdnReader.interpretToken(EdnReader.java:282)
at clojure.lang.EdnReader.read(EdnReader.java:168)
at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:694)
at clojure.lang.EdnReader$SetReader.invoke(EdnReader.java:639)
...
Caused by: clojure.lang.ExceptionInfo: Invalid token: : in file src-cljs/frontend/components/insights/project.cljs {:tag :cljs/analysis-error}
Is it okay to file a JIRA issue that just has the error and says that cleaning fixed it? Having cleaned, I don't think I have a great way to reproduce it now, unfortunately.
is there much work being done on full stack Clojure/Clojurescript? i.e. integrated framework
@jannis: recursion is not my strong side, but these kinds of problems make for nice puzzles
dumb question: what's the right way to say that i'm interested in both clojure and clojurescript? do i say i'm into clojure/script? clojure(script)? "clojure and clojurescript"?
@jrheard: just say "I'm awesome"
@peeja: FWIW, I've also had that happen when having a println
in a macro
https://github.com/plumatic/schema says Clojure(Script), i'll do that i guess
no idea, I don't have any knowledge of the macro-expansion process
@thheller: Thanks - in the end I just commented things out until the delay was acceptable for a demo
The Google Summer of Code 2016 organization application is due tomorrow and David Nolen and I worked on completing it today. However, this requires community help to get anywhere. Right now we need: 1) project ideas http://dev.clojure.org/display/community/Project+Ideas+2016 2) mentors for those ideas Presuming Clojure is accepted as an org, students will then be able to propose those projects in March.
there is also now a #C0N1QHE3W channel
How do I deploy a clojurescript app on Heroku? Should I compile down to js and deliver static assets? But what if I want to have a clojure backend? help? đŹ
@josh.freckleton: production ClojureScript means advanced compilation to JavaScript and delivering that asset in the usual way
@dnolen Do people commonly use ring
/`composure`, or something like node
/`express`? is there a community preference?
(in retrospect, that's maybe a bad question. I'm overwhelmed with decisions as I'm learning this ecosystem, just don't want to be layering bad decisions on top of each other)
@josh.freckleton: Are you wondering about the clojurescript side or the clojure side? Since you're learning, what part are you focused on right now? We can discuss further in #C053AK3F9 if you want to go into specifics
@josh.freckleton: not a bad question, people use pair ClojureScript with Clojure
@josh.freckleton: https://devcenter.heroku.com/articles/using-node-js-with-clojure-and-clojurescript-applications
@josh.freckleton: also http://jkutner.github.io/2015/10/14/clojurescript-on-heroku.html
@dnolen: thanks! that helps me eliminate another decision @codefinger: Hrm, I read through that but it's not clear why I'd need node.js mixed in with clj/cljs... Is this article the most "idiomatic" way of doing things? And to the second article, I breezed through it previously, but was confused at how there are a few different high-ranking search results for this problem with all different solutions...I'll read these through more closely and hopefully figure it out! @shaun-mahood: Thanks for the recommendation Shaun, just posted in #C053AK3F9 with a couple more details It totally rocks how this community jumps in on helping eachother, I'll make sure I pay it back to other learners! I'm on the #C053AK3F9 channel if you have any more advice on this!
any suggestions for a charting library that works well with clojurescript? im fairly new to clojurescript (have some clj experience) and want to try to put together a ui that is mostly just a metrics dashboard
ive got something simple up with highcharts, but i feel like im not âcorrectlyâ using reagent rerenders when i want to update charts
@jstokes: this will help if you are using reagent: https://github.com/Day8/re-frame/wiki/Using-Stateful-JS-Components