Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consider "Sources•Modules" rather than "Sources•Model"Ā #48

@gcox

Description

@gcox

First, šŸ‘thank youšŸ‘ for taking a shot at fixing the problem you're trying to solve! I'm frustrated by the tooling standing in the way of modularizing Swift codebases all day long every day. So, I really hope this tool takes off. šŸŽ‰


I may not be understanding everything (or much at all) so I'll break this up into my assumptions, my use case, and then my suggestion(s)...all based on those assumptions šŸ˜„

Assumptions

  • Everything in "Sources•Model" is compiled against all platforms in the Cakefile
  • Modules are not created for folders in "Sources•App"
  • There is currently no way to limit the platforms a specific module in "Sources•Model" is compiled against
  • The intention is for all platform-specific code to go in "Sources•App"
  • The developer is expected to create each application target (excluding the one the Cake menu app will create for you).

Use case

  • Large project, targeting iOS, macOS, tvOS, and watchOS
  • Non-trivial UI for each platform. Lots of view controllers, lots of "components" (similar to React, small reusable UI bits).

For my situation, micro modules would offer just as much benefit to my application-specific code as my domain/model code. In fact, my UI code would probably benefit even more. That is where I find myself using nested types for the sole purpose of faking namespaces more frequently than anywhere else. Nested types are fine, but I've found that Xcode/SourceKit/Something-else-in-the-tool-chain falls over after a certain depth and all I see is <<error type>> in Xcode's autocomplete dialogs.

Suggestions

  1. Add support for limiting which platforms a specific module is built for. Maybe that takes the form of a Cakefile in a module's directory, or platform-specific "Sources•Modules•[platform]" directories...which could be auto generated using the platforms setting in the root Cakefile. The goal being platform-specific-modules in a multi-platform project.
  2. Rename "Sources•Model" to "Sources•Modules"

To be clear, this is only necessary for a multi-platform project. What I'm wanting to do is already totally doable for a single-platform project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions