This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-22
Channels
- # announcements (3)
- # beginners (22)
- # braveandtrue (6)
- # calva (2)
- # cider (85)
- # cljdoc (1)
- # cljs-dev (21)
- # cljsrn (2)
- # clojure (70)
- # clojure-italy (9)
- # clojure-spec (1)
- # clojure-uk (144)
- # clojure-ukraine (6)
- # clojurescript (109)
- # cursive (59)
- # data-science (15)
- # datomic (40)
- # emacs (8)
- # fulcro (64)
- # funcool (8)
- # graphql (8)
- # hispano (3)
- # hoplon (7)
- # jobs-discuss (29)
- # leiningen (3)
- # luminus (2)
- # off-topic (13)
- # onyx (9)
- # parinfer (49)
- # pedestal (2)
- # portkey (8)
- # re-frame (10)
- # reagent (33)
- # reitit (13)
- # ring (2)
- # ring-swagger (16)
- # shadow-cljs (193)
- # spacemacs (1)
- # sql (19)
- # tools-deps (19)
@thheller do you have any plans to support requring CSS in JS, like webpack allows? what do you use for this functionality?
I do have plans for that yes, nothing actually usuable yet though. I just use node-sass
currently.
So after realizing that the browser test wouldn't do for me I'm exploring node-test
I think this is what react uses with jest when you create a react app from the scaffold
========= Running Tests =======================
SHADOW import error /home/user/project/.shadow-cljs/builds/test/dev/out/cljs-runtime/shadow.js.shim.module$semantic_ui_react$dist$es$index.js
/home/user/project/node_modules/semantic-ui-react/dist/es/index.js:2
import _Confirm from './addons/Confirm';
^^^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
@urbanslug thats ES6 code which doesn't work natively in node. there is some option to enable it but I forgot.
you are also probably testing browser stuff so :browser-test
or :karma
may be better suited
Ah > karma is generic, not tied to any framework. its just a headless browser basically.
hmm I have a problem with this args: ["shadow.test.karma.init"],
in my karma.conf.js
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/karma.cljs#L113
basically that just makes sure that some output is emitted that karma can understand
I also installed what was here https://github.com/Day8/re-frame-test#running-the-cljs-tests-with-karma but not sure that it helped
this is my aim too but I literally needed a way to run the tests somehow in CI > basically I only test critical functions that work with pure data
is there a reason you chose a different dir for your karma tests output? than the usual resources/public
...
When I figure out what I'm doing I'll try improve the docs. They could do with some clarification. Comments like don't mess with karma client args
Also the need to set CHROME_BIN=chromium
or whatever it is I wonder how nicely this will play in CI
seems people install the whole damn thing https://github.com/Zenika/alpine-chrome/blob/master/Dockerfile#L10
I can't make any recommendations regarding karma. I don't use it. I don't know how it works.
probably true. it didn't seem to execute the updated code when i changed the source of the dispatch function
ah yeah defmulti
is basically defonce
. you can only change the dispatch fn if its a reference to some other fn
has anybody have this before with deps.edn
?
shadow-cljs - starting via "clojure"
Error building classpath. nil
java.lang.NullPointerException
ok got it
...almost
now I got it, crazy maps 😄
it's a clojure
issue
error reporting is not helpful when there are mistakes in the deps.edn
file
@urbanslug @thheller we currently have Karma running tests under shadow-cljs in a CI env. happy to help if you need it
are folks here using shadow-cljs
in Cursive? I have a question 😄
@thheller how do you setup the REPL? If the port is random, can you still use the nrepl file automagically for that?
(writing a post btw, so this will all be documented :D)
uhm, which Run
configuration do you select?
and how do you lauch the nrepl server? within Cursive?
just running npx shadow-cljs server
in the build-in terminal and leaving that running
ok I though there was a way to run it inside, if external then I am already good 😄
thank you
@biscuitpants hmmm do you have a way to watch your karma tests?
@thheller question, is there a function for unwatching a build?
I see shadow/stop-worker
but start-worker
is priivate
ok, what about making it consistent? adding unwatch
or something? even just an alias
will think about it more, don't even know if there is some usability issue there, just going through what I have written it felt ....itchy 😄
I think its fine. just need to document what a worker
is since people technically only ever see watch
well, I was thinking if there is a use case where you don't want to watch the logging
just compile...
but maybe not
because logging gives you the errors
worker
is just more generic term for "process responsible for managing the build compilation"
yeah...if we had protocol server on the shadow server, one wouldn't need to check the terminal for errors I guess, but we are not there yet
so you actually have to watch
we'll the pure REPLs (node-repl, browser-repl) don't watch at all so it is possible working without watch
yep for browser you actually see errors in there
true, for now node, you will see evaluatiion errors
I like this actually, I think I will try this workflow
I also added shadow/watch-compile-all!
for compile-on-key-press vs compile-on-file-save
ok nice
that is very cool actually
fits very well into my workflow
and bind the trigger to a key. so you can compile all changed files when pressing that key instead of all the time a file is changed
that's awesome
that key just send a REPL command?
yep I guess 😄
oh the above command, right
yeah just send (shadow.cljs.devtools.api/watch-compile-all!)
to the REPL on keypress
when I get tired of nrepl I sometimes use clojure.main
REPL with -m shadow.cursive-repl
I was trying just now clojure -A:dev:tree -m shadow.cljs.devtools.cli server
yeah I am documenting both..for nrepl
this is also valid clojure -A:dev:test -m nrepl.cmdline
(does not end up in shadow.user
though
and the you need also --middleware
I guess, so I am not documenting that one 😄
how do you connect to socket REPL?
does not seem to work here
Exception starting REPL: java.lang.ArithmeticException: integer overflow
ok will try that
kk yeah well, I don't see much here actually
@thheller is there a difference between repl
and nrepl-select
?
Ok cool then
@thheller so watch-compile-all!
does not work if I am not watching?
because I want a worker and do not want to watch
but want watch-compile-all!
😄
yeah it still needs the worker. its meant to be combined with (shadow/watch :the-build {:autobuild false})
for now
oh so in that case wouldn't start-worker
make sense?
yeah I think that is my main objection
watch-compile-all!
is also meant for force-triggering a compilation for builds that may be stuck
yep I think I got it now
just was missing (shadow/watch :script {:autobuild false})