Fork me on GitHub
#shadow-cljs
<
2018-04-20
>
pez09:04:51

I just fixed an unnecessary dependency on lein in the shadow-cljs support of Calva. I guess most people have lein installed. But anyway, now the integrated REPLs are started using the shadow-cljs command.

parrot 4
thheller09:04:39

@pez neat. its still not possible to do custom UI in VSCode right?

pez09:04:56

No, sadly it isn't. And sadly they seem to have decided to let the REPL needs be served by those integrated terminals: https://github.com/Microsoft/vscode/issues/547

thheller09:04:15

yeah that sucks

pez09:04:23

I am still hungry for feedback from anyone revving Calva up for a spin for shadow-cljs projects.

alex-dixon18:04:30

The key functionality I’d want (may be equivalent to brain surgery to do it in VSCode from what I understand) is the ability to highlight text, or put my cursor behind forms and press certain key combinations to send that to the REPL. If Calva has this already forgive me, but I think last time I checked I didn’t see it. Showing the results in the editor isn’t something I really care about at all as long as I can see the repl output somewhere for what I just evaluated

thheller09:04:53

I didn't have time to test it again yet

pez09:04:25

Well, anyone, I do appreciate that you have tons of other things on your plate. 😃

pez09:04:33

If I could interview some people about their shadow-cljs workflows, that would be awesome.

thheller09:04:52

I can tell you mine briefly. run shadow-cljs server or lein repl (when working on shadow-cljs itself). connect to nREPL remotely. run everything else through the REPL.

🚀 4
thheller09:04:21

only using command line for shadow-cljs release ...

thheller09:04:08

one neat feature of Cursive is that it allows you to define snippets of code to send to the REPL on keypress

thheller09:04:22

so I have snippets to start my server and stuff via keybinds

pez09:04:38

So you switch between builds using the REPL?

pez09:04:09

Using snippets?

thheller09:04:41

no, that I do manually

pez09:04:28

Ok. There is a concept of snippets in Code. I will look at what that is.

thheller09:04:47

don't think thats the same

pez09:04:04

Me neither. :face_with_cowboy_hat: It is probably more about boilerplate

pez10:04:44

Thanks for that link. Very helpful!

heyarne11:04:27

could it be that shadow-cljs watch isn't shutting down cleanly when stopped via CTRL + C?

heyarne11:04:34

it happened to me for the second time that i ended up with two ghost proccesses (one in node and one in java); i only realized when i started another instance and experienced very weird bugs

heyarne11:04:57

like objects not satisfying interfaces anymore even though they were when testing it on the repl

thheller11:04:14

do you have another watch running?

thheller11:04:19

different build?

heyarne11:04:25

no, just one build

heyarne11:04:24

it also doesn't happen always (of course not, that would maybe even make it reproducible)

heyarne11:04:50

current macOS

thheller11:04:27

I have no idea how they would interfere with each other on the client side though

thheller11:04:41

the server leaving ghost processes has happened before

thheller11:04:47

still not sure what causes it

heyarne11:04:19

ok. i'll see if i can collect more info if this happens again

heyarne11:04:26

great tool though! thanks a lot

gnl14:04:13

@thheller - about the thing we talked about yesterday - different dependencies in dev and release mode - I actually think this may not be worth looking into at all. The two projects I mentioned are actually one, because re-frame/tracing is a fork of debux and I'm not aware of any other projects that do this. Since there's a workaround for the current situation and it's not really a great idea to do it this way in general, I'd say no reason to waste time/energy on this, unless there's another important use case.

javi14:04:42

I am making a quick editor helper with . Said library uses (js/require ... ) to include the acorn-jsx js parser. I have forked it to patch it, what would be the correct approach to make libs that use js/require universally compatible?

achikin14:04:34

Hi! Could someone point me at good explanation about the advantages of shadow-cljs? I wonder is it worth and is it possible to replace standard pipeline and figwheel with shadow?

gnl14:04:18

It's possible and it works great.

👍 4
gnl14:04:59

(and so far I think it's worth it)

heyarne15:04:19

btw: because it's not quite clear in the docs and you said you needed help, cider works via cider-connect, and then opening a cljs-repl as described (`(s/nrepl-select :build-id)`)

heyarne15:04:27

which is really really neat 🙂

heyarne15:04:09

what doesn't work is refactoring. but i don't know how good refactoring is with cljs anyways, with jvm-clj it's quite good

heyarne15:04:05

@achikin that's actually what i did. it's nice because interaction with the npm ecosystem feels very painless, also configuration is quite easy and mostly just works

heyarne15:04:13

also it feels like compilation is a bit quicker? maybe that's just subjective. biggest pluspoint for me is embracing npm, because i work in a team of frontend-webdevs and if it's on npm it's a bit less alien

achikin15:04:38

This is what I'm actually interested in - having better npm dependency management.

heyarne15:04:24

works. you just require npm modules as you would with clojurescript modules. only surprise i had was when working with d3 i was requiring a module (d3-requests i think?) and it gave me the nodejs version of the module whereas i was expecting the browser version.

achikin17:04:29

I'm looking through the examples, listed in the README.

justinlee17:04:45

shadow-cljs pulls in npm modules directly from the node_modules, so what you do is install them normally using npm or yarn and a package.json.

justinlee17:04:34

note that cljsjs libraries (and some other libraries, like promesa) put the javascript in the jar and wrap it with a :foreign-libs declaration. but shadow-cljs doesn’t support foreign-libs, so it just fakes the namespace and continues to rely on node_modules

justinlee17:04:02

I think this business of reading the javascript directly is why the externs inference works so well

kanwei21:04:55

hey, how do I run multiple builds at the same time?

kanwei21:04:09

shadow-cljs watch app1,app2
etc

kanwei21:04:36

right, just space between works

alex-dixon18:04:30

The key functionality I’d want (may be equivalent to brain surgery to do it in VSCode from what I understand) is the ability to highlight text, or put my cursor behind forms and press certain key combinations to send that to the REPL. If Calva has this already forgive me, but I think last time I checked I didn’t see it. Showing the results in the editor isn’t something I really care about at all as long as I can see the repl output somewhere for what I just evaluated