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

[Feature] Add ability to watch modules #3

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

damassi
Copy link
Member

@damassi damassi commented Nov 9, 2017

This PR adds additional watching ability, making it easy to listen for changes in node_modules and automatically reload dependencies on request. This is useful when working across library boundaries where yarn link is often used to symlink NPM deps during development.

mountAndReload('./desktop', {
  watchModules: [
    '@artsy/reaction-force'
  ]
})

Closes #2

@damassi damassi self-assigned this Nov 9, 2017
@damassi damassi force-pushed the feature-watch-multiple-paths branch 2 times, most recently from 62e03fb to b66cadb Compare November 9, 2017 09:24
@damassi damassi force-pushed the feature-watch-multiple-paths branch from b66cadb to b3da32b Compare November 9, 2017 09:39
@orta
Copy link

orta commented Nov 9, 2017

Changes seem nice and simple 👍

// Or if you're using `yarn link` (or npm) to symlink external dependencies
// during dev, pass in an array of modules to watch. Changes made internally
// will be instantly available in the app.
watchModules: [

Choose a reason for hiding this comment

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

Is this config necessary? Could this module watch all node modules/symlinks by default or would that be too much?

Copy link
Member Author

Choose a reason for hiding this comment

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

@craigspaeth - opt-in is necessary as watching the whole folder would be extremely slow :)

@craigspaeth
Copy link

Awesome! Excited to have this help the Reaction <> Force disparity! 👏 Left a small question, but code LGTM—feel free to merge at will.

@artsyit
Copy link
Contributor

artsyit commented Apr 29, 2019

🚀 PR was released in v1.4.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to pass in array of watched paths
4 participants