Skip to content

@_exported imports should not emit symbols from external dependencies #331

@stephencelis

Description

@stephencelis

Description

Sometimes, a library will re-export the interface of an external dependency, especially if it relies on a hyper-modularized toolchain of dependencies.

While not quite "hyper," the Composable Architecture has 4 external dependencies that it re-exports:

https://github.com/pointfreeco/swift-composable-architecture/blob/main/Sources/ComposableArchitecture/Internal/Exports.swift#L1-L4

These dependencies are useful on their own, and they are documented on their own, but they also are required by the core library often enough that we feel it is unfair to push this burden of imports onto library users.

Duplicating their interfaces and documentation across multiple modules is confusing and wasteful in this instance, and creates a lot of work for us to hide all these symbols somehow.

I can see an argument for aggregating the documentation of internal modules that are re-exported (e.g., in Vapor), but external modules should probably be on the chopping block.

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

I expect symbols from external dependencies that are @_exported imports to be omitted from my package's documentation.

Actual behavior

All symbols are present.

Steps To Reproduce

  1. Clone https://github.com/pointfreeco/swift-composable-architecture
  2. Check out a stable commit (d98e555d0e6559f1a0dc7d70603800cd33af7a03)
  3. Open in Xcode 14 beta 3
  4. Build documentation
  5. See that symbols from Case Paths and other external libraries are emitted

Swift-DocC Version Information

Xcode 14 beta 3

Swift Compiler Version Information

swift-driver version: 1.60 Apple Swift version 5.7 (swiftlang-5.7.0.120.1 clang-1400.0.28.1)
Target: arm64-apple-macosx12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions