Skip to content

Commit

Permalink
Merge pull request #1823 from montagejs/mop-issues
Browse files Browse the repository at this point in the history
Fix mop build include extras packages files #1822
  • Loading branch information
hthetiot authored Jun 7, 2017
2 parents 417cec4 + ed4c077 commit 01ab0c8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 17.0.10
- Fix Mop support again

### v17.0.5
- Fix undefined 'deprecate' in AbstractTextField and AbstractTextArea

Expand Down
2 changes: 0 additions & 2 deletions core/event/event-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,4 @@ if (typeof window !== "undefined") { // client-side

});

defaultEventManager = new EventManager().initWithWindow(window);

} // client-side
19 changes: 13 additions & 6 deletions montage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
}
}(this, function (require, exports, module) {


"use strict";

// reassigning causes eval to not use lexical scope.
Expand All @@ -24,6 +23,8 @@
/*jshint evil:false */

// Here we expose global for legacy mop support.
// TODO move to mr cause it's loader role to expose
// TODO make sure mop closure has it also cause it's mop role to expose
global.global = global;

/**
Expand Down Expand Up @@ -484,7 +485,7 @@
browser.load(resolve(montageLocation, pending.promise), function() {
delete pending.promise;

//global.bootstrap cleans itself from window once all known are loaded. "bluebird" is not known, so needs to do it first
//global.bootstrap cleans itself from global once all known are loaded. "bluebird" is not known, so needs to do it first
global.bootstrap("bluebird", function (require, exports) {
return global.Promise;
});
Expand All @@ -495,14 +496,15 @@
for (var id in pending) {
browser.load(resolve(montageLocation, pending[id]));
}

});

} else {

global.nativePromise = global.Promise;
Object.defineProperty(global, "Promise", {
configurable: true,
set: function(PromiseValue) {

Object.defineProperty(global, "Promise", {
value: PromiseValue
});
Expand Down Expand Up @@ -579,10 +581,15 @@
montageRequire(iDependency);
}

var defaultEventManager = montageRequire("core/event/event-manager").defaultEventManager;
var Montage = montageRequire("core/core").Montage;
var EventManager = montageRequire("core/event/event-manager").EventManager;
var MontageReviver = montageRequire("core/serialization/deserializer/montage-reviver").MontageReviver;
var logger = montageRequire("core/logger").logger;

var defaultEventManager, application;

var application;
// Load the event-manager
defaultEventManager = new EventManager().initWithWindow(window);

// montageWillLoad is mostly for testing purposes
if (typeof global.montageWillLoad === "function") {
Expand Down Expand Up @@ -635,4 +642,4 @@
}

return exports;
}));
}));
16 changes: 5 additions & 11 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,7 @@ MontageBoot.loadPackage = function (location, config) {
config.overlays = ["node", "server", "montage"];
config.location = URL.resolve(Require.getLocation(), location);

// setup serialization compiler
config.makeCompiler = function (config) {
return Require.makeCompiler(config)
};

return Require.loadPackage(config.location, config).then(function (moduleRequire) {
// Inject current montage to avoid montage require
return moduleRequire.async('montage').then(function (montage) {
return moduleRequire;
});
});
return Require.loadPackage(config.location, config);
};

MontageBoot.TemplateLoader = function (config, load) {
Expand Down Expand Up @@ -102,6 +92,10 @@ MontageBoot.TemplateLoader = function (config, load) {
if (stat.isFile()) {
module.extraDependencies = [id + ".html"];
}
}, function (error) {
// not a problem
// montage/ui/loader.reel/loader.html": Error: ENOENT: no such file or directory
console.log(error.message);
});
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "montage",
"version": "17.0.9",
"version": "17.0.10",
"description": "Build your next application with a browser based platform that really gets the web.",
"license": "BSD-3-Clause",
"repository": {
Expand Down
9 changes: 8 additions & 1 deletion test/run-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ jasmineEnv.addReporter({
}
});

// Execute
// Load package
Montage.loadPackage(PATH.join(__dirname, "."), {
mainPackageLocation: PATH.join(__dirname, "../")
})
// Preload montage to avoid montage-testing/montage to be loaded
.then(function (mr) {
return mr.async('montage').then(function (montage) {
return mr;
});
})
// Execute
.then(function (mr) {
return mr.async("all");
}).then(function () {
Expand Down

0 comments on commit 01ab0c8

Please sign in to comment.