This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-06
Channels
- # admin-announcements (7)
- # beginners (37)
- # boot (36)
- # cider (8)
- # cljs-dev (16)
- # clojure (155)
- # clojure-hamburg (1)
- # clojure-russia (2)
- # clojurecup (21)
- # clojurescript (69)
- # clojurex (12)
- # core-async (2)
- # datavis (3)
- # datomic (5)
- # devcards (4)
- # events (2)
- # hoplon (15)
- # lein-figwheel (45)
- # off-topic (22)
- # om (77)
- # re-frame (8)
- # reagent (7)
- # slack-help (1)
I’m in need of some core.async testing expertise. I have a go block that’s not executing before my assertions, and using the async macro doesn’t seem to work. I’ve tried to put up a minimal example here: https://gist.github.com/munk/d4c63ecf2fc734fb0673 (I’m in the process of testing it, so please excuse any typos).
one thing I notice is that for cljs.core
there's a cljs.core$macros.js
containing the compiled versions, but e.g. quil.core
also contains macros, but there's no corresponding quil.core$macros.js
@munk: assertion https://gist.github.com/munk/d4c63ecf2fc734fb0673#file-test-cljs-L44 will be never executed, it is sitting in a function which gets never called, why do you wrap that code with (fn [] …) ?
@plexus you don't need to do anything special. The rules for macros are the same as regular ClojureScript
@darwin my understanding of the async macro, which is admittedly imperfect, is that the signature is (async done body callback-with-done). So than code wrapped with the fn is supposed to be the callback
@munk: signature of async macro is [done & body]: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/test.clj#L234
Is it normal to have associated Clojure and ClojureScript code in a single project? Any community conventions or best practices on how to organize the directory structure?
I used to have directories like src/clj/project_name/...
,`src/cljs/project_name/...` and src/cljx/project_name/...
(that would probably be cljc now
src
|--project_name
|--backend ; or server
| |--clojure_namespace.clj
|
|--frontend ; or client
| |--clojurescript_namespace.cljs
|
|--common
|--common_namespace.cljc
So then I just have namespace like project-name.backend.components.webserver
and so on. I feel it works quite well for me.
@plexus: Here is an example of using a Quil macro from bootstrapped ClojureScript (the important thing being that the macros are simple and appear to be compilable as ClojureScript): https://gist.github.com/mfikes/43ccddf688e3f712392a
I want to render a goog.ui
component in a clojurescript (reagent) component. is there an example of doing this?
Is there a way to turn Use of undeclared Var
from a warning into an exception?
As it is, I get a warning in the console but the value is just nil
. I'd prefer to have it fail, or handle the error myself.
anyone aware of alternate zipper impls. other than fast-zip?
@pesterhazy: the ClojureScript supports that but you usually need your build tool to support the hook
dnolen: I'll see if I can find the option
I'm trying to teach myself clojurescript on weekends. unfortunately, coming from javascript, I always find myself struggling with clojure syntax. for example the following (from reagent todomvc) is really cryptic to me:
(defn mmap [m f a] (->> m (f a) (into (empty m))))
(defn complete-all [v] (swap! todos mmap map #(assoc-in % [1 :done] v)))
(defn clear-done [] (swap! todos mmap remove #(get-in % [1 :done])))
most of the time, I'm not sure if I should read thing from left to right, or right to left.
there is ->
and there is ->>
, I keep forgetting which one is which one not intuitive symbolism here.
if this is all clear to you guys, I'll have to come to the conclusion that there are 2 type of people. the ones who understand lisp, and the one who don't.
just like there are 2 type of people when it comes to editors: the ones who feel at home with vi-like style, and the ones who will never learn it.
@dnolen: I'm looking to do it in the boostrapped compiler, but cljs-warning-handlers seems to be used only in the clojure-based one
@pesterhazy: there might not be a hook for that, JIRA ticket + patch welcome if there isn't
@dnolen: (binding [cljs.analyzer/*cljs-warning-handlers* [#(throw (ex-info "Cljs warning" {:args %}))]])
works actually
@plexus: not dynamically at runtime, but there are compile time and static ways to do that
@pesterhazy: ok that’s what I would have thought
@pesterhazy: that’s hooking somewhat into an implementation ns so no promises that will continue to work
that's okay, I'm happy it works for now
though it might be worth considering adding a STRICT mode that fails on all compiler warnings
like gcc's -Werror
@pesterhazy: not going to add anything like that
@pesterhazy: in replumb I am adding (it's a PR) a :warning-as-error
flag that you can pass to read-eval-call
should be in soon
richiardiandrea: awesome!
we discovered replumb
too late, but it would have been the perfect basis for our ClojureCup entry
Oh too bad man...what did you develop if I can ask?
@mike: I recognise that code from the reagent todomvc. Don't worry, its a quite confusing bit of code for all beginners. There's a temptation in these todomvcs to keep the linecount down, and that leads to over-terseness. But don't worry, you'll get there in terms of reading it. And, of course, eventually it will be second nature.
@richiardiandrea: an interactive Quil tutorial using bootstrapped cljs and codemirror
@pesterhazy: oh cool!
I wanted to cut a new release for chromex library and I hit a wall preparing jar file for distribution, I have multiple folders under src which contain duplicit files, those folders are supposed to be cherry-picked in cljsbuild builds depending if code targets chrome extension APIs or chrome apps APIs. It is easy for me to do that when using library from checkouts, but when I want to package it, those folders glue together and names collide. What is the best approach here? https://github.com/binaryage/chromex/blob/master/project.clj#L23-L29
I would rather like user depending on the library to somehow specify which subset of jar to use
Similar but maybe unrelated, in replumb I am thinking of hacking my own reader conditional tag (it has been done here http://www.bytopia.org/2015/11/29/lisp-feature-expressions-clojure/) in order to solve testing with Node.js
I was also thinking of having submodules and produce different artifacts
nevermind^, separated it via namespaces: https://github.com/binaryage/chromex/compare/902e6c2ba845362601ecc6802489e6b075c02b09...abfe9186b72411dc91c98243c7393a369968205e