Fork me on GitHub
#shadow-cljs
<
2020-03-12
>
ikitommi07:03:04

migrating a project from lein+figwheel to shadow-cljs+deps. What is a good way to watch & compile less into css with this combo?

thheller09:03:53

@ikitommi what did you use before? I typically just run the node command like tools separately which usually have some kind of built-in for watch. eg. https://github.com/sass/node-sass#command-line-interface

ikitommi11:03:35

thanks @U05224H0W, the project uses an old cljs-lib, which has less-fragments that need to be included in the project (https://github.com/metosin/komponentit/tree/master/src/less/komponentit), need to copy those into path if would like to use some node-based cli.

ikitommi11:03:48

https://github.com/Deraen/less4clj#clj integrates into clj cli it seems and sees the classpath of that lib too

ikitommi11:03:54

are there any guidelines how to package and deploy cljs-libraries that have both cljs code & assets like less/sass-files that could be used from js-based cli’s too?

ikitommi11:03:18

used he less4clj via lein before, swapping to clj cli removes the need for lein so I guess it’s ok.

thheller11:03:35

if you put things in libraries things get rather complicated for node cli tools

thheller11:03:45

I haven't used any of that kind

thheller11:03:06

I guess you'd need to do some kind of "extraction" step

thheller11:03:13

but just using less4clj should be fine too

thheller09:03:58

dunno about less though

roklenarcic10:03:38

I just use a hawk watch to compile

roklenarcic10:03:25

btw I am getting an error when compiling code with 2 modules: two modules without deps, please specify which one is the default

roklenarcic10:03:44

I just wanted to emit an additional file for a worker

thheller10:03:51

you are missing to declare the :depends-on properly

thheller10:03:47

you want/need the extra third shared module

roklenarcic10:03:53

I have to make an empty shared module?

thheller10:03:06

its not empty. it'll collect all the shared code

roklenarcic10:03:30

Hm… the main module is added by nubank.workspaces.shadow-cljs.target which of course doesn’t know about my shared module

roklenarcic10:03:18

I’ll just make the worker depend on main, it’s workspaces, so it’s not a biggie

thheller10:03:26

hmm yeah workers in test builds aren't covered well

lvh17:03:52

Hi! I'm porting an existing figwheel-main project to shadow-cljs. Everything works fine when I run shadow-cljs watch app from the command line. Using Emacs + CIDER with cider-jack-in-cljs, I get

[:app] Configuring build.
[:app] Compiling ...
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0 (package: ) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.[:app] Build completed. (179 files, 167 compiled, 0 warnings, 9.06s)
Everything else mostly works. I was expecting CIDER to inject that dep. Reading messages tells me:
[nREPL] Starting server via /home/lvh/.nvm/versions/node/v11.2.0/bin/npx shadow-cljs -d nrepl:0.7.0-beta1 -d cider/piggieback:0.4.2 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.0-SNAPSHOT server
... this suggests that refactor-nrepl isn't actually getting loaded. Any ideaas?

thheller17:03:28

injecting that into the classpath does not add the middleware automatically

thheller17:03:34

so you need to configure the middleware

👍 4
lvh17:03:11

so :nrepl :middleware in ....

lvh17:03:20

beat me to it. Thanks!

juhoteperi22:03:56

I can't get hot reload or HUD working when managing dependencies with Lein. Any ideas what could cause this? Seems like shadow.cljs.devtools.client.env defines are undefined.

thheller22:03:46

@juhoteperi dependency conflict on the closure-compiler/closure-library

🎉 4
thheller22:03:00

need the versions required by shadow-cljs, defaults from CLJS are too old.

juhoteperi22:03:38

Ah closure-library, I already excluded closure-compiler.