Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .changeset/variant-union-dispatch.md

This file was deleted.

10 changes: 10 additions & 0 deletions packages/fetchium/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# fetchium

## 0.5.0

### Minor Changes

- 98cb4e9: Add `t.variant(value)`: a variant tag for union members that share a typename. `t.typename` keeps establishing entity identity (the `[typename, id]` cache key); `t.variant` selects which shape a payload parses as, so one entity type can have multiple shapes discriminated by a separate tag field. Parsing and live-collection event routing dispatch on the variant wherever members share a typename.

Two behavior changes:
- Unions now throw at definition time when two members share a typename without declaring variants, or collide on a `(typename, variant)` pair. Previously the last member silently overwrote the first, so payloads of the other shape failed validation and were dropped from arrays and mutation events.
- Live collections whose entity defs share a typename without variants (possible via `t.liveValue`, which involves no union) previously checked every event against the last def only; events now route to the first def the entity's data satisfies.

## 0.4.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchium/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fetchium",
"version": "0.4.7",
"version": "0.5.0",
"type": "module",
"repository": {
"type": "git",
Expand Down
Loading