This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-03
Channels
- # aws (27)
- # beginners (64)
- # boot (14)
- # calva (10)
- # cider (36)
- # cljs-dev (13)
- # cljsrn (79)
- # clojure (58)
- # clojure-berlin (8)
- # clojure-france (1)
- # clojure-italy (18)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (29)
- # clojurescript (55)
- # core-async (20)
- # cursive (5)
- # datomic (105)
- # emacs (17)
- # figwheel-main (13)
- # fulcro (20)
- # graphql (4)
- # hoplon (1)
- # hyperfiddle (2)
- # jobs (7)
- # jobs-discuss (110)
- # off-topic (23)
- # pathom (1)
- # perun (2)
- # re-frame (87)
- # reitit (2)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (118)
- # vim (11)
Anyone here have experience using figwheel-main and react-native-figwheel-bridge
with …Android?
@bobby.harris Is this any help with the issue you were having with react-native-figwheel-bridge https://github.com/bhauman/react-native-figwheel-bridge/issues/2
@codonovan That definitely addressed the issue I was seeing, which for posterity was an incredibly context-free [goog.net.WebSocket] An error occurred: undefined
red-screen
The chrome debugger was a little more helpful in this instance.
[goog.net.WebSocket] An error occurred: undefined
[goog.net.WebSocket] The WebSocket on closed.
[goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined
heads up I just made a significant revision to https://github.com/bhauman/react-native-figwheel-bridge
@chris_johnson please help by adding this information to the README
and I meant to address that to @codonovan 🙂
Not yet. I am working on a full soup-to-nuts example of using Figwheel.main, the RN bridge, and the Clojure CLI to build a React Native app so I will be exercising Android quite a bit.
I'm playing with the new version now and getting some errors, which I'm working through
I hope to publish it soon, and go back and refactor it into the sample repo from my conj talk
Okay, I will update now and see what, if anything, breaks. 😇
The key difference is that figwheel main is outputing a cljsc_opts.json file that you can point the figwheel-bridge to
since this file has all the config info in it, the configuration is much harder to mess up
@chris_johnson first thing that will break is Android needs another reverse proxy.
adb reverse tcp:9500 tcp:9500;adb reverse tcp:8081 tcp:8081
First one for figwheel and the second one for metrothanks for the heads up
I’m wondering if it makes sense to write a custom myproject.main
that wraps figwheel.main
and does all the RN bookkeeping (possibly also e.g. running a prophylactic watchman watch-del-all
on every restart :D)
I can't explain why, sorry. Just always been the case https://facebook.github.io/react-native/docs/running-on-device#method-1-using-adb-reverse-recommended
I might end up doing that anyhow to create a launch environment that supports CIDER/nREPL in a “press button, receive REPL” fashion
@chris_johnson a makefile or script would serve that purpose better 🙂
That’s certainly true
My current (boot/Expo) version of a RN project definitely has a hefty Makefile but we’re doing all kinds of uh, interesting stuff like supporting multiple build flavors of the app
I would keep tooling light as both I and David Nolan are looking very closely at React Native integration
that’s exciting news
yeah, I will surely end up with a Makefile for handling some of the build process eventually, I guess I was really thinking this process through in one direction (desire for CIDER integration to leverage my muscle memory -> custom main
that sets up CIDER + Figwheel.main -> if I have a custom main
why not put this other mechanical work in there) but I am thoroughly convinced by just explaining that out loud that it’s borrowing trouble to do things that way
I’m also not 100% convinced that I will need CIDER once I actually have a project example that uses Figwheel properly in a react native project, which I have not yet had, so we’ll see how that goes
@chris_johnson I did some work on a React Native project and the started an nREPL server manually and used cider-connect-cljs
instead of cider-jackin
hm, so starting the nREPL server inside the running Figwheel REPL instead of the other way around?
I definitely prefer to run the nREPL server outside and cider-connect
for JVM projects
so I would be doing that here as well, but all the documentation I’ve encountered so far is about running an nREPL server and then kicking off Figwheel inside that, if it works to do it the other direction I’m all for it
IMHO cider-jack-in
is a really cool thing that is actually not great to actually use
what I like a bout cider jack in is that I can move between projects and just get a repl really quickly
like, do it once, say “I’m in” in your Extremely Hacker Voice, then take off your indoor sunglasses and run your REPL process outside your editor like a boring salaryman
I prefer cider-jack-in unless a project punishes me for it, which cljs can do sometimes when it hangs
I'm getting
[Figwheel:WARNING] Attempting to dynamically add "target" to classpath!
[Figwheel:WARNING] Target directory "target" is not on the classpath
[Figwheel:WARNING] Please fix this by adding "target" to your classpath
I.E.
For Clojure CLI Tools in your deps.edn file:
ensure "target" is in your :paths key
For Leiningen in your project.clj:
add it to the :resource-paths key
[Figwheel] Compiling build android to "target/public/cljs-out/android-main.js"
[Figwheel] Failed to compile build android in 0.376 seconds.
[Figwheel:WARNING] Compile Exception src/awesome/main.cljs line:2 column:14
No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file src/awesome/main.cljs
1 (ns awesome.main
2 (:require [react]
^---
3 [react-native :as rn]))
4
5 (def <> react/createElement)
6
7 (defn renderfn [props]
[Figwheel:SEVERE] clojure.lang.ExceptionInfo: No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file src/awesome/main.cljs
at the momentI've added src and target to :paths but still getting No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file src/awesome/main.cljs
I was seeing that when I updated my Clojurescript dep to a newer version than 1.10.339
possibly unrelated of course, but it appeared that making that change broke my build in exactly that way, and reverting the dependency fixed it
the removal of :target :nodejs
is a big change but its the smartest thing to do in this circumstance
I hope your exam is uneventful and they have cool frames for you if you are getting ’em.