DEV: Silence resolver deprecations for now (#17931)

These are in widespread use, and upgrading themes/plugins right now would break their compatibility with the stable branch. These should be unsilenced for the release of 2.9.0 stable.
This commit is contained in:
David Taylor 2022-08-15 16:11:46 +01:00 committed by GitHub
parent 3ffc213fa9
commit 7067f13169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 7 deletions

View File

@ -38,55 +38,68 @@ const DEPRECATED_MODULES = new Map(
since: "2.4.0", since: "2.4.0",
dropFrom: "2.9.0.beta1", dropFrom: "2.9.0.beta1",
}, },
// Deprecations below are silenced because they're in widespread use, and upgrading
// themes/plugins right now would break their compatibility with the stable branch.
// These should be unsilenced for the release of 2.9.0 stable.
"store:main": { "store:main": {
newName: "service:store", newName: "service:store",
since: "2.8.0.beta8", since: "2.8.0.beta8",
dropFrom: "2.9.0.beta1", dropFrom: "2.9.0.beta1",
silent: true,
}, },
"search-service:main": { "search-service:main": {
newName: "service:search", newName: "service:search",
since: "2.8.0.beta8", since: "2.8.0.beta8",
dropFrom: "2.9.0.beta1", dropFrom: "2.9.0.beta1",
silent: true,
}, },
"key-value-store:main": { "key-value-store:main": {
newName: "service:key-value-store", newName: "service:key-value-store",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"pm-topic-tracking-state:main": { "pm-topic-tracking-state:main": {
newName: "service:pm-topic-tracking-state", newName: "service:pm-topic-tracking-state",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"message-bus:main": { "message-bus:main": {
newName: "service:message-bus", newName: "service:message-bus",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"site-settings:main": { "site-settings:main": {
newName: "service:site-settings", newName: "service:site-settings",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"current-user:main": { "current-user:main": {
newName: "service:current-user", newName: "service:current-user",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"session:main": { "session:main": {
newName: "service:session", newName: "service:session",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"site:main": { "site:main": {
newName: "service:site", newName: "service:site",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
"topic-tracking-state:main": { "topic-tracking-state:main": {
newName: "service:topic-tracking-state", newName: "service:topic-tracking-state",
since: "2.9.0.beta7", since: "2.9.0.beta7",
dropFrom: "3.0.0", dropFrom: "3.0.0",
silent: true,
}, },
}) })
); );
@ -138,13 +151,15 @@ export function buildResolver(baseName) {
_normalize(fullName) { _normalize(fullName) {
const deprecationInfo = DEPRECATED_MODULES.get(fullName); const deprecationInfo = DEPRECATED_MODULES.get(fullName);
if (deprecationInfo) { if (deprecationInfo) {
deprecated( if (!deprecationInfo.silent) {
`"${fullName}" is deprecated, use "${deprecationInfo.newName}" instead`, deprecated(
{ `"${fullName}" is deprecated, use "${deprecationInfo.newName}" instead`,
since: deprecationInfo.since, {
dropFrom: deprecationInfo.dropFrom, since: deprecationInfo.since,
} dropFrom: deprecationInfo.dropFrom,
); }
);
}
fullName = deprecationInfo.newName; fullName = deprecationInfo.newName;
} }