Fork me on GitHub
#shadow-cljs
<
2021-02-04
>
hadils15:02:09

Ok. I am using React Native and Expo with an iOS simulator. I got the IP addresses to line up and disabled fast refresh on the simulator. When I refresh my code the simulator displays the new set up immediately, then reloads the previous state. What am I doing wrong?

thheller15:02:28

probably still have the expo reload active

hadils15:02:54

It says disabled on the simulator pop-up...

thheller15:02:50

sorry I don't use react-native or expo and it has been a couple years since I tested this. there used to be a separate expo reload. no clue if that still exists. I cannot help you track this down but if you see two reloads then this is the most likely cause.

hadils15:02:14

Ok, thanks for the lead!

rschmukler16:02:25

Hey all! I recently just updated my shadow version on a project (from 2.8 to 2.11) and am now seeing a "Failed to inspect file <path>.css" - it's coming from a JS file that is built and imports a CSS file via require. I would expect this issue https://github.com/thheller/shadow-cljs/issues/598 to have solved this, but maybe I'm missing something. I also kinda remember an ignore-resources option existing once, but I'm not sure if I'm misremembering

rschmukler16:02:45

Any tips on how to best resolve this?

rschmukler16:02:11

(Also, interestingly, the same application compiles fine under 2.8)

thheller16:02:26

@rschmukler the default changed from ignoring asset css requires to failing them so they don't go unnoticed. you can set :js-options {:ignore-asset-requires true} to get the old behaviour

rschmukler16:02:51

Wonderful, thank you for the help! Is this potentially worth documenting in the user-guide? I will add a comment to that issue as well

isak17:02:27

Having a problem with inspect - my taps are not showing up in the Inspect stream. I have devtools.preload in the :preloads. Has something changed?

thheller17:02:56

devtools.preload? that is not from shadow-cljs or related to inspect

isak18:02:46

Ah, that is the console.log formatter, never mind. But yea sounds like I should be seeing taps, but I'm not seeing any.

thheller18:02:28

check the browser console if its connected properly

thheller18:02:10

don't know what you are doing so really can't help much. try shadow-cljs browser-repl or shadow-cljs node-repl and see if those show up

isak15:02:07

I'm running tap> in my code that runs in the browser, then trying to inspect those values in

isak15:02:13

I'm sure the tap>s are getting executed because I have console logging on the same code path

isak15:02:06

And yea, it does say stuff like shadow-cljs: #21 ready! in the console also.

isak15:02:57

I just tried executing tap via browser-repl, and those values do show up

thheller15:02:09

do you maybe tap> too early? like on page load?

isak16:02:04

hmm yea it is pretty quick, I'll try delaying it

thheller16:02:49

the tap> is only setup after the ready message so if you log before that it won't make it to the UI

isak16:02:51

yea, that was it

isak16:02:03

Can my program listen for the ready message?

thheller16:02:49

no, not currently

isak16:02:35

Would you accept a PR to have the shadow tap listener queue messages until the page is ready, then flush?

thheller16:02:26

if you do it in a clean way. the way this is currently set up this isn't easily possible.

isak16:02:48

Ok, I may give this a shot. Thanks for the help!

thheller17:02:20

doesn't require any config actually, it is on by default with watch builds

Adam Helins18:02:45

I am watching my source files using Hawk. Ordinarily, when I hit save, I get 1 :modify event as expected. However, when running Shadow in watch mode, saving a single file results suddenly in all that io:

:hawk :create #object[java.io.File 0x18f77246 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :modify #object[java.io.File 0x52954b80 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :delete #object[java.io.File 0x58038f69 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :delete #object[java.io.File 0x7f50d4a /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :create #object[java.io.File 0x43e0fe21 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc~]
:hawk :create #object[java.io.File 0x393148d /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :modify #object[java.io.File 0x3fffaee3 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :delete #object[java.io.File 0x4b70ec0a /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc~]
Is that normal?

thheller18:02:55

shadow is just watching. it never modifies your source files ever, it only reads. the events happening are done by you

thheller18:02:01

likely your editor

Adam Helins18:02:33

Hmmm, weird, I get that behavior only when Shadow is running (same editor and all...)

Adam Helins18:02:54

But yeah, I was surprised at the idea it might modify anything in the source

dpsutton19:02:12

i'm attempting to startup up a :deps true style project with CIDER. I'm getting the dreaded "missing instance". I remember reading in the users guide (although i can no longer find it) that if i made sure ensure that shadow's middleware was included all would be good. I'm attempting:

/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.25.8"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\",\"shadow.cljs.devtools.server.nrepl/middleware\",\"cider.piggieback/wrap-cljs-repl\"]"]}}}' -M:test:cider/nrepl
and then
(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
after startup and i'm still getting the missing intance message. Is there something i'm skipping over?

dpsutton19:02:50

piggieback is not necessary but cider still sticks it in when doing clojurescript

dpsutton19:02:38

ah i'm sorry. I've found (and documented before) that i need to call (shadow.cljs.devtools.server/start!)

thheller20:02:00

@dpsutton yeah missing instance always means that shadow-cljs has not been started in the JVM you are connected to. which won't happen if you just start an nrepl server like the command above.

👍 3
dpsutton20:02:56

the strange thing is i had npx shadow-cljs server which includes :nrepl {:port 8701}. My understanding is that it would have been the server

thheller20:02:16

yes, that is the server but you don't seem to be connected to it

thheller20:02:47

the above commands starts its own nrepl server in a new JVM which cider then probably connects to

thheller20:02:26

if you want to do it absolutely correctly and the way it is intended then DO NOT configure a fixed :nrepl port and instead look up the port in .shadow-cljs/nrepl.port

thheller20:02:33

or rather teach cider how to do that 😛

thheller20:02:00

still no clue how cider works or does

dpsutton20:02:05

haha. i know more about it than only 2 or 3 people and i'm still working it out 🙂 Trying to figure out how to setup for local dev

Lukas20:02:39

Hello, I use emacs/cider and have a clojurescript project build with shadow cljs. I connected to the nrepl server, but I'm not able to send s-expressions to the repl with C-c C-e like I normally do. Can someone here me with this?

dpsutton20:02:26

wanna chat in #cider for the time being? Most likely an issue with setup and not actually shadow

Lukas20:02:41

Okay, I already raised the question in #cider 🙂

Lukas20:02:58

should I delete this thread?

dpsutton20:02:17

nah. its a single comment and if anyone has a similar issue maybe they'll be directed to #cider

Nolan23:02:48

hi there—think im running into a user error here when trying to override config from the repl. ive been trying to walk this path:

(shadow/compile
 :build1
 {:config-merge
  {:closure-defines '{ true}}})
and i must be getting something slightly off because it gives the error that the structures can't be merged. the exception makes it look like the structure is a seq of map entries rather than a map potentially? sincere apologies if ive missed something in the manual that addresses this use-case

Nolan23:02:11

i actually think the solution im aiming for will eliminate the need to do this, but in general this seemed like something someone might want to do

Nolan00:02:34

ah, impeccable what a few minute break and a glass of water will do. this works as expected:

(shadow/compile
 :build1
 {:config-merge
  [{:closure-defines '{ true}}]})
which makes sense in hindsight. apologies for the noise!

isak15:02:07

I'm running tap> in my code that runs in the browser, then trying to inspect those values in