Fork me on GitHub
#shadow-cljs
<
2023-04-12
>
defa14:04:41

One or two years ago, I was able to develop against the :react-native target with an Android tablet connected by USB only. Not Wifi connection necessary by using:

adb reverse tcp:9630 tcp:9630
shadow-cljs watch app --config-merge '{:local-ip "127.0.0.1"}'
This seems no longer to work? The websocket does not try to connect to this :local-ip anymore. Is that correct?

defa14:04:24

Found this older thread here: https://clojurians.slack.com/archives/C6N245JGG/p1663000920346349 It seems that his feature is no longer working. So you now need a Wifi connection to run/debug on an Android device, right? @U061V0GG2 did you manage to find a way to work over USB?

juhoteperi14:04:28

I'm just developing over wifi. And haven't needed any workarounds. And adb over usb or wifi shouldn't be any different.

juhoteperi14:04:38

My problem was just a local iptables rule

defa14:04:02

Will try, but shadow-cljs watch android --verbose --config-merge '{:local-ip "127.0.0.1"}' seems to have no effect anymore.

thheller16:04:48

:local-ip can be set in ~/.shadow-cljs/config.edn or shadow-cljs.edn in the project

thheller17:04:06

it is not a build option anymore, so config-merge doesn't work

thheller17:04:32

but I changed the logic that it tries all network adapters until it finds one that works

thheller17:04:36

that should include localhost normally?

James Amberger18:04:39

Writing for the browser, how should I import a data file, eg json, tsv, or edn?

thheller19:04:08

depends on the filesize and other requirements? sometimes its good to inline, sometimes its better to load at runtime

James Amberger23:04:16

Load at runtime as in serve the file and fetch it?

James Amberger23:04:23

and inline as in...

James Amberger23:04:21

as in (def data followed by vim`:r file` ? or something else

thheller06:04:06

but yes, fetch should be preferred for anything "larger"

Cássio Ribeiro Alves de Ávila19:04:45

Hello! So i'm having a problem that's making me crazy. I have a frontend aplication that runs fine in the desktop browsers and any android browses. But on any iphone, it refuses to load the app.js. The safari manages to GET the app.js, but in the sources tab, I can't see it there. And I just get a blank html page. In a local environment it works fine, but the problem happens when I access the app via the public address, after a deploy

Cássio Ribeiro Alves de Ávila19:04:43

I'm on shadow-cljs 2.20.17 btw

thheller19:04:26

unlikely this has anything to do with shadow-cljs

Cássio Ribeiro Alves de Ávila19:04:40

Do you have any suggestion to where can I look?

thheller19:04:09

the debugger I guess

thheller19:04:41

could be a CORS issue if you are trying to load the .js file from a different domain than the html

thheller19:04:52

could be an adblocker you have installed

Cássio Ribeiro Alves de Ávila19:04:56

The only thing that I have is this message in the console. the GET for the app.js returns 200 too. Could this be something about the compiler optimizations?

Cássio Ribeiro Alves de Ávila20:04:26

Yup! Found the culprit. To solve this Issue I had to set :output-feature-set :browser-2020. Then the release build worked as intended in Iphones. Thanks!

nice 2
Cássio Ribeiro Alves de Ávila20:04:26

Yup! Found the culprit. To solve this Issue I had to set :output-feature-set :browser-2020. Then the release build worked as intended in Iphones. Thanks!

nice 2