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

Add --watch support to dustc #578

Merged
merged 2 commits into from
Mar 24, 2015
Merged

Add --watch support to dustc #578

merged 2 commits into from
Mar 24, 2015

Conversation

sethkinast
Copy link
Contributor

Watches the existing files and reruns compilation if they change.

Closes #553

Watches the existing files and reruns compilation if they change.
@sethkinast
Copy link
Contributor Author

$ bin/dustc tmp/tmpl/*.dust -s --watch
INFO: Watching for changes... ^C to quit
INFO: update tmp/tmpl/hello.dust
^C

@@ -1,6 +1,7 @@
#!/usr/bin/env node

var cli = require('cli').enable('glob', 'version'),
watchr = require('watchr'),
Copy link
Contributor

Choose a reason for hiding this comment

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

chokidar seems more popular but I don't know either of these libs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I notice that it takes 1-2 seconds to recompile currently, and I see that chokidar says:

Other node.js watching libraries:

Are not using ultra-fast non-polling fsevents watcher implementation on OS X

I might try swapping them out. You're right that chokidar is more popular according to npm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried swapping them out, but chokidar requires XCode to be installed if you're on Mac because it compiles fsevents. This seems kinda icky :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, well, it doesn't require it-- it runs without it if it's not available. I left both commits in so that we can easily revert a single commit if it turns out to be problematic.

prashn64 added a commit that referenced this pull request Mar 24, 2015
Add --watch support to dustc
@prashn64 prashn64 merged commit 6f15f85 into linkedin:master Mar 24, 2015
@sethkinast sethkinast deleted the watchr branch March 25, 2015 00:14
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.

Add watcher support to dustc
3 participants