mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Deprecate ember module imports (#9011)
Removes remaining `ember` module imports.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { sort } from "@ember/object/computed";
|
import { sort } from "@ember/object/computed";
|
||||||
|
import Evented from "@ember/object/evented";
|
||||||
import EmberObjectProxy from "@ember/object/proxy";
|
import EmberObjectProxy from "@ember/object/proxy";
|
||||||
import Controller from "@ember/controller";
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
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';
|
const BufferedProxy = window.BufferedProxy; // import BufferedProxy from 'ember-buffered-proxy/proxy';
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import discourseComputed, { on } from "discourse-common/utils/decorators";
|
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() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
import Ember from "ember";
|
|
||||||
|
|
||||||
const isArray = Ember.isArray;
|
|
||||||
|
|
||||||
export default function(str, formats) {
|
export default function(str, formats) {
|
||||||
let cachedFormats = formats;
|
let cachedFormats = formats;
|
||||||
|
|
||||||
if (!isArray(cachedFormats) || arguments.length > 2) {
|
if (!_.isArray(cachedFormats) || arguments.length > 2) {
|
||||||
cachedFormats = new Array(arguments.length - 1);
|
cachedFormats = new Array(arguments.length - 1);
|
||||||
|
|
||||||
for (let i = 1, l = arguments.length; i < l; i++) {
|
for (let i = 1, l = arguments.length; i < l; i++) {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import Ember from "ember";
|
import { computed, get } from "@ember/object";
|
||||||
import extractValue from "./extract-value";
|
import extractValue from "./extract-value";
|
||||||
|
|
||||||
const { computed, get } = Ember;
|
|
||||||
|
|
||||||
export default function handleDescriptor(target, key, desc, params = []) {
|
export default function handleDescriptor(target, key, desc, params = []) {
|
||||||
return {
|
return {
|
||||||
enumerable: desc.enumerable,
|
enumerable: desc.enumerable,
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
// Allow us to import Ember
|
// 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;
|
__exports__.default = Ember;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user