mirror of https://github.com/status-im/metro.git
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
d6dc12e551
commit
c68fa4b4d8
|
@ -16,6 +16,7 @@ var debug = require('debug');
|
||||||
var omit = require('underscore').omit;
|
var omit = require('underscore').omit;
|
||||||
var Activity = require('./src/Activity');
|
var Activity = require('./src/Activity');
|
||||||
|
|
||||||
|
exports.createServer = createServer;
|
||||||
exports.middleware = function(options) {
|
exports.middleware = function(options) {
|
||||||
var server = createServer(options);
|
var server = createServer(options);
|
||||||
return server.processRequest.bind(server);
|
return server.processRequest.bind(server);
|
||||||
|
|
|
@ -72,6 +72,7 @@ class FileWatcher extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
end() {
|
end() {
|
||||||
|
inited = false;
|
||||||
return this._loading.then(
|
return this._loading.then(
|
||||||
(watchers) => watchers.map(
|
(watchers) => watchers.map(
|
||||||
watcher => Promise.denodeify(watcher.close).call(watcher)
|
watcher => Promise.denodeify(watcher.close).call(watcher)
|
||||||
|
|
Loading…
Reference in New Issue