diff --git a/packages/mongo-livedata/package.js b/packages/mongo-livedata/package.js index 070c19ad19..7d53239653 100644 --- a/packages/mongo-livedata/package.js +++ b/packages/mongo-livedata/package.js @@ -26,6 +26,10 @@ Package.on_use(function (api) { // Allow us to detect 'autopublish', and publish collections if it's loaded. api.use('autopublish', 'server', {weak: true}); + // RemoteCollectionDriver gets its deployConfig from something that is (for + // questionable reasons) initialized by the webapp package. + api.use('webapp', 'server', {weak: true}); + api.export('MongoLivedataTest', 'server', {testOnly: true}); api.add_files('mongo_driver.js', 'server'); diff --git a/packages/mongo-livedata/remote_collection_driver.js b/packages/mongo-livedata/remote_collection_driver.js index a6ede8bdbe..5996344faf 100644 --- a/packages/mongo-livedata/remote_collection_driver.js +++ b/packages/mongo-livedata/remote_collection_driver.js @@ -23,9 +23,10 @@ _.extend(RemoteCollectionDriver.prototype, { // you're only trying to receive data from a remote DDP server.) getRemoteCollectionDriver = _.once(function () { // XXX kind of hacky - var mongoUrl = (typeof __meteor_bootstrap__ !== 'undefined' && - Meteor._get(__meteor_bootstrap__.deployConfig, - 'packages', 'mongo-livedata', 'url')); + var mongoUrl = ( + typeof __meteor_bootstrap__ !== 'undefined' && + Meteor._get(__meteor_bootstrap__, + 'deployConfig', 'packages', 'mongo-livedata', 'url')); // XXX bad error since it could also be set directly in METEOR_DEPLOY_CONFIG if (! mongoUrl) throw new Error("MONGO_URL must be set in environment"); diff --git a/packages/webapp/webapp_server.js b/packages/webapp/webapp_server.js index 3086d2e452..08f2aa5c1a 100644 --- a/packages/webapp/webapp_server.js +++ b/packages/webapp/webapp_server.js @@ -183,7 +183,9 @@ var runWebAppServer = function () { throw new Error("Unsupported format for client assets: " + JSON.stringify(clientJson.format)); - // XXX change all this config to something more reasonable + // XXX change all this config to something more reasonable. + // and move it out of webapp into a different package so you don't + // have weird things like mongo-livedata weak-dep'ing on webapp var deployConfig = process.env.METEOR_DEPLOY_CONFIG ? JSON.parse(process.env.METEOR_DEPLOY_CONFIG) : {};