Skip to content

Provide a way to generate files that only import FoundationEssentials and conditionalize all Foundation imports #1756

@FranzBusch

Description

@FranzBusch

FoundationEssentials allows to import just a small subset of Foundation on non-Darwin platforms. This has a great impact on binary size. The current recommended way to do this is this pattern:

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

We need to update our generator to support this and audit all of our current Foundation imports. As a first step it would be good to understand if we rely on anything from Foundation that is not in FoundationEssentials.

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