-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(watcher): add a watcher for ibazel #2895
Conversation
ibazel (github.com/bazelbuild/bazel-watcher) is a watch mode for Google's build tool, bazel (http://bazel.build) Under this watch mode, tools like Karma should not directly watch .js files, because the build tool will not write them all at once. Instead, the build tool signals when it's time to reload the .js sources.
}); | ||
rl.on('close', () => { | ||
// Give ibazel 5s to kill our process, otherwise do it ourselves | ||
setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unnecessary. If the stream is closed it will be because you're being killed and it is a reasonable response to just quit immediately.
Not a big fan of adding very tool specific support into core. I would rather see a plugable way to support different watching strategies through plugins. Also this adds the burden of maintenance of a tool I have no experience with or use for at the moment. |
@dignifiedquire I understand that motivation. At the same time, AFAICT there isn't a way for a plugin to extend the watchers right now. Have there been any other requests to add a different file watcher? I could imagine doing the work to add this ability to the plugin system, only to see this be the last plugin that ever uses that ability. |
I think I would be fine keeping the code in here, but lets restructure things a little more cleanly so it is clear that there are multiple ways to watch files. For this to be ready to merge I would like to see
|
770a3d2
to
fa1a84a
Compare
Over the years, there has been several suggestions to make the default watcher in Karma (that uses chokidar) dependency injectable so that Karma could work well with third-party watchers. Prior issues: 1. karma-runner#1468 2. karma-runner#2895 Candidate third-party watchers include: 1. Watcher for Broccoli 2. Watcher for Bazel 3. Watcher for Blaze (used internally at Google) This commit makes the change to allow other Karma plugins to specify the 'watcher' value in the di system and Karma would use the supplied watcher instead.
…ers (#3254) Over the years, there has been several suggestions to make the default watcher in Karma (that uses chokidar) dependency injectable so that Karma could work well with third-party watchers. Prior issues: 1. #1468 2. #2895 Candidate third-party watchers include: 1. Watcher for Broccoli 2. Watcher for Bazel 3. Watcher for Blaze (used internally at Google) This commit makes the change to allow other Karma plugins to specify the 'watcher' value in the di system and Karma would use the supplied watcher instead.
Watchers are now configurable. |
ibazel (github.com/bazelbuild/bazel-watcher)
is a watch mode for Google's build tool, bazel
(http://bazel.build)
Under this watch mode, tools like Karma should not
directly watch .js files, because the build tool will
not write them all at once. Instead, the build tool
signals when it's time to reload the .js sources.
/cc @gregmagolan @achew22