docs: document Block Kit support via post()#25
Draft
Koan-Bot wants to merge 1 commit into
Draft
Conversation
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>
6 tasks
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>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
POD-only addition: clarify that
post()accepts arbitrary Slack payloads (including Block Kit), and add a runnableexamples/blocks.plshowing 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
post()to describe both calling conventions and point to Block Kitpost_*helpers use legacy attachmentsexamples/blocks.pl(section + divider + fields), wired in via# EXAMPLE:so it appears in the generated docsTesting
prove -Ilib -lr t/— 48/48 passpodchecker lib/Slack/WebHook.pm— OKperl -c -Ilib examples/blocks.pl— OKNote 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.