Fork me on GitHub
#shadow-cljs
<
2020-03-14
>
Quest00:03:57

In the last 8 days of #shadow-cljs channel history, thheller has posted 122 comments (15 / day.) This is grade A support -- even better than paid teams at some workplaces. If you like shadow-cljs, please consider supporting him via Patreon (http://patreon.com/thheller) or Paypal. (http://paypal.me/thheller) (Not affiliated, just an appreciative consumer.)

šŸ’Æ 48
ā¤ļø 40
thheller01:03:16

don't forget about https://github.com/sponsors/thheller šŸ˜‰

šŸ‘ 4
andrea.crotti10:03:11

probably stupid question, but is it even possible to test re-frame handlers/subs with node?

andrea.crotti10:03:43

I guess maybe I have to use a browser to test it, even if the subs/events are not really touching the dom at all, it seems not to work

Ben Hammond17:03:45

n00b question; I'm trying to figure out how best to use shadow/intellij/deps/react/material-ui. Does shadow include a static file server to enable it to serve up the files it just compiled? or do I have to use npm/yarn (or something else) to view from browser? All the examples I can find use yarn start to serve up files and I'm wondering if that is mandatory, or if there is a more clojure-heavy way to do it

Ben Hammond17:03:12

My background is in clojure/java, and not at all in NodeJS, so perhaps I am merely displaying that bias...

Felipe Marques17:03:33

It provides it. If you have a config with this:

{:dev-http {8080 "public"}}
It will serve all the compiled files in the public folder through port 8080.

šŸ‘ 4
Ben Hammond17:03:52

perfect! thanks

Felipe Marques17:03:42

There is also the :devtools option that you can put in a build, to configure stuff such as which function to run after the code has been reload at the browser.

lilactown17:03:44

You will need to install shadow-cljs via npm or yarn

Ben Hammond17:03:18

yes I have done that

lilactown17:03:32

The shadow-cljs app itself is a clojure program, which yarn start or what have you just shells out to

Ben Hammond17:03:40

but I prefer to shuffle out of my comfort zone rather than stride

lilactown17:03:56

If you prefer to use deps.edn and Clojure aliases to start the program, that can be done

Ben Hammond17:03:09

yes that is exactly what I am doing

Felipe Marques17:03:16

You can also run it through clojure only. You add the dependency to the deps.edn and config a alias to run the main of Shadow-cljs. But I had problem connecting to the ClojureScript repl using this setting.

lilactown17:03:11

REPLing will depend on your editor. Iā€™m not super familiar with Cursive. thheller (the author) uses it though

Felipe Marques17:03:40

I use emacs. It is a repl middleware problem. I just didn't took time to look into it.

lilactown17:03:43

starting a watch for your build will automatically start the dev-http server if you configure it in your shadow-cljs.edn

jplaza17:03:37

I recently started playing around with shadow-cljs too and used npx create-cljs-project acme-app to bootstrap my app

jplaza17:03:16

Running npx shadow-cljs watch app will run a dev server

Ben Hammond17:03:35

yeah, I'm trying to stay on the clojure toolset that I already understand, rather than the NodeJS one that I don't

Ben Hammond17:03:51

which may cause me futher problems of course

jplaza18:03:57

Oh I see, but you will eventually have to surender and start learn node tooling if you want to do UI work, at least my opinion šŸ˜„

āž• 4