This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (1)
- # asami (2)
- # aws (15)
- # babashka (4)
- # beginners (42)
- # calva (8)
- # clj-kondo (7)
- # cljsrn (31)
- # clojure (64)
- # clojure-australia (4)
- # clojure-europe (40)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-uk (10)
- # clojured (1)
- # clojurescript (16)
- # conjure (4)
- # datomic (5)
- # defnpodcast (2)
- # events (1)
- # fulcro (61)
- # graphql (11)
- # honeysql (9)
- # jobs (3)
- # jobs-discuss (3)
- # lsp (65)
- # malli (3)
- # meander (4)
- # off-topic (5)
- # pathom (32)
- # podcasts-discuss (2)
- # polylith (2)
- # re-frame (30)
- # reitit (6)
- # remote-jobs (3)
- # ring (4)
- # shadow-cljs (19)
- # sql (28)
- # vim (1)
- # xtdb (21)
The app freezes a few seconds after hot reload (shadow-cljs) on android, but not on ios. Anyone have even the faintest idea what could be going on, or what I can try do to isolate the problem?
The way it freezes is that I can still scroll the screens, but nothing else works. Touchables do not give any feedback, for instance.
does it freeze if your
:dev/after-load does nothing? or does it only freeze when that does stuff (eg. re-render)?
And even when I do stuff in that function. I can redefine things in the app and evaluate
(render) to see the new definitions take effect. And then it does not freeze up.
Don’t know if this is a clue, but at the same time this freeze happens I lose the REPL and also see this in the debugger:
[React DevTools] Connection to RN closed
How could it look like, running code directly when loading the namespaces? Top level evaluations?
Well, I get the freeze even if shadow only compiles stuff that does only have
defn things, and rich comments, top level.
btw, @U052852ES it is the same kind of android-only freeze that I had in the project’s release builds before upgrading React Native and React Navigation. Now the release builds behave, but my android dev workflow is so broken…
I have myself to blame a bit since I have avoided the Android emulator and mostly used iOS so didn’t notice when this weirdness started to happen.
I would try commenting out everything and loading just one view with one button that shows an alert, for example. Keep tapping that. Does it freeze then? If it does not freeze, then comment back in component by component to see when the problem appears.
Another random idea: does your Android app use Hermes by any chance? I haven’t used it, but David Nolen recently said that it caused weird problem for them.
I had never heard of Hermes before reading that comment from Nolen. It’s disabled in build.gradle at least.
Will probably do the commenting out everything thing. I’m totally out of any other idea.
Jokes aside. I’ve narrowed it down to the require of our re-frame handlers namespace. But we make A LOT of requires there, and there are A LOT of handlers. I don’t think I will have all handlers in the same ns with the next app I build.
I’m starting to suspect a circular dependency. That is just a hunch based on nothing, but anyway. I now have like a long thin drinking straw of namespaces requiring just one namespace 15 levels deep, I wonder how deep I will need to go before I hit bed rock. 😃
shadow-cljs won't compile circular dependencies. you'll get an error if you have one.
Based on nothing. 😎 I have a feeling I will figure this out. Which is a great improvement from lately.
Right. I should mention those things of course. I get this behaviour in the Emulator with some modern versions of Android as well as on my physical testing device which is a Samsung S5, with Android 6.0.1. A colleague has a very new phone which experienced the same “type” of freeze in a release build. I had the same on my test device. That freeze stopped to happen when I commented out a couple of SmoothenNextTransition uses, and also stops happening on a branch where I have those uses active, but have upgraded to latest RN and React Navigation 4. I mention this because I suspect that this dev-reload thing is the same problem, only triggered from a different path. Also, sometimes instead of this freeze, the app is just killed by the OS.