FEATURE: Deprecate lodash so we can remove it.

It's currently 240k of Javascript we don't need anymore. It's been
replaced by ES6 and a couple helper functions.
This commit is contained in:
Robin Ward 2020-09-02 12:16:06 -04:00
parent 3a46e44ed8
commit 8c0f18794e

View File

@ -125,5 +125,23 @@ export default {
window.onerror(e && e.message, null, null, null, e);
});
// Deprecate lodash usage
let lo = window._;
if (lo) {
Object.keys(lo).forEach(m => {
let old = lo[m];
lo[m] = function() {
deprecated(
`lodash is deprecated and will be removed from Discourse.`,
{
since: "2.6",
dropFrom: "2.7"
}
);
return old(...arguments);
};
});
}
}
};