diff --git a/Makefile b/Makefile index 393d4b9ffcd..950e8fc0c56 100644 --- a/Makefile +++ b/Makefile @@ -267,9 +267,11 @@ run-metro: export TARGET := clojure run-metro: ##@run Start Metro to build React Native changes @scripts/run-metro.sh +export RE_FRISK_PORT ?= 4567 + run-re-frisk: export TARGET := clojure run-re-frisk: ##@run Start re-frisk server - yarn shadow-cljs run re-frisk-remote.core/start + yarn shadow-cljs run re-frisk-remote.core/start ${RE_FRISK_PORT} # TODO: Migrate this to a Nix recipe, much the same way as nix/mobile/android/targets/release-android.nix run-android: export TARGET := android @@ -443,7 +445,7 @@ android-ports: export RCT_METRO_PORT ?= 8081 android-ports: ##@other Add proxies to Android Device/Simulator adb reverse tcp:$(RCT_METRO_PORT) tcp:$(RCT_METRO_PORT) && \ adb reverse tcp:3449 tcp:3449 && \ - adb reverse tcp:4567 tcp:4567 && \ + adb reverse tcp:$(RE_FRISK_PORT) tcp:$(RE_FRISK_PORT) && \ adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \ adb forward tcp:5561 tcp:5561 diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 0283dab6961..1730f976f39 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -58,7 +58,7 @@ :preloads [;; The official recommendation is to ;; load the debugger preload first. flow-storm.api - re-frisk-remote.preload + dev.re-frisk-preload status-im.setup.schema-preload ;; In order to use component test helpers in the REPL we need to ;; preload namespaces that are not normally required by diff --git a/src/dev/re_frisk_preload.cljs b/src/dev/re_frisk_preload.cljs new file mode 100644 index 00000000000..f4f98eab82a --- /dev/null +++ b/src/dev/re_frisk_preload.cljs @@ -0,0 +1,5 @@ +(ns dev.re-frisk-preload + (:require [re-frisk-remote.core :as re-frisk-remote] + [status-im.config])) + +(re-frisk-remote/enable {:host (str status-im.config/re-frisk-host ":" status-im.config/re-frisk-port)}) diff --git a/src/status_im/config.cljs b/src/status_im/config.cljs index 735c75aa59c..5b6859e1898 100644 --- a/src/status_im/config.cljs +++ b/src/status_im/config.cljs @@ -124,3 +124,6 @@ (goog-define STATUS_BACKEND_SERVER_ROOT_DATA_DIR "") ;; if you're using android simulator, I suggest set the env variable to "http://10.0.2.2:" (goog-define STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX "https://localhost:") + +(def re-frisk-host (get-config :RE_FRISK_HOST "http://localhost")) +(def re-frisk-port (get-config :RE_FRISK_PORT "4567"))