RN: Support Multiple Packager Servers
Summary: Adds support for multiple packager servers, which could be used to hot-reload dependencies in response to a change in the `cacheVersion`. Currently, there is no way to: - Create multiple `ReactPackager` servers. - Instantiate more than one `FileWatcher` constructor (due to the "single instance" invariant). public Reviewed By: martinbigio Differential Revision: D2713455 fb-gh-sync-id: 9be0f0cb2b846baf088d0cf14650cc8b9e950815
This commit is contained in:
parent
d691091530
commit
1c57291faa
|
@ -16,6 +16,7 @@ var debug = require('debug');
|
|||
var omit = require('underscore').omit;
|
||||
var Activity = require('./src/Activity');
|
||||
|
||||
exports.createServer = createServer;
|
||||
exports.middleware = function(options) {
|
||||
var server = createServer(options);
|
||||
return server.processRequest.bind(server);
|
||||
|
|
|
@ -72,6 +72,7 @@ class FileWatcher extends EventEmitter {
|
|||
}
|
||||
|
||||
end() {
|
||||
inited = false;
|
||||
return this._loading.then(
|
||||
(watchers) => watchers.map(
|
||||
watcher => Promise.denodeify(watcher.close).call(watcher)
|
||||
|
|
Loading…
Reference in New Issue