Skip to content
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

Refactor: 1.4.2 and 2.0.0 #625

Closed
wants to merge 12 commits into from
Closed

Refactor: 1.4.2 and 2.0.0 #625

wants to merge 12 commits into from

Conversation

remy
Copy link
Owner

@remy remy commented Aug 31, 2015

Alpha builds are available via npm install -g nodemon@dev

  • Ready for merge

Follow this issue for the latest dev builds to npm and send your feedback.

Aims

  • reduce the code base
  • use external modules for monitoring and microtasks (like determining the user's home). Specifically thinking about chokidar (and another whose name always escapes me)
  • semantic release
  • fix the blasted looping problem in containers (will likely need help here, but also might just fix itself via chokidar).

Deferred

  • get input from gulp + grunt 3rd party maintainers to ensure interop
  • remove legacy support (for .nodemon-ignore, et al)
  • modularise the exec functionality (akin to how npm handles their script commands)
  • move tests to tape (my prefered dev), and ditch a lot of the monitoring tests (to defer to the 3rd party lib - which will solve a lot of the race conditions in the test)

Create 1.4.2 and 2.0 release - 2.0 will break backward compat (dropping legacy support, etc), but 1.4.x will include the infrastructure changes and stop 1.x dev there.

@remy
Copy link
Owner Author

remy commented Aug 31, 2015

Current dev build: 1.5.0-alpha1 - initial refactor across to chokidar removing custom (and god knows how many) watch methods.

@harriha
Copy link

harriha commented Aug 31, 2015

Context: #624

Thanks @remy! Did some additional testing and it seems that, even though nodemon 1.4.1 said it's watching a gazillion of files and warning about it, it doesn't actually watch them, changes in my node_modules didn't trigger restart. Whoops, or then my setup here is somehow...off.

Anyway, this new version doesn't seem to output the number of files it's watching nor any warnings about them, but feels certainly snappier to start/restart and does what it is supposed to do, did some manual testing for the basic cases. Cannot find any issues with it, so looks good to me, should at least fix that #624 👍.

@remy
Copy link
Owner Author

remy commented Aug 31, 2015

@harriha cheers for the feedback. Yeah, the first thing nodemon loses is the actual count of files it's monitoring, but if chokidar can handle any arbitrary number of files, then it doesn't really matter (I think...).

I'm not 100% sure I've got the watch/ignore combo quite right (and I think I spotted a memory leak in alpha1 - that been fixed so I'll push another version either tonight or in the morning).

Do keep feeding back if you see anything odd.

@catamphetamine
Copy link
Contributor

Ok, so, both the old nodemon and the new nodemon give me strange behaviour when files aren't being changed but it says they are:

1 Sep 04:27:31 - [nodemon] files triggering change check: code\server\libraries\json rpc.js
1 Sep 04:27:31 - [nodemon] matched rule: **\code/**/*.js
1 Sep 04:27:31 - [nodemon] changes after filters (before/after): 1/1
1 Sep 04:27:31 - [nodemon] restarting due to changes...
{ result: [ 'g:\\work\\cinema\\code\\server\\libraries\\json rpc.js' ],
  ignored: 0,
  watched: 1,
  total: 1 }
1 Sep 04:27:31 - [nodemon] code\server\libraries\json rpc.js

1 Sep 04:27:31 - [nodemon] files triggering change check: code\server\api\utility.js
1 Sep 04:27:31 - [nodemon] matched rule: **\code/**/*.js
1 Sep 04:27:31 - [nodemon] changes after filters (before/after): 1/1
1 Sep 04:27:31 - [nodemon] restarting due to changes...
{ result: [ 'g:\\work\\cinema\\code\\server\\api\\utility.js' ],
  ignored: 0,
  watched: 1,
  total: 1 }

I checked the "modified" dates on these files: those are way back in August.
But for some reason the watcher triggers.

@catamphetamine
Copy link
Contributor

This thing I mentioned happens sometimes and isn't reproducible. I'll investigate on this.

@JonathanWolfe
Copy link

Maybe I missed it, but it'd be great to be able to reduce/configure the timer for modification checking. Sometimes I'll change a file and occasionally have to wait a few seconds for it to notice.

@remy
Copy link
Owner Author

remy commented Sep 2, 2015

@JonathanWolfe is this with 1.5.0-alphaX that you're seeing a few seconds latency?

Basically I've completed gutted the old watch mechanism which used find and all sorts of methods to try to work things out. Now it defers the entire process to the chokidar library.

@JonathanWolfe
Copy link

@remy it was nodemon@latest as of 5 days ago.

@remy
Copy link
Owner Author

remy commented Sep 2, 2015

@JonathanWolfe this thread is only for nodemon@dev - the aim is to fix the watch issues. Please do try out the dev build and let me know how you get on.

@thedug
Copy link

thedug commented Sep 5, 2015

Are there any known work arounds to avoid the watch loop?

Oooooh, shiny.
@remy
Copy link
Owner Author

remy commented Sep 9, 2015

@thedug sorry, missed your message coming in. Have you tried using the nodemon@dev version? If so, I'm hoping this is the work around...

@remy
Copy link
Owner Author

remy commented Sep 9, 2015

CC'ing @ChrisWren and @JacksonGariety to get new version of nodemon on the radar. There's going to be 2 releases:

  1. a patch release that includes a refactoring and inclusion of chokidar library (effectively what you can see under [email protected] - though this will be 1.4.2 I believe).
  2. a major release the removes the legacy support (for the .nodemon and .nodemon-ignore files)

I'd like to also get the event middleware included in this release (@JacksonGariety) because I know you wanted to control the flow of events from your gulp plugin.

@remy
Copy link
Owner Author

remy commented Sep 9, 2015

@ChrisWren ha, I now I read your big message in the git repo! Feel free to unsub from the issue, I understand :)

@ChrisWren
Copy link
Contributor

lol, thanks @remy

@jamlfy
Copy link

jamlfy commented Sep 11, 2015

Kool!!! :D

@remy
Copy link
Owner Author

remy commented Sep 12, 2015

Merged and live in [email protected]

@remy remy closed this Sep 12, 2015
@dlong500
Copy link

Nice! It looks like the change detection updates in v1.5 also resolved an issue (at least on Windows) where file changes triggered a restart twice.

@catamphetamine
Copy link
Contributor

@remy Can you add an option in nodemon.json for usePolling: true in chokidar?
paulmillr/chokidar#348

@remy
Copy link
Owner Author

remy commented Sep 16, 2015

@halt-hammerzeit yes -> #633 (just need to find a few hours to get the code up and tests passing, I'm thinking this might just reuse the legacy flag that nodemon had before Chokidar, as it's effectively the same kind of thing).

@catamphetamine
Copy link
Contributor

@remy oh, ok, that's in no way urgent for me

@remy remy deleted the feature/clean-up branch September 21, 2015 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants