jschr / electron-react-redux-boilerplate

A minimal boilerplate to get started with Electron, React and Redux.
556 stars 130 forks source link

Watch script and main process #69

Closed momentiris closed 6 years ago

momentiris commented 6 years ago

Hi again. I was wondering about the dev script and the main process. "dev": "npm run private:compile -- --source-maps true && run-p -r private:watch private:serve", this rerenders or refreshes some process in the build script, and I see the application reloading, but in order for the changes made in the main process to take effect, I have to re-run the dev script. So for example, I can uncomment everything in ./main/index.js while running the dev script. The script will answer by reloading the application, but the build has not updated. Is this your intention or might there be something wrong here?

Thanks again.

pronebird commented 6 years ago

Hi,

That's a defect and the only way to reflect changes in the main process is to restart Electron. @jschr perhaps we should modify the serve script to restart "Electron" on changes in main?

jschr commented 6 years ago

Yeah that would improve the DX.

momentiris commented 6 years ago

Alright, thanks!

pronebird commented 6 years ago

@momentiris I've had an attempt to fix this issue. See the work-in-progress PR: https://github.com/jschr/electron-react-redux-boilerplate/pull/70

It's somewhat intrusive to restart the main process, but I guess we do that manually anyway, so perhaps overall not that bad.

momentiris commented 6 years ago

Thats awesome! I am finishing up my school finals this week so was looking for a quick solution, so I ended up writing my own, using nodemon, wait-on and concurrently. Probably has it's own problems due to my limited experience as a beginner. But its here: https://github.com/momentiris/magicbrowser, if you guys want to have a look at how I did it. Ironically I have barely written any code for the main process yet.

Thanks alot again for adressing this!