Git Product home page Git Product logo

Comments (12)

catdad avatar catdad commented on May 20, 2024

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.

catdad avatar catdad commented on May 20, 2024

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.

demosjarco avatar demosjarco commented on May 20, 2024

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.

catdad avatar catdad commented on May 20, 2024

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.

demosjarco avatar demosjarco commented on May 20, 2024

Yea, your package is so much better.
With electronmon and electron 7:
image
Pure electron 7:
image
Thanks for the help, I'll check my other electron projects and make sure I fix the typo there too.

from electronmon.

demosjarco avatar demosjarco commented on May 20, 2024

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.

catdad avatar catdad commented on May 20, 2024

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.

demosjarco avatar demosjarco commented on May 20, 2024

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.

screen rec

from electronmon.

catdad avatar catdad commented on May 20, 2024

Hmm.... I must be missing something from your setup. When I ran it, I got this:

image

From your video though, I see this in your log:

image

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:

image

However, in your command prompt, the path was this:

image

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.

catdad avatar catdad commented on May 20, 2024

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.

demosjarco avatar demosjarco commented on May 20, 2024

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.

catdad avatar catdad commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.