mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Patches to make livedata load from non-server nodejs
This commit is contained in:
committed by
David Glasser
parent
302d625cba
commit
9931898d22
@@ -1,13 +1,24 @@
|
||||
if (process.env.DDP_DEFAULT_CONNECTION_URL) {
|
||||
__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL =
|
||||
process.env.DDP_DEFAULT_CONNECTION_URL;
|
||||
}
|
||||
|
||||
|
||||
_.extend(Meteor, {
|
||||
default_server: new Meteor._LivedataServer,
|
||||
|
||||
default_server: null,
|
||||
refresh: function (notification) {
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof __meteor_bootstrap__ == 'undefined' ||
|
||||
!__meteor_bootstrap__.app) {
|
||||
// We haven't been loaded in an environment with a HTTP server (for
|
||||
// example, we might be being loaded from a command-line tool.)
|
||||
// Don't create a server.. don't even map publish, methods, call,
|
||||
// etc onto Meteor.
|
||||
} else {
|
||||
if (process.env.DDP_DEFAULT_CONNECTION_URL) {
|
||||
__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL =
|
||||
process.env.DDP_DEFAULT_CONNECTION_URL;
|
||||
}
|
||||
|
||||
Meteor.default_server = new Meteor._LivedataServer;
|
||||
|
||||
Meteor.refresh = function (notification) {
|
||||
var fence = Meteor._CurrentWriteFence.get();
|
||||
if (fence) {
|
||||
// Block the write fence until all of the invalidations have
|
||||
@@ -18,13 +29,13 @@ _.extend(Meteor, {
|
||||
if (proxy_write)
|
||||
proxy_write.committed();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Proxy the public methods of Meteor.default_server so they can
|
||||
// be called directly on Meteor.
|
||||
_.each(['publish', 'methods', 'call', 'apply'],
|
||||
function (name) {
|
||||
Meteor[name] = _.bind(Meteor.default_server[name],
|
||||
Meteor.default_server);
|
||||
});
|
||||
// Proxy the public methods of Meteor.default_server so they can
|
||||
// be called directly on Meteor.
|
||||
_.each(['publish', 'methods', 'call', 'apply'],
|
||||
function (name) {
|
||||
Meteor[name] = _.bind(Meteor.default_server[name],
|
||||
Meteor.default_server);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -62,6 +62,13 @@ _.extend(Meteor.__RoutePolicyConstructor.prototype, {
|
||||
var self = this;
|
||||
if (type === 'static-online')
|
||||
return null;
|
||||
if (typeof __meteor_bootstrap__ === "undefined" ||
|
||||
!__meteor_bootstrap__.bundle || !__meteor_bootstrap__.bundle.manifest)
|
||||
// Hack: If we don't have a manifest, deal with it
|
||||
// gracefully. This lets us load livedata into a nodejs
|
||||
// environment that doesn't have a HTTP server (eg, a
|
||||
// command-line tool).
|
||||
return null;
|
||||
var manifest = _testManifest || __meteor_bootstrap__.bundle.manifest;
|
||||
var conflict = _.find(manifest, function (resource) {
|
||||
return (resource.type === 'static' &&
|
||||
|
||||
1
packages/stream/.gitignore
vendored
1
packages/stream/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
.build*
|
||||
@@ -1033,9 +1033,8 @@ Fiber(function () {
|
||||
// Load any needed unipackages
|
||||
require('./unipackage.js').load({
|
||||
library: context.library,
|
||||
packages: ['random'], // add any unipackages here
|
||||
packages: [], // add any unipackages here
|
||||
release: context.releaseVersion
|
||||
,
|
||||
});
|
||||
|
||||
if (argv['get-ready']) {
|
||||
|
||||
Reference in New Issue
Block a user