This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-11
Channels
- # aleph (1)
- # aws (4)
- # aws-lambda (5)
- # beginners (85)
- # cider (39)
- # cljs-dev (3)
- # cljsrn (1)
- # clojars (1)
- # clojure (129)
- # clojure-italy (14)
- # clojure-nl (5)
- # clojure-nlp (1)
- # clojure-uk (61)
- # clojurescript (52)
- # cursive (3)
- # datomic (42)
- # duct (3)
- # emacs (9)
- # fulcro (60)
- # graphql (2)
- # juxt (2)
- # keechma (1)
- # leiningen (4)
- # midje (2)
- # off-topic (8)
- # onyx (3)
- # overtone (1)
- # re-frame (22)
- # reagent (51)
- # reitit (3)
- # remote-jobs (3)
- # ring (4)
- # ring-swagger (1)
- # rum (4)
- # shadow-cljs (14)
- # specter (28)
- # tools-deps (85)
- # vim (9)
does anyone know of a way to get the compiler to use the “production” cljsjs dependencies in development mode? I’m trying to diagnose a problem that only happens when using production react (minified), but will be much faster to deal with if I can work through it with hot code reload and incremental compile
all I can think to do is “roll my own” react cljsjs dep, which is doable, but annoying
if you supply a foreign dep in your build EDN with an identical :provides
whatever you specify will override the dep’s foreign spec
@www.w.com123 can’t do that in Clojure (and thus ClojureScript)
@www.w.com123 there was discussion of that on clojureverse (https://clojureverse.org/t/shortand-clojure-syntax-for-properties-on-hashmaps/1918). There was a provided macro if you were interested
Thanks
I’m looking at Firebase Functions, and in the examples they provide, they want you to do stuff like this:
exports.app = functions.https.onRequest(app);
What is exports
and how would I attach something like (. (.-https functions) onRequest app)
to it? Running (js/console.log js/exports)
, exports
doesn’t seem to be an object available by default.@henrik https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-library :exports {:app your.ns/app}
(def app (.. https -functions (onRequest ...)))
Thanks @thheller, I ended up recreating my entire project from scratch. Now I have a fairly working combination of shadow-cljs + re-frame + Firebase + Flamelink (headless CMS) + server-side-rendering, which is a fair amount of moving parts to get right. To me, dev in the JS ecosystem feels a lot like shaking a box of Legos really hard and hoping that a castle pops out.
yeah absolutely agree. I recently started some experiments for azure functions using shadow-cljs https://github.com/thheller/shadow-cljs/issues/297. want to do the same for firebase functions eventually. coding them should just feel natural and let the build take care of all the boilerplate
@henrik that sounds like Node-ism to me? If you can sort out what they mean by exports
attaching stuff to that is trivial
Thanks, I ended up recreating the project from scratch, then setting module.exports instead of exports (which didn’t work previously), and it works fine now. I love non-deterministic programming.
question about invoking a clojurescript function from javascript…
let’s say I have this function def
(ns jaydeesimon.core)
(defn ^:export make-str [{:keys [x y]}]
(str x y))
how do i invoke that from javascript?
jaydeesimon.core.make_str({x: "hello" y: "world"});
?
doesn’t seem to work…i tried looking at the transpiled source for clues but it wasn’t obvious
gotcha. so what would i need to pass in?
thank you. is there a way to invoke the function using the original signature (passing a clojure map)?
got it. thanks for clarifying!
also there are plenty of useful Closure Library fns for dealing with JS data - if that’s more natural for your program I would avoid marshalling back and forth - haven’t heard enough about your goals to know which makes more sense
if you already have a bunch of code using Clojure data structures then what @thheller suggests is best
@bravilogy maybe parinfer can do that? \cc@shaunlebron
@dnolen, i would love to be pointed to any Closure Library fns you think are related. i’m in exploration mode right now. i’d like to write some clojurescript functions and know how to use them from javascript. i was playing around with it and realized I had written a function passing in a map (and was destructuring it) and then couldnt figure out how to call it 🙂
i ended up rewriting it so that I was just passing in the map values as args but I figured I should hear from the experts
:thumbsup:
@bravilogy check out cljfmt, zprint, and parlinter
parlinter doesn’t insert/remove newline, and the others do
Is there any way to run unit tests in ClojureScript without explicitly naming all the namespaces I want to test? I'd like to write an internal utility (e.g. a leiningen alias) to make it easy to automatically run clojurescript tests in any of our clojurescript-compatible projects, but the necessity of a "test runner" that explicitly depends on namespaces to test is preventing me from making such a thing.
Not sure if it is possible in cljs, but in Clojure you can do like that: project.clj
:test-selectors {:default (complement :integration)
:integration :integration
:all (constantly true)}
test file
(deftest ^:integration orders-test
(testing "orders"
(is (= order-36205 (get-order hc 36205))
"one order")))
If I compile two ClojureScript artifacts to two separate index.js
files and require them in the same node process, am I going to have problems generally with the spec global registry? Or any global for that matter?
Has anybody tried something like that?