-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figwheel inferior to Hot Reloading? #58
Comments
why was this closed? did you figure it out? |
I haven't figured it out. |
I am not facing the same thing, but I am wandering what the differences are on a deeper level, so I thought I would get some extra insight from this issue. but like you said, noone commented. |
@danielbraun just adding myself to this conversation as I am interested as well. I am facing a similar problem with mapbox's react-native wrapper. Whenever I save the file using Cursive + figwheel + re-natal my whole apps gets refreshed, not just the part that I just changed :( I am not sure if this is a react-native problem, on my side or on the cljs stack since when I tried developing apps with figwheel in a browser everything worked as expected (no state lost on reload) |
Check the dev menu. I've noticed react native starts out with Live Reload
enabled by default these days and you have to disable it.
https://facebook.github.io/react-native/docs/debugging.html
On Thu, Mar 23, 2017 at 1:42 AM Camilo Roca ***@***.***> wrote:
@danielbraun <https://github.com/danielbraun> just adding myself to this
conversation as I am interested as well.
I am facing a similar problem with mapbox's react-native wrapper. Whenever
I save the file using Cursive + figwheel + re-natal my whole apps gets
refreshed, not just the part that I just changed :(
I am not sure if this is a react-native problem, on my side or on the cljs
stack since when I tried developing apps with figwheel in a browser
everything worked as expected (no state lost on reload)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsVBI3ixFv9xQ6fJF2-wks6D44WlGS5ks5roV1mgaJpZM4I-Dgi>
.
--
Sean
|
@seantempesta I checked it on my phone and it does not look as if the Live Reload is enabled by default. On the dev menu in my phone it says |
Maybe the problem is how figwheel reload callback is implemented in re-natal. There is a reloader component which wrapps the application root component. This component re-renders when |
@drapanjanas I think you are correct. After some experiments, I found out that if I keep a reference (through react's I guess the problem is that unlike |
for your interest: here is the blog post from facebook on React Native: https://facebook.github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html from the blog:
So they actually avoid reloading the real component and instead keep the inner state separated so that on reload it wont get lost. I guess for React Native hot reloading is in fact better than figwheel :/ |
An update after some discussions in the cljsrn channel. Although hot reloading seems to work better for stateful components, it doesnt work well with stateless ones (a.k.a functional components). That would explain why maps work better with hot-reloading whereas things like text and views just never update (based on my own experience). Furthermore the rn dev team doesnt seem too motivated to solve such issues in the near future. So it seems that figwheel is still ahead of the rn hot reload feature. I think that if we could avoid this full component reload on the root then we would be able to keep the state of those components. @drapanjanas would you mind telling us why does figwheel needs to have this reload on the root element? I tried disabling it but then the app just never updated :( References: |
Well, figwheel just recompiles and reloads changed files. It is a generic tool and is not aware of react or whatever other libs are used in the app. So it is not given that app is reloadable, but with react it is usualy the case. Writing Reloadable Code describes some tips. You can see what files were reloaded in console log - it is the changed namespace and all namespaces which imports it. So, when you remove the code of :jsload-callback, the reload just stops working. We could try thinking of something more clever to improve it, but I think it is important that we keep it all locked in special |
I'm facing an annoying issue with WebViews.
When using figwheel, each time I save (and thus hot reload the app) all webviews in my app are "refreshed".
It's not the case when using JavaScript react native projects with Hot Reload enabled. The UI tree is updated, and WebViews are not reloading their pages.
re-natal + figwheel + save = web view is refreshing
vanilla react native + hot reload + save = web view is not refreshing
I played around with a google maps examples.
![simulator screen shot 24 jun 2016 22 20 34](https://cloud.githubusercontent.com/assets/1410895/16348305/58572586-3a5a-11e6-8a4f-aeb2b8d376ed.png)
The text was updated successfully, but these errors were encountered: