Fork me on GitHub
#shadow-cljs
<
2019-09-13
>
David Pham05:09:53

Anyone managed to connect shadow-cljs & Cider to the REBL?

myguidingstar10:09:48

how to import css with shadow-cljs? things like in plain js import "react-image-lightbox/style.css";

thheller10:09:13

not supported

myguidingstar10:09:38

so is it possible to create a js file with the above content and include in the shadow-cljs build somehow?

thheller10:09:20

that is a css file

thheller10:09:30

you just build your css separately

thheller10:09:46

I usually use node-sass

thheller10:09:41

you can just copy node_modules/react-image-lightbox/style.css into public/css/react-image-lightbox.css and include it via <link rel="stylesheet" href="/css/react-image-lightbox.css"> in your HTML

thheller10:09:47

how much you want to automate that is up to you

thheller10:09:00

shadow-cljs currently does not process CSS in any way

David Pham13:09:44

@thheller are you on GitHub sponsor?

David Pham13:09:23

I am supporting you through patreon, but GitHub would match my donation for a year :)

thheller15:09:53

@neo2551 not yet. I applied though.

deadghost16:09:20

I'm trying to write/use a macro and am getting Use of undeclared Var myproject.views.home/*clojure. Looks like the kind of error where I'm missing something obvious (like maybe needing to require clojure somewhere)

thheller16:09:35

@deadghost hard to tell without more info. is *clojure your macro?

thheller16:09:42

the error is exactly that. something is trying to access myproject.views.home/*clojure and it doesn't exist. no more to that error than that.

deadghost17:09:59

nope defcomponent

thheller18:09:55

@deadghost well the *clojure must be coming from somewhere. If you want help you need to provide more code. it is impossible to guess what you are doing

mokr19:09:13

Hi, I’m new to shadow-cljs. Is there a way to get hot reloading of plain js files? Usecase: I usually write d3.js code in clojurescript, but I would like to try to write that part in plain js instead. My project is base on the Luminus template.

thheller19:09:13

not really. it works in some limited fashion but I wouldn't call it reliable

mokr19:09:48

OK. How do I go about trying the limited variant?

thheller19:09:20

code must be written in ESM style so import/export no require/module.exports

mokr19:09:13

Thanks, I skimmed that doc quickly earlier today, but I’ll read it more closely. I believe my use case is rather simple, so I’m optimistic. Thanks for the quick reply!

Saikyun20:09:24

hello, playing around with expo + shadow-cljs. I'm currently using shadow-cljs cljs-repl in order to connect with a repl to the app running on my phone, this works well, which is fantastic! my only problem is that when adding new requires I have to run shadow-cljs compile, and then reload the app. this seems to disconnect shadow-cljs cljs-repl. I was wondering if there was a way to reconnect it? my computer is pretty slow, so it generally takes a while to restart everything

Saikyun20:09:07

@mokr I remember doing something like deleteing modules I wanted to be reloaded in a function that runs whenever shadow-cljs recompiles. e.g. in such a function:

(defn start
  {:dev/after-load false}
  []
;; delete stuff here
)
maybe that can help? 🙂

Saikyun20:09:50

I think something like this: delete require.cache[require.resolve('./b.js')] 🙂

Saikyun20:09:36

as always, great job thheller. I've managed to get opengl + cljs on mobile working thanks to your amazing tool 😄

David Pham20:09:23

OpenGL inside expo?

Saikyun21:09:06

@neo2551 yeah, using three and expo-gl.GLView 🙂

thheller21:09:23

@saikyun I'm confused about what you said. you must have a shadow-cljs watch running for your build, so running compile is pointless?

thheller21:09:55

you will however need to reload the react-native app

thheller21:09:11

since the requires are filled by exp/react-native and that cannot be done at the REPL

thheller21:09:53

you only ever need to restart shadow-cljs when :dependencies change. no other restarts are ever required if you use shadow-cljs server