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
Avoid restarting server in development when changed file(s) not used by server bundle. #10686
Conversation
e3631c7
to
98d3ace
Compare
Most importantly, this change means that changes to files not used by the server bundle will not trigger a server restart. Fixes #10449 by implementing the strategy I described in this comment: #10414 (comment)
98d3ace
to
4084848
Compare
The previous implementation simply avoided calling watchSet.addFile for potentially unused files, trusting that addFile would be called later if the file was eventually used. However, this strategy left the contents of watchSet.files incomplete for tasks such as IsopackCache._checkUpToDate, which require full information about all files, even the ones that might not be used by the bundle. The new strategy maintains metadata about potentially unused files in a separate data structure, which will be merged/cloned/serialized/deserialized along with other WatchSet data.
@benjamn this is an awesome improvement. Got the full page reload time from 8s to 5s. Is there a way to be able to include something like this in a module that is loaded on server and client and still get the benefits? // /startup/both/index.js
import { Meteor } from 'meteor/meteor';
if (Meteor.isProduction) {
require('./routes');
}
import './slingshot';
import './registerApi'; Just having there the require or the import makes the server to restart even if not actually imported. |
@pmogollons Great to hear it's working so well! I would love your help testing a slightly simpler implementation of this functionality, coming soon (probably in 1.8.2-rc.7), once #10763 is merged. To answer your question, in Meteor 1.8.3, we want to tackle tree shaking / dead code elimination, which involves pruning the dependency tree while scanning imports in the |
Most importantly, this change means that changes to files not used by the server bundle will not trigger a server restart.
Fixes #10449 by implementing the strategy I described in this comment: #10414 (comment)