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 <http://10.0.2.2:8080>
, 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!
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 <http://10.0.2.2:9630>
. After changing that it worked. 🎉
@thheller Thanks, useful to see. I’ll play around with :esm and see what I can get going.
What is supported by :browser
but not by :esm
?
What are the 2 PR’s going to allow for? Will they enable mograting away from goog.provide
?
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.
@thheller is there a way to access the lein project name/version programmatically from within the app?
for instance, in jvm clojure, I can do (System/getProperty "attribute-service.version")`
is there a parallel in cljs you are aware of?
a macro I guess
Is there any reason I should use browser over esm for browser target?
esm is experimental and unfinished. browser is stable and used by many.
you don't gain much by using esm imho