This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-27
Channels
- # admin-announcements (1)
- # announcements (11)
- # babashka (17)
- # beginners (26)
- # calva (6)
- # cider (2)
- # circleci (1)
- # clojure (41)
- # clojure-dev (1)
- # clojure-europe (31)
- # clojure-france (2)
- # clojure-italy (10)
- # clojure-nl (7)
- # clojure-norway (5)
- # clojure-spec (15)
- # clojure-uk (42)
- # clojurescript (4)
- # code-reviews (12)
- # conjure (10)
- # datalog (2)
- # datascript (15)
- # datomic (37)
- # emacs (1)
- # events (5)
- # fulcro (19)
- # jobs (1)
- # jobs-discuss (9)
- # kaocha (2)
- # luminus (14)
- # meander (4)
- # membrane (39)
- # off-topic (26)
- # other-languages (2)
- # re-frame (13)
- # reitit (6)
- # rewrite-clj (39)
- # sci (6)
- # shadow-cljs (33)
- # test-check (15)
- # vrac (17)
- # xtdb (7)
Hey there!
Would it be possible to somehow run :browser-test
and :node-test
targets within the same shadow watch process? If I do this at the moment, shadow looks up for namespaces with "-test$"
regexp and node-specific tests land in the browser-test target.
So the options would be either to run separate shadow processes with different classpaths, or to have more precise namespace naming convention for the regexps (like "$browser([\w-\.]+)test$"
and "$node([\w-\.]+)test$"
)?
@me1676 if you structure your namespaces just right that might be enough too? your.app.frontend.foo-test
vs your.app.backend.foo-test
or your.app.whatever.foo-test
?
happy to add more filtering options if needed too. you also have the option to specify namespaces directly instead of just a regexp
Do you think it would be possible to add something like :filepath-regexp
to filter based on the file paths?
I mean it doesn't make sense in how I organize my tests so I first need to understand how you organize your tests to make a useful impl 😛
Alright, I’ll try explain. Source directories: src/browser — Namespaces pitch.app., pitch.components., pitch.integrations., pitch.something-else. src/node — Namespaces pitch.node., pitch.something-else. Test directories: test/browser — Namespaces pitch.app.-test, pitch.components.-test, pitch.integrations.-test, pitch.something-else.-test test/node — Namespaces pitch.node.-test, pitch.something-else.-test Unfortunately just by looking at the namespace it’s not possible to understand to if it belongs to browser or node bundle, that’s why ns-regexp can’t work in our case. However, if we can apply a regexp to the filepath of a cljs file, then it becomes easy
that's actually quite awesome to know (does it matter in that case that watch-dirs overlap?)
The problem was rather more stupid than I'm comfortable admitting - I had a terminal window burrowed somewhere that still had a watch job only on app running
@thheller, do you have any advice on how to enable data_readers.cljc
for a self hosted build? here is the shadow-cljs.edn
: https://github.com/sritchie/maria/blob/sritchie/last_attempt/editor/shadow-cljs.edn
I found a reference on the site about the compiler option to enable this (and your footgun warning 🙂 ), but it seems to not work when I add :compiler-options {:data-readers true}
to the bootstrap build
"not work" means, grabbing the error...
this does indeed work at a repl with data_readers.cljc
loaded, and I can see that it did make it into the jar
@sritchie09 for self-hosted that you are compiling you need to handle data-readers in the compiler yourself. nothing shadow-cljs can do to help that.
here be dragons!
thanks for the note, @thheller, I'll see if I can figure out how to get it working down the road
(set!
cljs.tagged-literals/*cljs-data-readers*
(merge cljs.tagged-literals/*cljs-data-readers*
{'sicm/complex sicmutils.complex/parse-complex
'sicm/bigint sicmutils.util/parse-bigint
'sicm/ratio sicmutils.ratio/parse-ratio}))
as a hack, @thheller this does it, if I type this in on the page itself!
and write down my lessons from the mines
Sorry to double-post, but I think I asked this after-hours last night and missed everyone. I'm rather stuck on it, so fingers crossed there's an easy answer:
How should I use a CommonJS/ES6 namespace in a ClojureScript macro? I'm following @thheller's https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html, which suggests that `defmacro` within a .`clj` file should use a fully-qualified namespace. But going by the shadow-cljs User Guide's https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages, I don't see how to use a fully-qualified namespace with CommonJS/ES6 imports, because they are referred to with strings as in `(:require ["module-name"])`.
@neil.hansen.31 I recommend that you don't access npm packages directly but instead create a helper fn that does so and call that from the macro