This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-10
Channels
- # announcements (4)
- # beginners (116)
- # boot (4)
- # calva (63)
- # cider (8)
- # clara (20)
- # cljdoc (10)
- # cljsrn (69)
- # clojure (115)
- # clojure-austin (1)
- # clojure-dev (4)
- # clojure-finland (1)
- # clojure-italy (3)
- # clojure-nl (6)
- # clojure-russia (10)
- # clojure-uk (84)
- # clojurescript (28)
- # cursive (14)
- # data-science (1)
- # datascript (1)
- # datomic (11)
- # duct (3)
- # emacs (13)
- # figwheel-main (11)
- # fulcro (4)
- # graphql (6)
- # jackdaw (2)
- # jobs (23)
- # jobs-rus (1)
- # kaocha (11)
- # lein-figwheel (13)
- # leiningen (55)
- # luminus (14)
- # lumo (22)
- # off-topic (121)
- # pathom (19)
- # re-frame (6)
- # reagent (3)
- # reitit (22)
- # remote-jobs (10)
- # ring-swagger (1)
- # shadow-cljs (67)
- # slack-help (5)
- # spacemacs (1)
- # sql (18)
- # vim (28)
- # yada (2)
Hey gang … I’ve recently ported a re-natal / re-frame project to shadow-cljs / re-frame, which was a good learning experience (I based the ported configuration on @thheller and @pez’s work on rn-rf-shadow)
Feel a bit clueless, but one thing I’m having a bit of trouble with is the correct approach to connect a ClojureScript REPL to my running app from the command line. If anyone can give me the cheat sheet on this I’d appreciate it (with re-natal I’d just run Leiningen using the dev profile to achieve this)
@attentive , this tells about starting the cljs-repl. https://shadow-cljs.github.io/docs/UsersGuide.html#cljs-repl
Thanks! Yeah, I saw that—but when I run (shadow/repl :browser)
or (shadow/repl :react-native)
I get a :no-worker
error … whether from Cider or the command line
Here’s what I’ve done:
shadow-cljs watch app
in one terminal (starts build and reports nREPL server started on <port>)
yarn start
in another (starts Metro)
yarn ios
in another (builds and runs XCode project)
After that, I can connect to the hosted nREPL via M-x cider-connect
without issues, but I can’t boost that to a CLJS repl using (shadow/repl)
If I run shadow-cljs cljs-repl app
in another terminal, I get a REPL prompt but trying to interact with the JavaScript runtime (eg via a (require '["react-native" :as RN])
) fails telling me no application is connected
Apologies for the long message. I’m wondering if there’s something about the way I’m launching the app on the iOS simulator that’s leaving out the entry point for the CLJS REPL connection?
@attentive the commands look correct altough REPL require
likely won't work like that since react-native doesn't really support loading dependencies at runtime
I'm planning to do a cleanup pass over the code to allow at least requiring things that had been required before
if it detects the wrong IP the native app will fail to connect to the websocket endpoint required for the REPL to work
so if you don't see a WebSocket connected!
console message on startup that is likely the problem
Interesting! Yes it’s not doing that. Here’s the messages I see:
shadow-cljs - config: /Users/tom/dev/scout/shadow-cljs.edn cli version: 2.8.24 node: v11.12.0
shadow-cljs - server version: 2.8.24 running at
shadow-cljs - nREPL server started on port 52514
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (231 files, 18 compiled, 0 warnings, 5.67s)
So I’ve been able to M-x cider-connect
to the reported nREPL port 52514, but nothing beyond that
Thanks a lot for your assistance on this. I’ll push these changes into my de-Expo’d fork of rn-rf-shadow
if it all starts to work nicely, and take a look at your doco
Yeah it does seem to be, so guess that was a red herring (that is my LAN IP currently)
yeah it sometimes picks other ips if you have docker or other virtual container stuff running so that leads to issues. The yarn start
output should be logging the websocket connected
message when you open the app?
I just start things and connect the cljs-repl. No hassles. So, when you have run yarn ios
, you have the app running in a simulator, or your physical device and still can't evaluate stuff from the shadow-cljs cljs-repl app
prompt?
This may be the issue: when I run yarn start
it doesn’t actually run the app, it just runs the bundler
or whatever the command was. there was something to get the console.log
messages of the compiled code
I can get it using xcrun
mojo but it doesn’t appear to show the Websocket Connected!
message I would expect
Nothing useful. I get the application messages from another command fine, but I don't see the websocket initialisation message. That may be because of other factors though so bear with me!
I get the Websocket Connected!
message in the expo start
output. Don't you get that, @attentive?
I've removed expo from the project ... I've got a port of rn-rf-shadow
off expo I'll have another poke at a little later tonight (I'm at GMT+0930 so just having dinner!)
Just to come back to this issue … the REPL networking is now working correctly as far as I can determine (REPL connects from the command line). I think it might have been errors during initialisation that were causing issues before
I can require local dependencies such as (require '[re-frame.core :as rf :refer [dispatch subscribe]])
etc so I feel like I’ve got what I need
Still having a few issues connecting from CIDER. cider-connect
seems to set up a CLJ REPL (which connects correctly) and then I can’t switch to the REPL window?
see https://shadow-cljs.github.io/docs/UsersGuide.html#cider I think you need cider-connect-sibling-cljs
@lepistane check if your index.android.js
contains the goog.global=this;
code? might be goog.global = this;
with spaces or so, check both
@thheller there is but it looks like goog.global=this
and also i created clean slate react native app made apk and same thing happens
something I added in shadow-cljs. didn't result in the error you saw but a bad assigned global has weird effects
as I said before I know absolutely nothing about re-natal. I would expect this to break for everyone. not a clue why it wouldn't.
maybe its a namespace you are importing that actually uses that code. I don't know what exactly uses this.