-
Notifications
You must be signed in to change notification settings - Fork 674
types 3.0: breaking changes for block kit types #1905
Copy link
Copy link
Open
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsenhancementM-T: A feature request for new functionalityM-T: A feature request for new functionalitypkg:typesapplies to `@slack/types`applies to `@slack/types`semver:major
Milestone
Metadata
Metadata
Assignees
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsenhancementM-T: A feature request for new functionalityM-T: A feature request for new functionalitypkg:typesapplies to `@slack/types`applies to `@slack/types`semver:major
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 #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:
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_actionsevent payload from a button click could be modeled by passing theButtonElementinto theBlockActionsEventvia generic (BlockActionsEvent<ButtonElement>), or the same idea for composing a View, and then passing that View into a ViewSubmissionEvent.. and so on.Other Changes