Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Add descendent files to watched files #1745

Merged
merged 1 commit into from
Nov 12, 2016

Conversation

marvinhagemeister
Copy link
Contributor

Fixes #1731

@nschonni
Copy link
Contributor

Thanks for the PR! Could you add a test in https://github.com/sass/node-sass/blob/master/test/cli.js

@marvinhagemeister
Copy link
Contributor Author

@nschonni That's great! Thanks for having a look at the PR.

I'd love to write tests for this but I running the tests of cli.js alone takes more than 20s for each run. 😞

Haven't had any luck in getting watch mode to work either because of a failing binary detection. It defaults to some weird values:

/dev/github/node-sass/vendor/bar-foo-baz/binding.node  # <- bar-foo-baz?

// Add children to watcher
graph.visitDescendents(file, function(child) {
gaze.add(child);
files.push(child);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to compile the decedents of the changed file. Please remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! You're right, that isn't necessary at all. Will fix that tomorrow

@xzyfer
Copy link
Contributor

xzyfer commented Oct 12, 2016

You can use the .only method to run a subset of the test suite. i.e. describe.only('...' or it.only('...

@nschonni nschonni added this to the 3.12.0 milestone Nov 8, 2016
@nschonni
Copy link
Contributor

nschonni commented Nov 8, 2016

@marvinhagemeister do you want to finish up the review, or maybe turn on collaborator contributions so it can get merged?

@marvinhagemeister
Copy link
Contributor Author

@nschonni Sorry for not getting back any sooner, life got a bit hectic. Just updated the PR with the suggested change. Thanks for having another look.

Copy link
Contributor

@nschonni nschonni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2016

Thanks @marvinhagemeister!

@xzyfer xzyfer merged commit 3f853a0 into sass:master Nov 12, 2016
@marvinhagemeister marvinhagemeister deleted the fix_watch branch November 13, 2016 05:37
@marvinhagemeister
Copy link
Contributor Author

Awesome! Thanks for merging!

xzyfer added a commit to xzyfer/node-sass that referenced this pull request Jan 28, 2017
Watching for changes on files with lots of `@import`s had a
significant regression in responsiveness in sass#1745.

The regression was caused by calling `gaze.add` unnecessarily. We
only need to call `gaze.add` on files that aren't currently being
watched.

At the time I confirmed that calling `gaze.add` in files that were
being watched wouldn't result in a leak or multiple events being
fired. I however assumed calling `gaze.add` for already watched
files would be very cheap.

Fixes sass#1869
xzyfer added a commit to xzyfer/node-sass that referenced this pull request Jan 28, 2017
Watching for changes on files with lots of `@import`s had a
significant regression in responsiveness in sass#1745.

The regression was caused by calling `gaze.add` unnecessarily. We
only need to call `gaze.add` on files that aren't currently being
watched.

At the time I confirmed that calling `gaze.add` in files that were
being watched wouldn't result in a leak or multiple events being
fired. I however assumed calling `gaze.add` for already watched
files would be very cheap.

Fixes sass#1869
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants