DEV: Deprecate ember module imports (#9011)

Removes remaining `ember` module imports.
This commit is contained in:
Jarek Radosz 2020-02-21 15:56:49 +01:00 committed by GitHub
parent c607870f08
commit 6ba326a9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,5 @@
import { sort } from "@ember/object/computed";
import Evented from "@ember/object/evented";
import EmberObjectProxy from "@ember/object/proxy";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
@ -6,9 +7,8 @@ import ModalFunctionality from "discourse/mixins/modal-functionality";
const BufferedProxy = window.BufferedProxy; // import BufferedProxy from 'ember-buffered-proxy/proxy';
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseComputed, { on } from "discourse-common/utils/decorators";
import Ember from "ember";
export default Controller.extend(ModalFunctionality, Ember.Evented, {
export default Controller.extend(ModalFunctionality, Evented, {
init() {
this._super(...arguments);

View File

@ -1,11 +1,7 @@
import Ember from "ember";
const isArray = Ember.isArray;
export default function(str, formats) {
let cachedFormats = formats;
if (!isArray(cachedFormats) || arguments.length > 2) {
if (!_.isArray(cachedFormats) || arguments.length > 2) {
cachedFormats = new Array(arguments.length - 1);
for (let i = 1, l = arguments.length; i < l; i++) {

View File

@ -1,8 +1,6 @@
import Ember from "ember";
import { computed, get } from "@ember/object";
import extractValue from "./extract-value";
const { computed, get } = Ember;
export default function handleDescriptor(target, key, desc, params = []) {
return {
enumerable: desc.enumerable,

View File

@ -1,4 +1,14 @@
// Allow us to import Ember
define('ember', ['exports'], function(__exports__) {
define("ember", ["exports"], function(__exports__) {
// eslint-disable-next-line no-console
console.warn(
[
"Deprecation notice:",
"Use specific `@ember/*` imports instead of `ember`",
"(deprecated since Discourse 2.4.0)",
"(removal in Discourse 2.5.0)"
].join(" ")
);
__exports__.default = Ember;
});