Revert "DEV: Prefix deprecation notices and api warnings with theme name/id" (#15902)
This reverts commita4ff69bd99
. Follow-up to8e5b945b0f
This commit is contained in:
parent
8e5b945b0f
commit
76aadc67bb
|
@ -11,11 +11,5 @@ export default function deprecated(msg, opts = {}) {
|
||||||
if (opts.raiseError) {
|
if (opts.raiseError) {
|
||||||
throw msg;
|
throw msg;
|
||||||
}
|
}
|
||||||
|
console.warn(msg); // eslint-disable-line no-console
|
||||||
// Using deferred `require` because this is discourse-specific logic which
|
|
||||||
// we don't want to run in pretty-text/wizard/etc.
|
|
||||||
const consolePrefix =
|
|
||||||
require("discourse/lib/source-identifier")?.consolePrefix() || "";
|
|
||||||
|
|
||||||
console.warn(consolePrefix, msg); //eslint-disable-line no-console
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ import {
|
||||||
} from "discourse/widgets/search-menu-results";
|
} from "discourse/widgets/search-menu-results";
|
||||||
import { CUSTOM_USER_SEARCH_OPTIONS } from "select-kit/components/user-chooser";
|
import { CUSTOM_USER_SEARCH_OPTIONS } from "select-kit/components/user-chooser";
|
||||||
import { downloadCalendar } from "discourse/lib/download-calendar";
|
import { downloadCalendar } from "discourse/lib/download-calendar";
|
||||||
import { consolePrefix } from "discourse/lib/source-identifier";
|
|
||||||
|
|
||||||
// If you add any methods to the API ensure you bump up the version number
|
// If you add any methods to the API ensure you bump up the version number
|
||||||
// based on Semantic Versioning 2.0.0. Please update the changelog at
|
// based on Semantic Versioning 2.0.0. Please update the changelog at
|
||||||
|
@ -105,7 +104,6 @@ function canModify(klass, type, resolverName, changes) {
|
||||||
if (!changes.pluginId) {
|
if (!changes.pluginId) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
consolePrefix(),
|
|
||||||
"To prevent errors in tests, add a `pluginId` key to your `modifyClass` call. This will ensure the modification is only applied once."
|
"To prevent errors in tests, add a `pluginId` key to your `modifyClass` call. This will ensure the modification is only applied once."
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
|
@ -168,7 +166,6 @@ class PluginApi {
|
||||||
if (this.container.cache[resolverName]) {
|
if (this.container.cache[resolverName]) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
consolePrefix(),
|
|
||||||
`"${resolverName}" was already cached in the container. Changes won't be applied.`
|
`"${resolverName}" was already cached in the container. Changes won't be applied.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -177,10 +174,7 @@ class PluginApi {
|
||||||
if (!klass) {
|
if (!klass) {
|
||||||
if (!opts.ignoreMissing) {
|
if (!opts.ignoreMissing) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(`"${resolverName}" was not found by modifyClass`);
|
||||||
consolePrefix(),
|
|
||||||
`"${resolverName}" was not found by modifyClass`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -987,7 +981,6 @@ class PluginApi {
|
||||||
if (!item["name"]) {
|
if (!item["name"]) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
consolePrefix(),
|
|
||||||
"A 'name' is required when adding a Navigation Bar Item.",
|
"A 'name' is required when adding a Navigation Bar Item.",
|
||||||
item
|
item
|
||||||
);
|
);
|
||||||
|
@ -1650,7 +1643,7 @@ function getPluginApi(version) {
|
||||||
return pluginApi;
|
return pluginApi;
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(consolePrefix(), `Plugin API v${version} is not supported`);
|
console.warn(`Plugin API v${version} is not supported`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1677,7 +1670,6 @@ function decorate(klass, evt, cb, id) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
consolePrefix(),
|
|
||||||
"`decorateCooked` should be supplied with an `id` option to avoid memory leaks in test mode. The id will be used to ensure the decorator is only applied once."
|
"`decorateCooked` should be supplied with an `id` option to avoid memory leaks in test mode. The id will be used to ensure the decorator is only applied once."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue