Skip to content

docs: document Block Kit support via post()#25

Draft
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/blockkit-pod-note
Draft

docs: document Block Kit support via post()#25
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/blockkit-pod-note

Conversation

@Koan-Bot

Copy link
Copy Markdown
Collaborator

What

POD-only addition: clarify that post() accepts arbitrary Slack payloads (including Block Kit), and add a runnable examples/blocks.pl showing a Block Kit message.

Why

Closes #24. Slack classified attachments as legacy in 2019 and recommends Block Kit for new development. The colored post_* helpers still build attachments — that's fine for the "preset layout" use case the module exists for — but users who need richer layouts (sections, dividers, fields, buttons) had no obvious entry point in the docs.

post() already supports arbitrary hash refs serialized to JSON, so Block Kit works today. This PR just makes that fact discoverable.

How

  • Extended the POD on post() to describe both calling conventions and point to Block Kit
  • Added a short note that the colored post_* helpers use legacy attachments
  • New examples/blocks.pl (section + divider + fields), wired in via # EXAMPLE: so it appears in the generated docs
  • Zero behavior change — diff is +41 / −1 lines, all documentation

Testing

  • prove -Ilib -lr t/ — 48/48 pass
  • podchecker lib/Slack/WebHook.pm — OK
  • perl -c -Ilib examples/blocks.pl — OK

Note on PR queue

Intentionally kept razor-thin so it can be merged without competing with the existing review backlog. Issue #23 (JSON::MaybeXS) explicitly recommends waiting for the queue to clear, so it's not in this PR.

Slack classified attachments as legacy in 2019 and now recommends Block Kit
for new development. The colored post_* helpers still build attachments —
which is fine for the "preset layout" use case — but users who need richer
layouts (sections, dividers, fields, buttons) had no obvious entry point.

The post() method already accepts an arbitrary hash ref that is serialized
to JSON and posted as-is, so Block Kit works today without any code change.
This commit makes that explicit:

- POD on post() now describes both calling conventions and points to Block Kit
- A short note clarifies attachments are legacy and Block Kit is preferred
  for richer layouts
- examples/blocks.pl shows a Block Kit payload (section + divider + fields)

POD-only — no behavior change. Closes #24.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Koan-Bot added a commit that referenced this pull request May 4, 2026
Add examples/blocks.pl showing both format=>'blocks' mode and manual
Block Kit via post(). Expand post() POD to mention Block Kit as the
recommended format for custom layouts.

Subsumes PR #25 content — that PR can be closed after this merges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koan-Bot

Koan-Bot commented May 4, 2026

Copy link
Copy Markdown
Collaborator Author

Note: the content of this PR (examples/blocks.pl + Block Kit POD) has been folded into PR #33 (feat: Block Kit output mode), which adds native format => 'blocks' support along with the documentation and examples. This PR can be closed once #33 is merged.

🤖 Kōan triage note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider Slack Block Kit support (attachments are legacy)

1 participant