This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-08
Channels
- # architecture (20)
- # beginners (140)
- # cider (155)
- # cljsjs (1)
- # cljsrn (29)
- # clojure (53)
- # clojure-dev (9)
- # clojure-italy (40)
- # clojure-nl (13)
- # clojure-poland (4)
- # clojure-russia (8)
- # clojure-uk (51)
- # clojurescript (74)
- # cursive (36)
- # data-science (1)
- # datomic (3)
- # emacs (14)
- # fulcro (11)
- # graphql (2)
- # java (21)
- # javascript (2)
- # jobs (3)
- # nrepl (7)
- # off-topic (18)
- # om-next (1)
- # onyx (9)
- # portkey (8)
- # re-frame (72)
- # reagent (64)
- # reitit (4)
- # remote-jobs (1)
- # rum (1)
- # schema (1)
- # shadow-cljs (49)
- # slack-help (1)
- # spacemacs (8)
- # specter (7)
- # tools-deps (27)
- # vim (28)
are there any best practices on testing a re-frame app with shadow-cljs? i use emacs and cider for development, and i love cider-test-run-all-tests
and cider-test-run-ns-tests
. i guess i don't get this kind of emacs integration with shadow-cljs easily, right?
yeah the cider-nrepl middleware for this directly interfaces with clojure.test. no support for CLJS in general
yes, i noticed that too. i think i'll just go for continuous node-tests for now. i think i could still later on switch to using cljc
tests
rlwrap shadow-cljs node-repl
shadow-cljs - config: /mnt/c/Users/thheller/code/shadow-cljs/shadow-cljs.edn version: 2.3.19
shadow-cljs - connected to server
[:node-repl] Configuring build.
[:node-repl] Compiling ...
[:node-repl] Build completed. (39 files, 19 compiled, 0 warnings, 7.92s)
[1:1]~cljs.user=> JS runtime connected.
[1:1]~cljs.user=> (require '[cljs.test :refer (deftest is)])
nil
[1:1]~cljs.user=> (deftest foo-test (is (= 1 2)))
{:namespaces {cljs.user {:vars {foo-test #'cljs.user/foo-test}}}, :hooked true}
[1:1]~cljs.user=> (foo-test)
FAIL in (foo-test) (at C:476:9)
expected: (= 1 2)
actual: (not (= 1 2))
nil
[1:1]~cljs.user=>
@thheller Does 2.3.20 have the updated filter for less
files?
👍:skin-tone-2:
I’ve added a project called tubax
to my edn
file, and when the page refreshes that has the dependency, I see this: The required namespace "ext.saxjs" is not available, it was required by "tubax/core.cljs".
I’m not sure if tubax is broken, or if I’m not configuring shadow to import it correctly.
So it looks like tubax has an assets/deps.cljs
file
and it bundles sax.js
with it
Can anyone help me with understanding of the :default
key in shadow cljs requires?
These are my requires:
["react" :refer [createFactory]]
["@atlaskit/field-radio-group" :default radio-group]
Here I create a factory and use the component:
(def radio-group (createFactory radio-group))
(radio-group #js {...})
I assumed the call to radio-group here would result in a call to the factory and not the class radio group. Is this a wrong assumption?
If I change my require from ["@atlaskit/field-radio-group" :default radio-group]
to ["@atlaskit/field-radio-group" :as radio-group]
and my def from (def radio-group (createFactory radio-group))
to (def radio-group (createFactory radio-group/default))
my code does work.@fatihict i do essentially the same thing with react-flip-move but I use reagent’s adapt-react-class instead of createFactory and it works
but given that you get it work work with the alternate syntax I wonder if there is something messed up with the default import
@fatihict :default
is tricky since it depends on whether the npm lib was packages as commonjs or es6
@jmckitrick funcool has a lot of these ... :foreign-libs
are not supported. it appears to be this package https://www.npmjs.com/package/sax
Ah, ok.
so npm install sax
and then create a (ns ext.saxjs (:require ["sax" :as sax])) (js/goog.exportSymbol "sax" sax")
Got it!
While I’m thinking about it, the react-select
component works great, but the X
icon for removing a ‘chip’ from the multi-select mode is rendering as a ~A
or something like that. It’s supposed to me ×
. Would that have anything to do with shadow?
I was UTF-8 before UTF-8 was cool, lol.
Actually, this is from the cloned quickstart…
So I might open a PR for this
Boom. Problem solved.
I should have thought of that, but it’s something I so rarely deal with….
I forgot the simple stuff, too. Was thinking of minification, etc.
Ah, good to know. Thanks @thheller & @lee.justin.m
@jmckitrick are you using the proxy support? that might be the problem. the dev server usually sets charset=utf-8 via http headers
Hmm. Let me see…
Yes, let me restart without and see…
Actually, that did not solve it. But the meta tag did.
Will do.