This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-13
Channels
- # admin-announcements (48)
- # alda (1)
- # aws (24)
- # beginners (4)
- # boot (103)
- # cider (69)
- # clojure (111)
- # clojure-art (5)
- # clojure-dev (35)
- # clojure-greece (2)
- # clojure-nl (3)
- # clojure-russia (1)
- # clojure-shanghai (1)
- # clojurescript (220)
- # clojurescript-ios (1)
- # clojurewerkz (3)
- # community-development (3)
- # core-logic (5)
- # cursive (5)
- # datomic (24)
- # devcards (21)
- # editors (3)
- # funcool (1)
- # hoplon (20)
- # ldnclj (47)
- # ldnproclodo (1)
- # liberator (1)
- # off-topic (7)
- # om (21)
- # onyx (36)
- # reagent (1)
- # ring-swagger (2)
- # spacemacs (38)
- # yada (17)
oh ok @maria, did not know that, maybe I missed the place where it is written ..
in any case
thanks for solving, i was banging my head on the floor 😄
I setup some simple "hello world" style deftest's last night and I was able to run them successfully using cljs.test/run-tests
Are there any best practices in how to shape returns from an API? right now I’m doing {:status :success :other-data blah-blah} or {:status :some-sort-of-failure :other-data blah-blah}
@sander: so, running java -cp cljs.jar:src clojure.main repl.clj, will result in java.lang.RuntimeException: No such var: cljs.build.api/build
@maria: is the reason that :main causes the foreign libs not to be included that a file that's not loaded by main does not transitively require the foreign lib? Somehow the example repo doesn't seem to require jqconsole anywhere
@martinklepsch: I believe it’s a bug in ClojureScript. When using the :main
option in combination with :advanced
or :simple
, instead of returning an IJavaScript map of the compiled file, the compiler returns a String which doesn’t have a goog.require
for the foreign library. Will try to create the ticket and the patch today and then let’s see what dnolen says 😉
Ah interesting thanks @maria :)
@maria part of me wants to talk you into building lein-cljsbuild on top of shadow-build, but are you even aware of its existence?
but pretty much all of the bugs or build problems talked about here do not exist in shadow-build
which is a big issue for me because I think :none should be as close as possible to :advanced as possible from the user side of things
:main not working in :advanced is just another example of that not being the case in cljs 😞
@thheller: Have you thought about using Cljs public API instead of the implementation namespaces?
I like the idea to just use a Clojure script to build your project. Especially now that ClojureScript supports JavaScript transforms which require you to add your own transform function.
@juhoteperi: that won't work cause it is pretty much a reimplementation of cljs.closure
@maria yeah seems to be the latest trend in cljs/figwheel to create a scripts/thing.clj to run things
my general opinion being that cljs.closure/build is not enough to drive complex builds since you cannot express all options in a hashmap
@maria your work on transforms is not supported in shadow-build yet because I do not have a proper example of a library where that should work
but as I said, I suck at writing docs so I don't blame you if you'd rather stick with CLJS proper
@dimovich no idea, sorry. are you sure you're using exactly the same cljs.jar in windows and in ubuntu?
@steve do you mind posting an example repo? Remember that cljs.test/run-tests
is a macro that takes namespaces, finds their test vars, compiles the tests, and then runs them. If you are in the REPL and somehow "delete" the namespace, then run-tests
will find no vars inside.
does anyone use ClojureScript + Node for making outbound HTTP connections?
I'm trying to write something for AWS Lambda on top of https://github.com/nervous-systems/cljs-lambda that talks to a bunch of HTTP RESTy APIs
@sander do you just use the node libraries w/ bare JS interop? or are there any nice wrappers around those?
@jreedmoore: no experience with aws, but i like the node.js request library
that looks pretty full featured and awesome!
I have no idea what I'm doing, but any advice on how I can turn the callbacks in there into core.async channels?
@jreedmoore: there are probably different opinions but here is one example: http://www.lispcast.com/core-async-code-style
@jreedmoore: Here HTTP wrapper for CLJS around standard node http https://github.com/artemyarulin/koh/blob/master/src/koh/http.cljs#L5
I just cut 1.7.145 https://github.com/clojure/clojurescript/releases/tag/r1.7.145
before putting together a proper announce it’d be great if people could take a second to test it
Figwheel is reloading a cljc file, but faling due to an undefined function, but this function is called inside a #?(:clj …) block and the function is defined in a clj file. The Clojure side of things is working fine and if I restart figwheel, it’ll work fine, but not hot-code loading. Any ideas what’s going on?
@dnolen: Everything looks good with 1.7.145 for me, no issues in a Reagent app running on Windows
I’m trying to get going with emacs and cider via spacemacs. When I try to send my buffer to cider in a clojurescript project, I get this error: No such var: clojure.core/require-macros
. . . can anyone give me a nudge in the right direction?
@dnolen: I just tested a couple of applications with 1.7.145 with all I got (rhino, slimer, phantom, chrome, etc.) without problems
@jeremyraines: I'm not sure about this but I don't think cider supports clojurescript like that. It is probably trying to read your namespace as a clojure file and failing.
oh, dang. Back to vim I guess
or — what are people’s workflows for repls and clojurescript with emacs? I was experimenting with making the switch because whenever people spell out their vim setups for clojure, usually someone says something along the lines of “emacs does all that, but better, and better repl integration"
but it is not integrated at all with my clojurescript workflow, which is mostly terminal/browser based
I've been trying to use intellij + cursive but my machine can't really take 2 jvms so it crashes often when I ran tests/servers on the side
Just gonna drop this right here… https://potetm.github.io/2015/10/04/beginning-clojure-cursive.html
I see. I want to do clojure jvm stuff as well, so I’ll check into non-integrated workflows for clojurescript
Man bensu that sucks about crashing… Cursive is IMO by far the best clojure editing experience
I tried cursive for a couple months, it wasn’t really for me; maybe I didn’t put in enough effort into learning intellij, but it seemed difficult to customize
@jeremyraines: that’s interesting, I basically have all the customizations I ever had in Emacs and more
ok. I know my issue is probably lack of knowledge about the clojure / clojurescript repl in general. I’m coming from Ruby, where I’m very proficient with Pry, and am not there yet. I’ve spent time learning the language and (some minimal part of) the ecosystem, and now I’m trying to get procifient with the tooling and understand whya lisp repl is so superior (I don’t doubt that it is)
@jeremyraines: Ruby REPLs are not bad, they actually support reloading
@jeremyraines: what I find superior is the REPL workflow combined with an expression oriented language.
TBH @dnolen my immediate goal is to use a setup where I can get the most out of the workshop this weekend. I think I’ll be exposed to a lot of cool techniques that I want to be able to incorporate immediately rather than abandon or translate to vim. I know that’s not the primary goal at all but I got jealous of Tims’ emacs-fu during the Arcadia workshop
I’m up and running enough with Cursive that I could probably use that
@jeremyraines: not sure if that's what you're looking for, but i found inf-clojure a lot easier to set up in emacs than cider
thanks, I’ll check that out too
@jeremyraines: we’ll probably recommend Cursive to cut down on environmental issues
people who are very comfortable w/ Clojure can make do of course, but it won’t be recommended
how do you all handle combining ring war with ‘components’ when the handlers need collaborators? At the moment I have my handlers pull out of the system map pulled in via a namespace - yuck. The problem is that ring war wants to access the (no-op) handler var….
@roberto +1 for Cursive regardless. +1 for Emacs + cider (+ prelude) though as well
yeah, I started with Cursive and switched to Emacs. But my motivation was because I really wanted to learn Emacs.
I can’t live without helm (helm-ag and helm-occur just rock my world).
and avy as well
Anyone running tests from repl in their development flow? Can you share your work flow?
@steve do you mind posting an example repo? Remember that cljs.test/run-tests
is a macro that takes namespaces, finds their test vars, compiles the tests, and then runs them. If you are in the REPL and somehow "delete" the namespace, then run-tests
will find no vars inside.
there’ll be a slew of releases as we get things ironed out. Overall I’m very excited about the architecture. I’d say this puts Om another 20 odd months ahead of everyone else
Does anyone have any good, up to date instructions on how to integrate figwheel with ring? I've found some older ones but would like to get something current into the wiki.
@shaun-mahood: you mean using figwheel to host your ring handler?
once the various issues are ironed you will have to pry Om Next from my cold dead heads, this is the UI tool I’ve been wanting for the last 10 years.
Even with all the issues you identified with original Om, it has been a super useful tool and made developing UI's a pleasure. If Om Next proves to be half as good as you say then everybody else should pack up!!!! Which will be a shames as I've quite enjoyed playing with PureScript recently.
@lfn3: I think I mean using ring to host figwheel, but I could be wrong. Essentially it would be what Chestnut does, I think. I've always had things split up in different projects up until now but want to start integrating the 2.
@shaun-mahood: Right. So afaik, figwheel will totally handle it’s own thing, independent of ring. See https://github.com/bhauman/lein-figwheel#scripting-figwheel
@dnolen: No problem. The thanks is all to you. Just converting a prototype I'm building to Om Next. Hopefully it will be enough to persuade a team of CoffeeScript/Backbone devs to switch to ClojureScript/Om Next!??!
You can just put something like that snippet somewhere downstream from your servers init method
@lfn3: Ok that kind of explains what that whole section was for. I'll see what I can figure out, thanks.
When using a CLJC file, am I wrong in assuming there are intermediate .clj or .cljs sources generated at some point that I could inspect?
i’m trying to work out why a macro is generating what appears to be the wrong code and I really want to see the .cljs source to see what the #?(:cljs …) has emitted
you are wrong 😞 I think this is handled by the reader which just selects the appropriate part without generating an intermediate file
just in case: remember that macro expansion is done in clojure jvm so it would pick up #?(:clj ...)
ahh you want a macro that you can call from the jvm and js and that generates different code for each
@sandbags: this is not really a bug. cljc
just doesn’t cover macros - was out of scope.
dnolen: not sure what you mean, i’m not referring to cljc not handling #?(:cljs) as a bug
dnolen: i’m working around a CLJS bug that means I need my macro to be different in the clj and cljs cases
and i lost track of macros being compile-time and, hence, clj only even in a cljs context
maybe you can #?
over the top form and have #?(:clj defmacro :cljs defmacro)
-- sorry this wouldn't work unless you used bootstrapped
i can find the number if you’re interested but it’s something you know about already, came up last week
though working around this via macros is about as likely to be as much work as just submitting a patch
the number of people that think that route is harder and then try and are surprised it’s really straighforward …
possibly, possibly not but i’d also have to understand the problem and the context which frankly i don’t … i mean i can take a look but as someone who only has the odd hour or two a week to code these days, i’m not sure it’s something i can tackle
I think you underestimate @dnolen's patience. He'll write the patch through slack through you if needed 😄
hahaha I don't know if you've noticed but there were 2 releases today, I would never underestimate him
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L1425-L1431
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L1410-L1415
okay this is odd, i checked out the clojurescript project on github but the source appears to be different
it may even be solveable by fixing only this https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L1192-L1193
I’ve updated the ticket http://dev.clojure.org/jira/browse/CLJS-1451?focusedCommentId=41354&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-41354
in general I would rather help people fix the real issues than have them resort to dirty hacks
assuming i understood this code or what you are suggesting, how would i go about testing this?
okay, i might have to come back to this next time … 00:21 here and I suspect i’m just not compehending, thanks anyway for your help, also @bensu
@sandbags: If you don't have the time I'll start with it tomorrow working on it with @dnolen's pointers
@bensu: that’s kind of you, i’m about done tonight and no idea when i’ll get a chance to code again
feel kind of daft for not realising sooner why my macro was expanding wrong … <sigh>