Closed wojcikiewiczm closed 6 years ago
@wojcikiewiczm Hi. We are using hot reload
phrase in the meaning webpack hot module replacement. I'm not sure what your question is?
@vlasenko Well I mean that when I save for example some change in component whole website browser window reloads (like window.reload()). I managed to figure it out and it's weird. I dont use containers as you're in example. My cointaners returing divs and components not only one return with component as you're. So when my container is complex then when i save any change in code, window browser reloads like I've made some changes to backend but I didn't.
@wojcikiewiczm The issues here is to report the issue about the kit. If you want to report an issue please provide exact reproduction steps or provide a fork of the kit that reproduces issue that you have.
@wojcikiewiczm What is the output in your web browser javascript console before save and right after save - attach two screenshots please.
@vlasenko I managed to fix this problem. Problem was that i had as Feature file index.js (because I'm using only web). So when I had index.js HMR reloaded browser window. When i renamed index.js to index.web.js hot reload works as should. I think it's a bug or? For only web usage it should be fine to use only index.js without ".web" word.
@wojcikiewiczm Could you prepare fork with reproduction? It is hard to say something without seeing the code.
@wojcikiewiczm It should be fine to use index.js
without .web
extension
I'm closing this for now. As I said we need reproduction to move forward the investigation.
@vlasenko sorry for delay. Here is screenshot of console https://imgur.com/a/IqUbPEX. I will try to make a fork with reproduction as soon as possible. I placed red arrow on image to define section before reload and after reload. It's just behaving as normal hot reload but in then end it just reloads browser window. I'm using windows 10, node v8.9.4, yarn v1.7.0. Packages versions are same as in stable branch of starter kit.
@wojcikiewiczm Are there any messages on server-side before and after reload? Looks like full client-side reload is triggered by the server webpack process, because it thinks you changed server-side code
@vlasenko yeah I'm getting this. But I'm not changing this file. That's weird...
[at-loader] Ok, 0.052 sec.
server-webpack debug Force front-end current page refresh, due to change in backend at: C:\Users\Martin\Desktop\WCM\packages\server\src\index.ts
server-webpack info Time: 589ms
web-webpack debug bundle is now VALID.
web-webpack info Time: 878ms
web-webpack debug bundle is now VALID.
web-webpack info Time: 820ms
@wojcikiewiczm Well, you can just disable this front-end forced refresh on backend change. There is an option to disable it: https://github.com/sysgears/apollo-universal-starter-kit/blob/master/packages/server/.spinrc.js#L28
Other then that, looks like your src\index.ts somehow depends on some frontend file in your code base and spinjs
thinks you have changed backend and tries to help you by triggering frontend
page refresh
Hello, I want to ask. When I'm editing for example component then frontend reloads on save instead of hot reloading. It's not reloading every time it's, I don't know lets say every third save or something like that. So I'm not sure if it's feature or bug. Of course I have made some changes in devstack but I'm not aware of changing something connected to hot reload. So I would like to know if I messed up something or it's really feature. Thanks