Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

allow for "budgets" as a deprecation handler

オープン
#64 コメント 4 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
tooling

調査の方向性

config/deprecation-workflow.js のワークフロー設定から始め、既存のハンドラーがどのように設定されているかを確認します。予算のカウントをどのように追跡するか、予算を超過したときにいつエラーをスローするか、現在のカウントをブラウザーから設定にコピーする方法を定義します。提案した予算の動作が、silence、log、throw ハンドラーを壊すことなく、制御された実行で機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Context

Currently, ember-cli-deprecation-workflow supports 3 handlers for deprecations:

silence Keeps this deprecation from spewing all over the console
log Normal deprecation behavior runs for this deprecation and messages are logged to the console
throw The error is thrown instead of allowing the deprecated behavior to run. WARNING: APPLICATION MAY GO 💥

While these work for their intended purposes really well, they don't necessarily help cases where you might not be able to address a deprecation right away, but a team wants to prevent the deprecation count from growing from things like copy-pasting code that will cause new deprecations to pile up.

Proposal

Users of this addon will be able to specify a budget option to the handler option for each deprecation. If the deprecation is triggered more than the allowed budget in certain scenarios (e.g. a test suite run where conditions are more controlled), then the handler will throw. This would allow a team to keep existing code that causes deprecations but fail builds in CI for any new code that increases deprecation use.

For example, take the following config/deprecation-workflow.js:

// config/deprecation-workflow.js
window.deprecationWorkflow = window.deprecationWorkflow || {};
window.deprecationWorkflow.config = {
  workflow: [
    { matchId: 'ember-string-utils.fmt', handler: { budget: 10 } },
  ]
};

if a new pull request was opened with the following code:

Ember.String.format('some string %s', 'hi')

This would increase the number of deprecations invoked to 11, violating the budget, causing ember-cli-deprecation-workflow to throw, failing the build.

We would likely also need some facility to make copy/pasting the existing deprecation count (to set the initial budget) to config/deprecation-workflow.js from the browser easier as well.

I'd be happy to PR this, just wanted to get thoughts on the idea before going through the effort of writing code.

主要言語
JavaScript
スター
166
フォーク
44
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ember-cli/ember-cli-deprecation-workflow のほかの issue

ember-cli/ember-cli-deprecation-workflow の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。