Skip to content

0.1.0-pre.15 — Dim 14 v2 follow-up (MV multi-key + UNION + guards variance)

Pre-release
Pre-release

Choose a tag to compare

@vLannaAi vLannaAi released this 22 May 01:37
54c3d0b

Lockstep release of all 58 `@noy-db/*` packages from `0.1.0-pre.14` → `0.1.0-pre.15`. Routes to npm dist-tag `@next` (this release is marked as a pre-release).

What's in

5 issues closed in PR #167:

  • #166 — Variadic `Query.groupBy(...fields)` with back-compatible single-arg overload. Multi-key buckets via a new `canonicalGroupKey` helper (sorted field names → order-invariant bucket identity). Result rows carry every grouped field in declaration order + reducer outputs. New shared `GroupedQueryBase` abstract eliminates parallel-wrapper drift.
  • #165 — UNION MV via `unionSources: [{ collection, map }, ...]` on `withMaterializedView`. Per-source `map` is the schema-unification boundary; `groupBy: string | string[]` + `aggregate` fields run on the concatenated stream. Composes with multi-key groupBy — the niwat canonical `union(taxReceipts, creditNotes).groupBy('clientId', 'period').sum('vat')` shape ships as a test fixture.
  • #131 — `GuardStrategyHandle` type-variance cleanup via internal `GuardStrategyHandleAny` existential. Removed three `eslint-disable @typescript-eslint/no-explicit-any` annotations from public-API positions.
  • #169 — UNION MV rejects `aggregate` without `groupBy` at registration (niwat review follow-up).
  • #170 — UNION MV rejects `predicates` at registration (per-arm predicate semantics deferred) (niwat review follow-up).

Plus a niwat-review fix on the arm-order hash (`summarizeUnionPlan` now hashes arms in declaration order; `groupBy` fields and `aggregate` keys still sorted — pinned by two regression tests).

Known follow-up (not in pre.15)

`Collection._doDelete` doesn't call `dispatchMaterializedViews`. Source-row deletes never trigger eager MV refresh; tombstoning fires only via a subsequent `put` on the same source or `vault.refreshView()`. Affects all MVs with `onEmpty: 'delete'` (the default), not just UNION. Tombstone test in `union.test.ts` lands in manual-refresh form + `it.todo` at line 333 pins the gap.

Install

```bash
pnpm add @noy-db/hub@next

or

npm install @noy-db/hub@next
```

Verification

  • 1601 hub tests + 1 documented todo
  • Build / lint / typecheck / check-architecture / validate-features all clean
  • Showcases 85 (multi-key groupBy) + 86 (UNION MV) green

Spec: `docs/superpowers/specs/2026-05-22-dim14-mv-multikey-and-union-design.md`
Plan: `docs/superpowers/plans/2026-05-22-dim14-mv-multikey-and-union.md`