Skip to content

Move macro runtime support into Dependencies module - #452

Open
scogeo wants to merge 1 commit into
pointfreeco:mainfrom
scogeo:report-issue-wrapper
Open

Move macro runtime support into Dependencies module#452
scogeo wants to merge 1 commit into
pointfreeco:mainfrom
scogeo:report-issue-wrapper

Conversation

@scogeo

@scogeo scogeo commented Jun 18, 2026

Copy link
Copy Markdown

This PR moves runtime support used by generated @DependencyClient/@DependencyEndpoint macro code into the Dependencies module. The current macro generated code introduces linkage dependencies on both IssueReporting and DependeniesMacros requiring clients to import both when using a dependency that was generated with the macros.

This consolidates all such macro runtime dependencies into the MacrosSupport.swift file in the Dependencies module. This reduces the client import surface to just Dependencies when using a macro-generated client. It must also now be imported when declaring a macro-generated dependency using @DependencyClient and related macros. In most common usage scenarios, it would normally already be imported to access DependencyValues, TestDependencyKey, etc., but this is a potentially breaking change and should be noted if released.

Summary of Changes

  • Add Dependencies._reportIssue as a small wrapper around IssueReporting.reportIssue.
  • Add Dependencies.UnimplementedDependencyEndpoint to replace DependenciesMacros.Unimplemented in generated throwing endpoint defaults.
  • Update generated macro code to reference Dependencies instead of IssueReporting / DependenciesMacros directly.
  • Remove the runtime-only Unimplemented type from DependenciesMacros.
  • Update macro tests and add coverage for the concrete thrown error type.

Not Addressed

  • The existing DependenciesMacros.Unimplemented was removed and not deprecated. This could potentially be an issue for users who were explicitly catching the exception type. But leaving it creates some cruft and it seems to mostly be an internal type (there was no existing test coverage for it).

Validation

  • swift test
  • make test-swift

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.

1 participant