types 3.0: breaking changes for block kit types
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
- Bereich
- api
Rechercherichtung
Beginne mit dem Vergleich der Block-Kit-Definitionen in slack-web-api-client's src/block-kit/blocks.ts mit dem aktuellen @slack/types und prüfe die zugehörigen Issues, die von #1904 getaggt wurden. Untersuche anschließend die zusammensetzbaren Event-Payloads und rekursiven Block-Kit-Typen von bolt-js. Als Ergebnis soll ein dokumentierter, abgestimmter Umfang für die Breaking-Typänderungen und die verbleibende Arbeit an Utility-Typen feststehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.4k
- Forks
- 694
- Ø Merge
- 1 T. 10 Std.
- Gemergte PRs (30 T.)
- 75
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus slackapi/node-slack-sdk
-
web-api: type is_stoppable and date_status_processing_expire on conversations.list agent statusesOffenarea:typescript enhancement pkg:web-api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
slackapi/node-slack-sdk#2900 ·
Maintainer antworten meist innerhalb von 1 Tag
-
pkg:web-api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
slackapi/node-slack-sdk#2895 ·
Maintainer antworten meist innerhalb von 1 Tag
-
pkg:web-api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
slackapi/node-slack-sdk#2894 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`SlackListsItem FieldMessage.message` type does not match API response shapeEvtl. vergeben @AjTheSpidey hat das vor 202 Tagen übernommen. Offenarea:typescript auto-triage-skip bug pkg:web-api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
slackapi/node-slack-sdk#2598 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Missing TypeScript response type for files.uploadV2Evtl. vergeben @Yshuro hat das vor 6 Tagen übernommen. Offenarea:typescript auto-triage-skip bug pkg:web-api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
slackapi/node-slack-sdk#2459 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in slackapi/node-slack-sdk
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
Techiebutler/freeframe#687 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement from-app needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
nightly-labs/openbot#23050 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
OHDSI/Data2Evidence#3846 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
frontend: EditorDialog: Save & Apply on an empty or comment-only document reports success and applies nothingEvtl. vergeben @shubhamrai9122-creator hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
kubernetes-sigs/headlamp#9086 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openai/openai-node#3232 ·
Maintainer antworten meist innerhalb von 1 Tag