From 3dadd1eb3dcf9fae8979b625324e956451332d15 Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 10 Dec 2024 14:30:38 -0800 Subject: [PATCH 1/5] chore: support overriding and defaulting re-frisk remote port in makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 393d4b9ffcd..902a8b96460 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 From 1695096484b43361605dcca90fe901528ca3aead Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 10 Dec 2024 14:31:48 -0800 Subject: [PATCH 2/5] chore: add definitions for re-frisk environment variables in status config --- src/status_im/config.cljs | 3 +++ 1 file changed, 3 insertions(+) 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")) From 617809e9c71374c3823b7e7f3d255b2e268e5c2d Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 10 Dec 2024 14:32:40 -0800 Subject: [PATCH 3/5] chore: add re-frisk remote dev preload with host and port overrides This change allows for the client app to connect to the configured host address and port. --- src/dev/re_frisk_preload.cljs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/dev/re_frisk_preload.cljs 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)}) From bea3ef4442363908ac16cebb1ef1688b4ff3852e Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 10 Dec 2024 14:33:25 -0800 Subject: [PATCH 4/5] chore: replace re-frisk dev preload with local preload --- shadow-cljs.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 01e0976e179f3b9bc3e03330ad5baa70b3ce6df6 Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Thu, 12 Dec 2024 09:26:16 -0800 Subject: [PATCH 5/5] chore: use make variable for android port forwarding --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 902a8b96460..950e8fc0c56 100644 --- a/Makefile +++ b/Makefile @@ -445,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