Skip to content

DictionaryCoding: Foundation-only types limit non-Darwin compilation #2

Description

@leogdion

Summary

The DictionaryCoding module (in Packages/AtLeastKit/Sources/DictionaryCoding/) relies heavily on Foundation types that are not available on non-Darwin platforms:

  • NSMutableDictionary, NSMutableArray, NSNull, NSNumber
  • NSDecimalNumber, NSURL, NSDate, NSData
  • CFGetTypeID, CFBooleanGetTypeID, CFUUID (Darwin-only CoreFoundation)

Impact

AtLeastKit targets cross-platform testing (macOS, iOS, watchOS, tvOS, visionOS). While all current targets are Apple platforms, the Foundation dependency means:

  1. DictionaryCoding cannot be tested on Linux CI runners
  2. If AtLeastKit ever needs to support non-Apple platforms, this module would need significant rework

Options to evaluate

  1. Document the limitation — add a note that DictionaryCoding is Darwin-only by design
  2. Add #if canImport(ObjectiveC) guards — provide a stub or alternative implementation for non-Darwin
  3. Replace with an external package — evaluate existing Swift packages that solve Dictionary ↔ Codable bridging cross-platform

Context

Introduced in PR #172 (v1.0.0-beta.5) for WatchConnectivity message serialization via Messagable+Codable.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions