Fork me on GitHub
#shadow-cljs
<
2020-12-31
>
Stefan08:12:38

Hi there! I’ve picked up a side project and started using awesome ShadowCLJS again. I’m trying to figure out something but I’m having a hard time. I’m hoping someone here can give some advice. I’m building a :browser target for use in an iOS / Android web view. On iOS I have it working. On Android there’s the issue however that Android has 10.0.2.2 as IP address of the host running the development environment, not localhost. So what I’m observing is that the initial load of my compiles JS bundle is working (because I load it from 10.0.2.2, but then ShadowCLJS tries to connect to localhost. I’ve tried setting :devtools-url` to , but then the websockets upgrade doesn’t work (“error during websocket handshake: unexpected response code: 200”). I have the feeling that it should be possible somehow, but how…? Thanks for any help / pointers!

Stefan09:12:33

While ruminating this over breakfast, I realized that I already knew the solution, just didn’t think of it at the right time. Like the manual says, :devtools-url should point to the primary server. So it should have been . After changing that it worked. 🎉

👍 3
Alexis Vincent13:12:02

@thheller Thanks, useful to see. I’ll play around with :esm and see what I can get going.

Alexis Vincent13:12:42

What is supported by :browser but not by :esm ?

Alexis Vincent13:12:31

What are the 2 PR’s going to allow for? Will they enable mograting away from goog.provide ?

thheller14:12:54

the output will look like :esm currently but a little cleaner I guess. goog.provide is never part of an optimized build so I'm not sure what you mean. CLJS will continue to use that for a while.

ghaskins14:12:02

@thheller is there a way to access the lein project name/version programmatically from within the app?

ghaskins14:12:16

for instance, in jvm clojure, I can do (System/getProperty "attribute-service.version")`

ghaskins14:12:27

is there a parallel in cljs you are aware of?

thheller15:12:36

a macro I guess

Alexis Vincent15:12:14

Is there any reason I should use browser over esm for browser target?

thheller17:12:15

esm is experimental and unfinished. browser is stable and used by many.

thheller17:12:23

you don't gain much by using esm imho