This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-07
Channels
- # admin-announcements (1)
- # arachne (1)
- # beginners (11)
- # boot (72)
- # cider (7)
- # cljs-dev (9)
- # clojure (31)
- # clojure-czech (8)
- # clojure-poland (1)
- # clojure-russia (7)
- # clojure-uk (17)
- # clojurescript (48)
- # community-development (5)
- # cursive (2)
- # data-science (1)
- # datascript (3)
- # datavis (1)
- # datomic (4)
- # devcards (45)
- # docker (3)
- # hoplon (5)
- # keechma (3)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (16)
- # off-topic (1)
- # om (2)
- # om-next (1)
- # onyx (4)
- # other-languages (104)
- # overtone (1)
- # re-frame (2)
- # reagent (37)
- # rum (35)
- # untangled (4)
- # yada (4)
it looks like [this](https://github.com/clojure/clojurescript/wiki/Compile-Time-Type-Checking) is still in progress, and [core.typed](https://github.com/clojure/core.typed) says that the type checker doesn't work anymore
@cfleming: The presentation is in three weeks. I actually saw your comment in github, saying you should have something "soon"
Anyone have experience with devcards? Is the best pattern to have a separate devcards/ folder, and in it define the cards for the components I want?
@sbmitchell: seems ripe for a macro but this works
(-> jsobj
(gobj/get "hey")
(gobj/get "there")
(gobj/get "now") )
Where gobj
is goog.object
Is anybody aware of some good print debugging library for Clojurescript, sth like https://github.com/AlexBaranosky/print-foo ?
@sbmitchell: Here's a function that does what you want
(defn aget-in
[obj [p & rst :as path]]
(if (or (nil? obj) (empty? path))
obj
(recur (aget obj p) rst)))
(defstyles screen (let [body (rule :body)] (body {:font-family "Helvetica Neue" :font-size "20px" :line-height 1.5 } )))
Here's a style that does what you want: (def style [[:body {:font-family "Helvetica Neue", ...}]])
For instance, it doesn't have any validation on its output, and it's easy to coax it into outputting garbarge
Guys, is there a way to automatically :require-macros
of some clojure file for each Clojurescript file in a project?
What is the recommended way of requiring core.async in a .cljc file? I'm trying out various combinations of #?(:cljs (:require-macros [cljs.core.async.macros :refer [go-loop]])
, (:require #?(:clj [cljs.core.async :as async :refer [go-loop]] :cljs [cljs.core.async :as async]))
and similar, and failing so far.
Ideally I'd like to have all of async :as
async, but I think that can't be done in ClojureScript, so let's :refer
go
and go-loop
.
@madvas: No, not generally. If there is an associated runtime file, then implicit macro loading may help. (See https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#namespaces)
In general I have a problem with cljc, because ClojureScript uses :require-macros
, while in Clojure that doesn't exist. This leads to lots of ugly ns forms with lots of conditionals…
Actually, that was a dumb question — I just noticed that the package names are different: cljs.core.async
and clojure.core.async
. So I have to conditionalize the whole thing anyway.
Try #?(:clj [clojure.core.async :as async] :cljs [cljs.core.async :as async :include-macros true])
then
Well, I ended up with something similar. But in general :require-macros
gets in the way when migrating to cljc. I think it might make sense to make it work like :refer
when compiling as :clj
. It would certainly simplify my ns forms quite a bit.
On a related note, this whole cljc thing — it's mind-boggingly awesome. I built a search engine that works in ClojureScript and for larger databases can switch to server-side query processing — same bit of code. And now I'm pre-rendering most of my UI (React-based app) on the server, without even touching node.js or Nashorn. It feels ridiculously powerful.
@jrychter: you'd probably like the simplification http://dev.clojure.org/jira/browse/CLJS-1507 would afford
@mfikes: Yes, that looks like it would solve a lot of the problems I'm encountering. I think it would still be helpful to have :require-macros
behave like :refer
in Clojure. If I understand the ticket correctly (it's late), I would still need to use :require-macros
for macros defined in the "first-order" required namespace. E.g. the ticket would help with the macros that the required namespace itself uses, but not ones that it itself defines.
@jrychter: :refer-macros
is another nice way to avoid having a separate explicit :require-macros
spec
@mfikes: well, true. And I appreciate its existence. But not knowing the super-complex internal workings of ClojureScript and Clojure lets me naively hope that we could unify macro handling one day and use a single ns form for both ClojureScript and Clojure.
right. CLJS-1507 is the closest to realizing that dream (for many common lib consumption use cases) that I'm aware of
Is there a trick to getting source maps to work in browsers other than Chrome?
@xcthulhu Thanks for that fn on the nested prop retrieval in a js obj
I ended up changing it to just a reduce
@ivanreese: Firefox has sourcemaps support also, it should be the same. Vivaldi is using the same dev tools as Chrome. Not sure about Safari or IE since I'm on a Linux box
I tested with FF and Safari — log statements in the console point back to JS source. In Chrome, log statements in the console point back to CLJS source. I was just curious if this is a known issue, or if it's possible that I might have something misconfigured. I've used source maps in Safari before on purely JS projects, so I know it's possible. Not a big deal, I can just use Chrome (though it's absolutely my least favourite browser ducks )