Skip to content

W-040: ecs-prefab overrides (PREFAB-F03)

Type: feature · Size: S · Epic: E-prefab-v0 · Target: packages/ecs-prefab · Breaking: no Depends: W-039 Refs: spec PREFAB-030..PREFAB-036

Goal

Add the overrides argument of instantiate. SoA overrides merge over the prefab value, AoS overrides replace the whole value without cloning, and overriding Prefab or IsExcluded throws. Overrides never change the prefab or other instances.

Steps

  • S1 (PREFAB-030, PREFAB-031, PREFAB-032): a partial SoA override keeps the prefab's other fields; a bare trait keeps the copied value and a bare tag is a no-op; an override for a trait the chain lacks is added with add semantics; files: packages/ecs-prefab/src/overrides.ts, packages/ecs-prefab/tests/instantiate-overrides.test.ts
  • S2 (PREFAB-033, PREFAB-034, PREFAB-035, PREFAB-036): overrides do not change the prefab or other instances; an AoS override replaces the value uncloned; Prefab or IsExcluded in overrides throws naming instantiate and suggesting createPrefab, with no entity created; an onAdd observer sees the overridden value; files: packages/ecs-prefab/src/overrides.ts, packages/ecs-prefab/tests/instantiate-overrides-rules.test.ts
  • S3 (changeset): add .changeset/w-040-ecs-prefab-overrides.md (patch, @workspace/ecs-prefab)

Log

  • 2026-11-01 created from the approved spec split of W-005 (Triage)
  • 2026-11-01 held: waits on the OQ6 decision after the W-039 S1 spike (decision logged in W-039 first) (Triage)