DEV: Move computed to discourseComputed (#8312)

This commit is contained in:
Mark VanLandingham
2019-11-07 15:38:28 -06:00
committed by GitHub
parent d74546f50e
commit 6275c05c0d
395 changed files with 1770 additions and 1649 deletions

View File

@ -3,6 +3,10 @@ var define, requirejs;
(function() {
// In future versions of ember we don't need this
var EMBER_MODULES = {};
var ALIASES = {
"ember-addons/ember-computed-decorators":
"discourse-common/utils/decorators"
};
if (typeof Ember !== "undefined") {
EMBER_MODULES = {
jquery: { default: $ },
@ -76,7 +80,7 @@ var define, requirejs;
"@ember/utils": {
isEmpty: Ember.isEmpty
},
"rsvp": {
rsvp: {
Promise: Ember.RSVP.Promise,
hash: Ember.RSVP.hash,
all: Ember.RSVP.all
@ -213,6 +217,7 @@ var define, requirejs;
}
function requireFrom(name, origin) {
name = checkForAlias(name);
var mod = EMBER_MODULES[name] || registry[name];
if (!mod) {
throw new Error(
@ -226,6 +231,10 @@ var define, requirejs;
throw new Error("Could not find module " + name);
}
function checkForAlias(name) {
return ALIASES[name] ? ALIASES[name] : name;
}
requirejs = require = function(name) {
if (EMBER_MODULES[name]) {
return EMBER_MODULES[name];