DEV: Update ember-cli-deprecation-workflow from 2.2.0 to 3.0.1 (#28226)
From dependabot PR: <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/ember-cli/ember-cli-deprecation-workflow/releases">ember-cli-deprecation-workflow's releases</a>.</em></p> <blockquote> <h2>v3.0.1-ember-cli-deprecation-workflow</h2> <h2>Release (2024-07-11)</h2> <p>ember-cli-deprecation-workflow 3.0.1 (patch)</p> <h4>🏠 Internal</h4> <ul> <li><code>ember-cli-deprecation-workflow</code> <ul> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/192">#192</a> fix repository link in package.json (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/191">#191</a> update release plan workflow (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> </ul> </li> </ul> <h4>Committers: 1</h4> <ul> <li>Chris Manson (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> </ul> <h2>v3.0.0</h2> <h2>Release (2024-06-25)</h2> <p>ember-cli-deprecation-workflow 3.0.0 (major)</p> <h4>💥 Breaking Change</h4> <ul> <li><code>ember-cli-deprecation-workflow</code> <ul> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/159">#159</a> [BREAKING] Convert to a module. Drops support for Ember < 3.28, requires manual initialization (<a href="https://github.com/lolmaus"><code>@lolmaus</code></a>)</li> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/175">#175</a> Node 16 is the minimum supported version (<a href="https://github.com/mixonic"><code>@mixonic</code></a>)</li> </ul> </li> </ul> <h4>🐛 Bug Fix</h4> <ul> <li><code>ember-cli-deprecation-workflow</code> <ul> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/181">#181</a> Remove unused broccoli magic (<a href="https://github.com/simonihmig"><code>@simonihmig</code></a>)</li> </ul> </li> </ul> <h4>📝 Documentation</h4> <ul> <li><code>ember-cli-deprecation-workflow</code> <ul> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/184">#184</a> Update configuration paths in documentation (<a href="https://github.com/backspace"><code>@backspace</code></a>)</li> </ul> </li> </ul> <h4>🏠 Internal</h4> <ul> <li><code>ember-cli-deprecation-workflow</code> <ul> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/189">#189</a> start using release-plan (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/188">#188</a> start using pnpm (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/178">#178</a> Upgrade Ember CLI to 5.4 (<a href="https://github.com/lolmaus"><code>@lolmaus</code></a>)</li> <li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/170">#170</a> Bump Node, swap to npm, update CI pipeline (<a href="https://github.com/mixonic"><code>@mixonic</code></a>)</li> </ul> </li> </ul> <h4>Committers: 5</h4> <ul> <li>Andrey Mikhaylov (lolmaus) (<a href="https://github.com/lolmaus"><code>@lolmaus</code></a>)</li> <li>Buck Doyle (<a href="https://github.com/backspace"><code>@backspace</code></a>)</li> <li>Chris Manson (<a href="https://github.com/mansona"><code>@mansona</code></a>)</li> <li>Matthew Beale (<a href="https://github.com/mixonic"><code>@mixonic</code></a>)</li> <li>Simon Ihmig (<a href="https://github.com/simonihmig"><code>@simonihmig</code></a>)</li> </ul> </blockquote> </details>
This commit is contained in:
parent
e494bafed3
commit
064332ef6e
|
@ -0,0 +1,14 @@
|
|||
const DEPRECATION_WORKFLOW = [
|
||||
{
|
||||
handler: "silence",
|
||||
matchId: "ember-this-fallback.this-property-fallback",
|
||||
},
|
||||
{ handler: "silence", matchId: "discourse.select-kit" },
|
||||
{ handler: "silence", matchId: "discourse.d-section" },
|
||||
{
|
||||
handler: "silence",
|
||||
matchId: "discourse.decorate-widget.hamburger-widget-links",
|
||||
},
|
||||
];
|
||||
|
||||
export default DEPRECATION_WORKFLOW;
|
|
@ -1,7 +1,7 @@
|
|||
import DEPRECATION_WORKFLOW from "../deprecation-workflow";
|
||||
|
||||
const handlers = [];
|
||||
const disabledDeprecations = new Set();
|
||||
const deprecationWorkflow = window.deprecationWorkflow;
|
||||
const workflows = deprecationWorkflow?.config?.workflow;
|
||||
|
||||
let emberDeprecationSilencer;
|
||||
|
||||
|
@ -47,12 +47,12 @@ export default function deprecated(msg, options = {}) {
|
|||
|
||||
handlers.forEach((h) => h(msg, options));
|
||||
|
||||
const matchedWorkflow = workflows?.find((w) => w.matchId === id);
|
||||
const matchedWorkflow = DEPRECATION_WORKFLOW.find((w) => w.matchId === id);
|
||||
|
||||
if (
|
||||
raiseError ||
|
||||
matchedWorkflow?.handler === "throw" ||
|
||||
(!matchedWorkflow && deprecationWorkflow?.throwOnUnhandled)
|
||||
(!matchedWorkflow && globalThis.EmberENV?.RAISE_ON_DEPRECATION)
|
||||
) {
|
||||
throw msg;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-disable simple-import-sort/imports */
|
||||
import "./deprecation-workflow";
|
||||
import "decorator-transforms/globals";
|
||||
import "./loader-shims";
|
||||
import "./global-compat";
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import setupDeprecationWorkflow from "ember-cli-deprecation-workflow";
|
||||
import DEPRECATION_WORKFLOW from "discourse-common/deprecation-workflow";
|
||||
|
||||
// We're using RAISE_ON_DEPRECATION in environment.js instead of
|
||||
// `throwOnUnhandled` here since it is easier to toggle.
|
||||
setupDeprecationWorkflow({ workflow: DEPRECATION_WORKFLOW });
|
|
@ -2,7 +2,7 @@ export default {
|
|||
initialize() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
if (params.get("safe_mode")?.split(",").includes("deprecation_errors")) {
|
||||
window.deprecationWorkflow.throwOnUnhandled = true;
|
||||
window.EmberENV.RAISE_ON_DEPRECATION = true;
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@ import Service, { service } from "@ember/service";
|
|||
import { addGlobalNotice } from "discourse/components/global-notice";
|
||||
import identifySource from "discourse/lib/source-identifier";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import DEPRECATION_WORKFLOW from "discourse-common/deprecation-workflow";
|
||||
import { registerDeprecationHandler as registerDiscourseDeprecationHandler } from "discourse-common/lib/deprecated";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
|
@ -49,12 +50,11 @@ export default class DeprecationWarningHandler extends Service {
|
|||
|
||||
@bind
|
||||
handle(message, opts) {
|
||||
const workflowConfigs = window.deprecationWorkflow?.config?.workflow;
|
||||
const matchingConfig = workflowConfigs.find(
|
||||
const matchingConfig = DEPRECATION_WORKFLOW.find(
|
||||
(config) => config.matchId === opts.id
|
||||
);
|
||||
|
||||
if (matchingConfig && matchingConfig.handler === "silence") {
|
||||
if (matchingConfig?.handler === "silence") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
globalThis.deprecationWorkflow = globalThis.deprecationWorkflow || {};
|
||||
globalThis.deprecationWorkflow.config = {
|
||||
// We're using RAISE_ON_DEPRECATION in environment.js instead of
|
||||
// `throwOnUnhandled` here since it is easier to toggle.
|
||||
workflow: [
|
||||
{
|
||||
handler: "silence",
|
||||
matchId: "ember-this-fallback.this-property-fallback",
|
||||
},
|
||||
{ handler: "silence", matchId: "discourse.select-kit" },
|
||||
{ handler: "silence", matchId: "discourse.d-section" },
|
||||
{
|
||||
handler: "silence",
|
||||
matchId: "discourse.decorate-widget.hamburger-widget-links",
|
||||
},
|
||||
],
|
||||
};
|
|
@ -88,7 +88,7 @@
|
|||
"ember-cli": "~5.10.0",
|
||||
"ember-cli-app-version": "^7.0.0",
|
||||
"ember-cli-babel": "^8.2.0",
|
||||
"ember-cli-deprecation-workflow": "^2.2.0",
|
||||
"ember-cli-deprecation-workflow": "^3.0.1",
|
||||
"ember-cli-htmlbars": "^6.3.0",
|
||||
"ember-cli-inject-live-reload": "^2.1.0",
|
||||
"ember-cli-progress-ci": "1.0.0",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { registerDeprecationHandler } from "@ember/debug";
|
||||
import DEPRECATION_WORKFLOW from "discourse-common/deprecation-workflow";
|
||||
import { registerDeprecationHandler as registerDiscourseDeprecationHandler } from "discourse-common/lib/deprecated";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
|
||||
|
@ -79,8 +80,7 @@ function reportToTestem(id) {
|
|||
}
|
||||
|
||||
export function setupDeprecationCounter(qunit) {
|
||||
const config = window.deprecationWorkflow?.config?.workflow || {};
|
||||
const deprecationCounter = new DeprecationCounter(config);
|
||||
const deprecationCounter = new DeprecationCounter(DEPRECATION_WORKFLOW);
|
||||
|
||||
qunit.begin(() => deprecationCounter.start());
|
||||
|
||||
|
|
|
@ -1,28 +1,30 @@
|
|||
import { registerDeprecationHandler } from "@ember/debug";
|
||||
import QUnit from "qunit";
|
||||
import DEPRECATION_WORKFLOW from "discourse-common/deprecation-workflow";
|
||||
import { registerDeprecationHandler as registerDiscourseDeprecationHandler } from "discourse-common/lib/deprecated";
|
||||
|
||||
let disabled = false;
|
||||
|
||||
export function configureRaiseOnDeprecation() {
|
||||
const workflows = window.deprecationWorkflow?.config?.workflow;
|
||||
if (!workflows) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.EmberENV.RAISE_ON_DEPRECATION !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
registerDeprecationHandler((message, options, next) => {
|
||||
if (disabled || workflows.find((w) => w.matchId === options.id)) {
|
||||
if (
|
||||
disabled ||
|
||||
DEPRECATION_WORKFLOW.find((w) => w.matchId === options.id)
|
||||
) {
|
||||
return next(message, options);
|
||||
}
|
||||
raiseDeprecationError(message, options);
|
||||
});
|
||||
|
||||
registerDiscourseDeprecationHandler((message, options) => {
|
||||
if (disabled || workflows.find((w) => w.matchId === options?.id)) {
|
||||
if (
|
||||
disabled ||
|
||||
DEPRECATION_WORKFLOW.find((w) => w.matchId === options?.id)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
raiseDeprecationError(message, options);
|
||||
|
|
|
@ -29,7 +29,8 @@ define("discourse/lib/deprecate-shim", ["exports"], function (exports) {
|
|||
|
||||
require("@ember/debug").registerDeprecationHandler(
|
||||
function shimLogDeprecationToConsole(message, options) {
|
||||
var updatedMessage = formatMessage(message, options);
|
||||
const updatedMessage = formatMessage(message, options);
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`DEPRECATION: ${updatedMessage}`);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -86,6 +86,7 @@ module PrettyText
|
|||
)
|
||||
|
||||
%w[
|
||||
discourse-common/addon/deprecation-workflow
|
||||
discourse-common/addon/lib/get-url
|
||||
discourse-common/addon/lib/object
|
||||
discourse-common/addon/lib/deprecated
|
||||
|
|
19
yarn.lock
19
yarn.lock
|
@ -154,7 +154,7 @@
|
|||
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.2.tgz#e41928bd33475305c586f6acbbb7e3ade7a6f7f5"
|
||||
integrity sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==
|
||||
|
||||
"@babel/core@^7.12.0", "@babel/core@^7.14.5", "@babel/core@^7.16.10", "@babel/core@^7.16.7", "@babel/core@^7.18.6", "@babel/core@^7.20.12", "@babel/core@^7.23.6", "@babel/core@^7.24.6", "@babel/core@^7.25.2", "@babel/core@^7.3.4":
|
||||
"@babel/core@^7.12.0", "@babel/core@^7.14.5", "@babel/core@^7.16.10", "@babel/core@^7.16.7", "@babel/core@^7.18.6", "@babel/core@^7.20.12", "@babel/core@^7.23.2", "@babel/core@^7.23.6", "@babel/core@^7.24.6", "@babel/core@^7.25.2", "@babel/core@^7.3.4":
|
||||
version "7.25.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77"
|
||||
integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==
|
||||
|
@ -3923,7 +3923,7 @@ broccoli-funnel@^2.0.0, broccoli-funnel@^2.0.2:
|
|||
symlink-or-copy "^1.0.0"
|
||||
walk-sync "^0.3.1"
|
||||
|
||||
broccoli-funnel@^3.0.3, broccoli-funnel@^3.0.7, broccoli-funnel@^3.0.8:
|
||||
broccoli-funnel@^3.0.7, broccoli-funnel@^3.0.8:
|
||||
version "3.0.8"
|
||||
resolved "https://registry.yarnpkg.com/broccoli-funnel/-/broccoli-funnel-3.0.8.tgz#f5b62e2763c3918026a15a3c833edc889971279b"
|
||||
integrity sha512-ng4eIhPYiXqMw6SyGoxPHR3YAwEd2lr9FgBI1CyTbspl4txZovOsmzFkMkGAlu88xyvYXJqHiM2crfLa65T1BQ==
|
||||
|
@ -4088,7 +4088,7 @@ broccoli-plugin@^2.1.0:
|
|||
rimraf "^2.3.4"
|
||||
symlink-or-copy "^1.1.8"
|
||||
|
||||
broccoli-plugin@^4.0.0, broccoli-plugin@^4.0.2, broccoli-plugin@^4.0.3, broccoli-plugin@^4.0.5, broccoli-plugin@^4.0.7:
|
||||
broccoli-plugin@^4.0.0, broccoli-plugin@^4.0.2, broccoli-plugin@^4.0.3, broccoli-plugin@^4.0.7:
|
||||
version "4.0.7"
|
||||
resolved "https://registry.yarnpkg.com/broccoli-plugin/-/broccoli-plugin-4.0.7.tgz#dd176a85efe915ed557d913744b181abe05047db"
|
||||
integrity sha512-a4zUsWtA1uns1K7p9rExYVYG99rdKeGRymW0qOCNkvDPHQxVi3yVyJHhQbM3EZwdt2E0mnhr5e0c/bPpJ7p3Wg==
|
||||
|
@ -5400,15 +5400,14 @@ ember-cli-babel@^8.2.0:
|
|||
resolve-package-path "^4.0.3"
|
||||
semver "^7.3.8"
|
||||
|
||||
ember-cli-deprecation-workflow@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ember-cli-deprecation-workflow/-/ember-cli-deprecation-workflow-2.2.0.tgz#277d56bdafc15dbdb7a58dee598402cdf50e0d08"
|
||||
integrity sha512-23bXZqZJBJSKBTfT0LK7qzSJX861TgafL6RVdMfn/iubpLnoZIWergYwEdgs24CNTUbuehVbHy2Q71o8jYfwfw==
|
||||
ember-cli-deprecation-workflow@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ember-cli-deprecation-workflow/-/ember-cli-deprecation-workflow-3.0.1.tgz#2891ed87df1a0f076f0b6db813e2b8e0e8fc0e80"
|
||||
integrity sha512-d5wM5IHu+HjIK2TucQWOTFD9725Dx+xBZ3oBc0ZLaB8mdTV3wrAOrQ1vyzcuZEe/uvFBhr5TIy5QP+UNJ2q8Hg==
|
||||
dependencies:
|
||||
"@babel/core" "^7.23.2"
|
||||
"@ember/string" "^3.0.0"
|
||||
broccoli-funnel "^3.0.3"
|
||||
broccoli-merge-trees "^4.2.0"
|
||||
broccoli-plugin "^4.0.5"
|
||||
ember-cli-babel "^8.2.0"
|
||||
|
||||
ember-cli-get-component-path-option@^1.0.0:
|
||||
version "1.0.0"
|
||||
|
|
Loading…
Reference in New Issue