Comments (12)
Are you by chance on a Mac? Also, which version of electronmon are you using?
Electronmon uses chokidar, which has this fun problem where when fsevents
is not available on a Mac for any reason, it will fall back to polling when watching files, which is super expensive.
from electronmon.
Hmm... I took a look at your repos and the only Electron app I found was overviewer-configurator
(you could of course also be working on closed-source projects, so forgive me if I have made a hasty assumption... I am only trying to be proactive). That project is unfortunately using electromon
and not electronmon
... that seems like an easy typo and I am surprised that npm's typo-squatting let me publish my package -- I didn't know that package existed until just now, the close naming is quite unfortunate. Anyway, I cannot provide support for that package, as I am not affiliated with it in any way (but if you are in fact using electronmon
on another project, I'm happy to help).
However, since it claims to do exactly the same thing as my package in the same way (which is I am guessing why you may have been looking at my documentation but using the different package and everything still worked), I decided to check it out. For me on Windows, that package is always using ~25% CPU on top of my app itself, and it also never fully finishes watching files (do you also have really slow boot times with that package?), even on .
I am happy to report that if you intended to use my package, you should check it out now! To my knowledge (and I use it across Windows, MacOS, and Linux) there is generally no added CPU overhead on top of what the Electron app itself uses, and there is negligible start time overhead (like... maybe a couple hundred milliseconds tops).
from electronmon.
yea I just realized that myself too. I have switched to you package instead (that's what I wanted in the first place but I never noticed my typo until now), but I'm in the process of doing some other visual studio file stuff so I haven't had a chance to test it yet.
from electronmon.
No problem. I'll keep this open for a bit, so do let me know if you run into any issue with it. In the meantime, I have added Electron 7 to my test matrix and am finding that it works properly so far.
from electronmon.
Yea, your package is so much better.
With electronmon
and electron
7:
Pure electron
7:
Thanks for the help, I'll check my other electron projects and make sure I fix the typo there too.
from electronmon.
Some further testing, when it reloads due to file change, electron will close and re-open. However it is still running the same code as before.
Example: I run electronmon .
. I have a main.js
that imports file2.js
(using require()
). I make a change in file2.js
. electronmon
detects the change and reloads the electron app. But the app is still running the old code from file2.js
that was there when I originally opened electronmon
.
Running electronmon 0.5.1 on nodejs 12.13.0
from electronmon.
Hmm... interesting. Do you have a project that is able to reproduce this? I didn't run into this issue on my own projects, or just now when I grabbed a version of overviewer-configurator
. Maybe I didn't test changing the correct file? Having a repro case would be really useful.
from electronmon.
If I add a console.log
that shows 2 of the json files I'm downloading, but have 1 on at a time, you can see that it does restart the script but still runs the old code.
What I did: In the overviewer-configurator
project, go to nodejs
> overviewerVersions.js
. In the file right after the else
on line 82, do a console.log(JSON.parse(body2));
. Then right after the else
on line 111, do console.log(JSON.parse(body3));
but leave it commented out. Run npm run dev
(runs electronmon). Once it opens, go and comment out the first console.log
and uncomment the second.
Note: There is no other console.log
in that whole file so all the console output is what you are adding.
from electronmon.
Hmm.... I must be missing something from your setup. When I ran it, I got this:
From your video though, I see this in your log:
Notice how my image detects the file as a "main file" while yours detects it as a "renderer file"?
I also see that in Visual Studio, the path to your project is this:
However, in your command prompt, the path was this:
Why are these paths different? It looks like you changed a file in one folder and expected a file in a different folder to have changed? Is there something non-obvious about your environment that I am missing?
from electronmon.
I made the simplest guess -- that you have moved your user folder to a separate drive and linked it to the regular user folder location -- and can reproduce the issue. I added #33 to add support for linked directories. It should be a trivial fix.
If you want to check out an early version, you can try it now with this:
npm i electronmon@https://github.com/catdad/electronmon/tarball/c647f202c58949b874d7108a4fe88ec2e0e04751
I have to figure out how to test this on all operating systems before I can publish it though.
from electronmon.
I don't know why it's recognizing it as a render file. Everything in the nodejs
folder is main process. The other folders are render process. Yea, the folder is actually stored on E:
but hardlinked to ~/GitHub
(I have a separate hard drive for all my coding since my boot SSD doesn't have enough space) since command prompt opens to the user directory by default so it's faster/easier to cd there
from electronmon.
I just pushed 0.6.0 which fixes the issue with linked locations. See #33 if you are interested to know more.
from electronmon.
Related Issues (20)
- The only working reloader, thank you very much, you are a holy man! HOT 1
- please, add quiet mode HOT 1
- monitoring crashes if the app has an error while starting app and user clicks "OK" on error prompt HOT 5
- add a JavaScript API so that the module can be used from other script HOT 3
- update to the latest chalk HOT 1
- create splash image for the README
- crashes when npm updated package.json when installing dependencies HOT 2
- Debugging main and renderer documentation HOT 1
- build and publish through github actions
- Watchboy error after change of file HOT 3
- "path" argument must be of type string - `electronmon` fails to load app due to bug in `runtime-required` dependency HOT 1
- expose reload events via API for retaining SPA state HOT 1
- BrowserView doesn't get reloaded HOT 2
- Doesn't seem to re-transpile app/main.ts, associated with renderer process (should be main) HOT 5
- Stop app flashing on Windows taskbar for soft reloads HOT 1
- Expose watchboy API as well HOT 1
- Electronmon not working in Node v18? HOT 5
- Support for custom electron fork
- Cannot find module '@/src/xxx' HOT 1
- Quit electronmon process while I am using electronmon in my start script in package.json
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electronmon.