Skip to content

v0.0.2

Latest

Choose a tag to compare

@diegotl diegotl released this 03 Feb 22:54
· 2 commits to main since this release
4482c9c

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