This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-03
Channels
- # aleph (5)
- # announcements (4)
- # babashka (2)
- # beginners (52)
- # calva (13)
- # cider (60)
- # clj-kondo (91)
- # cljsrn (6)
- # clojure (93)
- # clojure-brasil (2)
- # clojure-dev (37)
- # clojure-europe (5)
- # clojure-italy (7)
- # clojure-nl (8)
- # clojure-norway (1)
- # clojure-sg (1)
- # clojure-spec (115)
- # clojure-uk (31)
- # clojurescript (32)
- # cursive (35)
- # data-science (4)
- # datascript (3)
- # datomic (29)
- # emacs (8)
- # events (1)
- # figwheel (1)
- # funcool (2)
- # graalvm (2)
- # joker (12)
- # kaocha (4)
- # lein-figwheel (1)
- # leiningen (34)
- # malli (7)
- # off-topic (4)
- # overtone (1)
- # parinfer (2)
- # pathom (5)
- # quil (1)
- # re-frame (12)
- # reagent (2)
- # shadow-cljs (7)
- # spacemacs (6)
- # sql (8)
- # tools-deps (63)
- # vim (24)
Hello everybody! Today I created RN 0.61.2 project and setup shadow-cljs to run clojurescript. I disabled fast refresh / live reload on RN side and wanted to go with clojure HMR system. When I run shadow-cljs watch app
, clojurescript code compiles well, but I still have to reload my ios simulator by hand. Do you know how to enable that? Can I use figwheel with shadow-cljs? Is that even necessary? My shadow-cljs.edn
file looks like this:
;; shadow-cljs configuration
{:source-paths
["cljs"]
:dependencies
[[reagent "0.8.1"]]
:builds
{:app
{:target :react-native
:init-fn hello.core/init
:output-dir "app"
:devtools {:autoload true}}}}
EDIT:
I managed to run after-load function and alert works just fine, it re-runs each time I change my code, but rendered react component on the ios simulator stays the same. Do you have any ideas on how can i re-register app component or do something to reload RN component? Here is my code:
(defn alert [title]
(.alert (.-Alert react-native) title))
defn start
{:dev/after-load true}
[]
(alert "Hello World!")
(.registerComponent app-registry "TestApp" #(r/reactify-component app-root)))
(defn init []
(start))
@UFD5H42HG You should use a render function like this to get hot-reload handle by Shadow-cljs https://github.com/thheller/reagent-react-native/blob/master/src/main/test/app.cljs#L36-L59
yeah the registerComponent
thing can only be called once so you need a helper like that to make it work
@thheller So I implemented jest based off the PR you linked the other day. For a basic test with no imports it works as expected.
However, when I include some of the namespaces I want to test it only works when I compile with shadow-cljs release test
. When compiling with shadow-cljs watch test
the yarn jest
errors out with a heap limit error.