Skip to content

Feature: Factory Presets and Traits #42

Description

@Goldziher

Focused Scope

Add a small presets/traits API for named partial overrides and ordered composition.

Proposed v1

  • Register named presets on a factory.
  • Apply one or more presets during build/batch.
  • Later presets override earlier presets.
  • Explicit build overrides win over presets.
  • Keep the implementation sync-first; async behavior should only be added if it naturally fits buildAsync().

Out of Scope

  • State machines or lifecycle transitions.
  • Discriminated-union specialization.
  • ORM-style association presets.
  • A broad variants framework.

Existing extend(), compose(), kwargs, and hooks already cover many variant use cases; this issue should focus only on the missing named-preset ergonomics.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions