Fork me on GitHub
#shadow-cljs
<
2018-10-15
>
vigilancetech00:10:14

okay, now I started a shadow repl from the terminal on the demo project (minimal-shadow-cljs-browser) and it seems to be working. Now I want to switch over to cider, but when I :cljs/quit out of it and go to cider-jack-in it says the server's already running and doesn't give me a repl buffer in emacs. I even tried reloading the page and restarting the shadow server. How am I supposed to quit out so I can come in from cider without having to reboot my whole machine?

error in process sentinel: Could not start nREPL server: shadow-cljs - config: /home/kevin/tmp/minimal-shadow-cljs-browser/shadow-cljs.edn  cli version: 2.6.6  node: v8.11.1
shadow-cljs - connected to server
server already running

vigilancetech00:10:45

I can reconnect to it from the terminal with shadow-cljs cljs-repl app

vigilancetech00:10:53

also, section 4.3.1 of the user guide says:

If the popular cider-nrepl is found on the classpath it will be added automatically. No additional configuration required.
but the cider's man page says:
Much of CIDER's functionality depends on the presence of CIDER's own nREPL middleware. Starting with version 0.11, When cider-jack-in (C-c C-x (C-)j (C-)j) is used, CIDER takes care of injecting it and its other dependencies.
so, should I remove the cider-nrepl from my system to have it work with shadow or is that the nrepl shadow is looking for?

aaron5102:10:32

When running shadow-cljs tests with karma (3.0.0), how do I run only a single deftest (and rerun when files change)?

aaron5102:10:35

Workaround - replace all (deftest with #_(deftest and comment in the tests you want to focus on. Please let me know if there’s a better way.

richiardiandrea03:10:52

There is no better way at the moment, I think. Other tools analyze the meta on the deftest (for instance ^:focus) but it is not a clojure.test feature

richiardiandrea03:10:26

If you are at the REPL you can use clojure.test/test-var and friends though

👍 4
thheller07:10:21

this is not possible with karma currently no. but you can always just fire up a REPL and run a singular test.

thheller07:10:43

given how karma works it probably won't be a very efficient way to test a single var as all the code still has to be loaded regardless

grounded_sage03:10:54

@thheller all good. Are the plugin docs in the guide? With respect to the Gatsby stuff. I agree it has to be a full framework. I’m investing in Rum due to SSR and open state management. Was more interested in the common implementation details that could be shared if any.

thheller06:10:27

@vigilancetech if cider starts the shadow-cljs server it will add the middleware. it you start it separately you have to add it. I recommend adding it yourself since you then don't hve to worry about if cider adds it or not. adding it twice is not a problem.

thheller06:10:04

I don't understand what you mean by quitting the REPL and cider-jack-in. those are two completely different things

thheller06:10:38

there can also be many connections to a shadow-cljs REPL so you don't have to quit one for the other to take over

thheller06:10:21

I do recommend running shadow-cljs server separately

neupsh15:10:06

Hello, how do i use npm packaged css in clojurescript app? I have installed bulma and 'bulma-react-components` npm packages and am using bulma components in my app by requiring it as ["react-bulma-components" :as bulma], an i can see the component part working. Now, how do i import the css in my app?

neupsh15:10:50

Do i have to include a <link rel="stylesheet" href="..." /> or is there a better way to load npm-packaged css module in clojurescript through shadow-cljs ?

thheller15:10:46

@neupsh shadow-cljs does not process any CSS yet so you have to get it into your page by other means. I typically use the node-sass cli or just copy the css manually into my public/css directory

neupsh15:10:47

@thheller thank you, i will try to use sass to import it and give it a try

sb18:10:31

Hello, shadow-cljs is compatible with sente?

thheller18:10:06

probably? never tested it

sb18:10:08

Means, I would like to use with http-kit and sente and at front-end

thheller18:10:26

well the CLJS side you can do with shadow-cljs yes

thheller18:10:55

the server part I would recommend something more tailored for CLJ development, ie. lein

sb18:10:17

I use lein works fine with http-kit and compojure (shadow-cljs). I just want to use ws to transfer data between parts. Thanks! I check it.

kenny21:10:59

I am using Highcharts with shadow-cljs and am trying to get the no-data-to-display plugin to work. The docs say to add modules/no-data-to-display.js to your imports. I did this by adding ["highcharts/modules/no-data-to-display"] to my :require but that doesn't appear to work. I'm curious if there is any sort of initialization that I need to do to get the plugin to work. Any thoughts?

kenny21:10:48

If I change the require to ["highcharts/modules/no-data-to-display" :as foo] and run (js/console.log foo) it logs a function, not a map like most npm modules do.

thheller21:10:04

are you maybe suppsed to call that function?

kenny21:10:20

I tried with no args and I got an error. Took a guess and called it like this (foo highcharts) where highcharts is ["highcharts/js/highcharts" :as highcharts] and it worked. Very weird. In their examples all they do is add <script src=""></script> to their index.html.

thheller21:10:56

well yeah thats because thats just the browser banging on a global variable

thheller21:10:28

their bundle just then calls that function on load basically

kenny21:10:26

Seems like an odd way to do it.

kenny21:10:19

I suppose that isn't an abnormal conclusion when working with JS libs though...

thheller21:10:49

indeed 😛

thheller21:10:39

@wilkerlucio just published 2.6.11 which should now properly use the REPL ns even for CLJS

wilkerlucio00:10:09

nice! once I get home I’ll try it out

vigilancetech00:10:53

I did npm -g up shadow-cljs from root but it still says: server version 2.6.6. Any idea what I did wrong?

wilkerlucio01:10:58

@vigilancetech are you using the lein integration? if you are check the version on the project.clj

vigilancetech01:10:17

no, just shadow straight

wilkerlucio01:10:33

update the local version as well, install without -g

vigilancetech01:10:41

ah, that did it! Thanks!

wilkerlucio01:10:24

glad it worked

👍 4