types 3.0: breaking changes for block kit types
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- api
調査の方向性
まず、slack-web-api-client の src/block-kit/blocks.ts にある Block Kit 定義を現在の @slack/types と比較し、#1904 から付けられた関連 issue を確認します。次に、bolt-js の composable な event payload と再帰的な Block Kit 型を調べます。完了時点では、破壊的な型変更と残りの utility 型の作業について、文書化され合意されたスコープが定まっている状態にします。
索引モデルが issue の本文から書いたものです。
説明
Taking inspiration from @seratch's library, https://github.com/seratch/slack-web-api-client/tree/main/src/block-kit, should study the following to see what kinds of improvements on the Block Kit side we could leverage in @slack/types.
Also, we should study bolt-js' use of composable event payloads and recursive Block Kit types, to see what improvements could land here. See the issues tagged in https://github.com/slackapi/node-slack-sdk/issues/1904
Idea: Add generics to layout blocks
What if we extended Blocks with generics, so that a containing layout block could constrain or fully specify the block elements contained within. An example on how this would look like for a dev:
const myImage: ImageElement = {
type: 'image',
alt_text: 'kitteh',
image_url: 'https://kittens-r-us.com/kitteh.jpg',
}
const myContextBlock: ContextBlock<ImageElement> = {
type: 'context',
elements: [myImage], // compiles fine
}
const nopeBlock: ContextBlock<ImageElement> = {
type: 'context',
elements: [{ type: 'text', text: 'hello' }], // nope, TS complains that { type: 'text' } not assignable to ImageElement
}
The benefit here is more control and composability. Extending this further, we could employ a similar approach to other Slack domain objects and event payloads, so that they could all be composed in a similar way. For example, a block_actions event payload from a button click could be modeled by passing the ButtonElement into the BlockActionsEvent via generic (BlockActionsEvent<ButtonElement>), or the same idea for composing a View, and then passing that View into a ViewSubmissionEvent.. and so on.
Other Changes
- Define a utility type of Blocks based on availability in different Slack surfaces, see slack-web-api-client example
- 主要言語
- TypeScript
- スター
- 3.4k
- フォーク
- 693
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 67
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/node-slack-sdk のほかの issue
-
auto-triage-skip enhancement pkg:web-api
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
slackapi/node-slack-sdk#2607 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
`SlackListsItem FieldMessage.message` type does not match API response shape対応中かも @AjTheSpidey が 202 日前に担当しました。 オープンarea:typescript auto-triage-skip bug pkg:web-api
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
slackapi/node-slack-sdk#2598 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Missing TypeScript response type for files.uploadV2対応中かも @Yshuro が 6 日前に担当しました。 オープンarea:typescript auto-triage-skip bug pkg:web-api
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
slackapi/node-slack-sdk#2459 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Docs/types: document `broadcast_delete` on chat.delete (undo reply_broadcast)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:typescript enhancement pkg:web-api semver:patch
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
slackapi/node-slack-sdk#2815 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
auto-triage-stale
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
slackapi/node-slack-sdk#2791 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
slackapi/node-slack-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
agilepathway/label-checker#1015 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug P3
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
react-component/image#541 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信