Skip to content

Releases: diegotl/SlackKit

v0.0.2

03 Feb 22:54
4482c9c

Choose a tag to compare

What's New

Result Builder APIs

Added @resultBuilder support for cleaner, more Swift-like construction of Slack blocks:

  • ActionsBlock: Actions { ButtonElement(...) } instead of Actions([...])
  • ContextBlock: Context { TextContextElement(...) } instead of Context([...])
  • SectionBlock fields: Section(fields: Fields { Field.markdown("...") })
  • SelectElement options: StaticSelectElement(options: Options { Option(...) })
  • OverflowElement options: OverflowElement(options: Options { ... })
  • OptionGroup: OptionGroup(options: Options { ... })

Supports conditional statements (if, switch) and loops (for, while) within builders.

Convenience Helpers

  • Field.markdown() / Field.plainText() for section fields
  • TextContextElement.markdown() for markdown context elements
  • DatePickerElement.formatDate() for YYYY-MM-DD date formatting

Integration Tests

  • Added comprehensive integration test suite (80+ tests)
  • Uses SLACK_TEST_WEBHOOK_URL environment variable for configuration

Bug Fixes

  • Rate limit handling: Fixed unreachable 429 status check (moved before isSuccess)
  • InputBlock: Fixed dispatch_action coding key (was incorrectly dispatch_action_config)
  • InputBlock: Fixed element decoding using superDecoder() for nested types
  • DatePickerElement: Changed initialDate from Int to String (YYYY-MM-DD format)
  • TextContextElement: Added configurable type field for proper markdown/plain_text support
  • URLSessionNetworkClient: Removed unused decoder property
  • Builder API: Fixed empty blocks array encoding to avoid Slack API rejection

Full Changelog

v0.0.1

02 Feb 06:59

Choose a tag to compare

  • Add FoundationNetworking import for Linux support in URLSessionNetworkClient
  • Remove unnecessary conditional cast in InputBlock (BlockElement already conforms to Codable)
  • Update README with correct repository URL