Skip to content

Commit

Permalink
Remove useless bluebird injection code
Browse files Browse the repository at this point in the history
I suspect this code only exists for historical reasons, but it seems
totally unnecessary, as bluebird will already be cached in the registry
and will not be loaded twice. The hardcoded bluebird path causes an
extra 404 when loading the app with npm 3+.
  • Loading branch information
cdebost committed Jan 31, 2019
1 parent c606787 commit 455a6db
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions montage.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,34 +799,8 @@
hash: params.montageHash
})
.then(function (montageRequire) {
// load the promise package so we can inject the bootstrapped
// promise library back into it
var promiseLocation;
if (params.promiseLocation) {
promiseLocation = URL.resolve(Require.getLocation(), params.promiseLocation);
} else {
//promiseLocation = URL.resolve(montageLocation, "packages/mr/packages/q");
//node tools/build --features="core timers call_get" --browser
promiseLocation = URL.resolve(montageLocation, "node_modules/bluebird");
}

var result = [
montageRequire,
montageRequire.loadPackage({
location: promiseLocation,
hash: params.promiseHash
})
];

return result;
})
.spread(function (montageRequire, promiseRequire) {
montageRequire.inject("core/mini-url", URL);
montageRequire.inject("core/promise", {Promise: Promise});
promiseRequire.inject("bluebird", Promise);

// This prevents bluebird to be loaded twice by mousse's code
promiseRequire.inject("js/browser/bluebird", Promise);

// install the linter, which loads on the first error
config.lint = function (module) {
Expand Down

0 comments on commit 455a6db

Please sign in to comment.