Skip to content

Reduce broad runtime re-exports in generated service packages #22

@CaliLuke

Description

@CaliLuke

Generated service packages can re-export a large set of common runtime declarations from the Loom runtime package. When this happens, each generated package becomes partly a tunnel for shared framework API instead of containing only service-specific generated API.

Generic example:

package orders

type Endpoint = loom.Endpoint
type Middleware = loom.Middleware
type ServerOption = loom.ServerOption
// ... many more common runtime aliases

type Service interface {
    ListOrders(...) (...)
}

This creates avoidable namespace noise and makes generated package docs harder to scan because service-specific types are mixed with many framework-level aliases.

Requested improvement:

Prefer importing framework runtime types directly where needed, or centralize common aliases in one generated support package instead of repeating broad re-export sets in every generated service package.

Acceptance criteria:

  • Generated service packages primarily expose service-specific contracts and wire types.
  • Common Loom runtime declarations are not broadly re-exported from every generated package.
  • Existing code can still access runtime concepts through an explicit framework import or a single stable generated support package.
  • The generated output remains deterministic and gofmt/go vet clean.

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