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
Files inside nested node_modules are cached until restart #10664
Comments
This might be relevant to what's going on in #10522 |
There are two main reasons we don't watch (most) files in
I'm not attempting to shoot down this idea, because I agree there are cases where you might be actively editing some files inside In this particular case, I suppose we could watch As a historical note, we do watch |
I usually just import from root, and am perplexed by recent linter rules showing up in my configuration which prohibit that. A statement like For watching - I noticed that even |
That's definitely doable! We could also introduce a This may just be me rationalizing a new configuration option, but it's nice when a parent section has at least two possible sub-sections. Right now |
Not exactly my area of expertise to consider all the weird and exciting patterns developers use in the wild, but I'd assume that for most Meteor apps, watching I would also be happy to just configure the paths to the watched modules.
In that case, what do you think about allowing globs or patterns to be defined for "meteor": {
"nodeModules": {
"watch": [
"client/node_modules/**/*"
]
}
} Would be nicer, than keeping an up-to-date list of folders (that is actually application code). At least I would, from time to time, with 100% certainty, end up wondering why changes are not picked up when I forget to add an entry to → From the two options, I'm in favor of just treating |
@benjamn If we are looking for rationalizations for the "nodeModules" json node, how about adding package aliases! It'd be great in some cases to replace react (and react-dom) with preact (and preact-compat) client side. |
This function determines whether the optimistic caching system should subscribe to file change notifications for a given path. Note that Meteor has other ways of watching for file changes (e.g. the WatchSet abstraction), as well as other mechanisms for invalidating cached results, so time and resources can often be saved by returning false here, if we know that the path will be watched in other ways. Improvements: - Add METEOR_PROFILE instrumentation to the shouldWatch implementation. - Stop exporting shouldWatch, since it is no longer used anywhere else in the codebase. - Return false early to avoid watching files inside the .meteor directory, a significant shortcut. - Allow watching files in application node_modules directories that are not located directly in the root application directory (closes #10664).
This function determines whether the optimistic caching system should subscribe to file change notifications for a given path. Note that Meteor has other ways of watching for file changes (e.g. the WatchSet abstraction), as well as other mechanisms for invalidating cached results, so time and resources can often be saved by returning false here, if we know that the path will be watched in other ways. Improvements: - Add METEOR_PROFILE instrumentation to the shouldWatch implementation. - Stop exporting shouldWatch, since it is no longer used anywhere else in the codebase. - Return false early to avoid watching files inside the .meteor directory, a significant shortcut. - Allow watching files in application node_modules directories that are not located directly in the root application directory (closes #10664).
This should be fixed if you run Please feel free to reopen this issue if you continue to encounter similar problems, and thanks for all of your suggestions above. |
Rich Harris shared a "JS lifehack": put common utilities in
/src/node_modules
or/client/node_modules
etc. and import them easily without the../../../../../utils/module.js
ritual.It works in Meteor, but changing the code in those files located in this extra
node_modules
directory won't trigger a refresh in Meteor. The code that was loaded on startup is cached forever until a full restart happens.Symlinking to
/imports
doesn't help.Meteor version used: 1.8.2-beta.16
The text was updated successfully, but these errors were encountered: