Skip to content

v0.18.0 — Computed fields complete: memoisation, error containment, sum/avg(computed)

Latest

Choose a tag to compare

@m-dohmen m-dohmen released this 31 Aug 18:39
· 1 commit to main since this release
34d8a6d

What this release delivers

Completion of the computed field type first shipped in v0.14.0. The formula now runs once per record per render pass instead of on every render, a throwing formula is contained rather than silent, and computed fields stand in for stored number fields in sum/avg metric tiles. The release stage for the underlying OPEN-94 issue was missed when it closed (OPEN-46 pattern), so this release also catches up the change log against code that has been on main since v0.17.0 — the change set is purely additive and backwards-compatible.

Why this version

compute(record) ran on every render in v0.14.0: a 1000-record table with three computed fields paid 3000 function calls per render. v0.18.0 memoises the result on the record (held by a WeakMap, dropped with the record), caps error output to one console warning per unique (entity, field, record id, message) signature, and opens the closed count/sum/avg metric catalogue to computed sources whose formula returns a number. None of this changes a stored payload: computed values were never persisted, and the new behaviour only shows up at render time.

What users see

  • A computed field whose formula throws no longer blanks the table — it renders as a dash and warns once.
  • The portfolio demo's dashboard carries a new "Budget left" tile that aggregates the Budgetabweichung computed field with sum(variance) — visible proof that the closed metric catalogue accepts computed sources.
  • The five short READMEs (zh/es/fr/ja/pt) carry computed fields in their feature lists; the long README.md and README.de.md name the memo, the warning shape and the metric acceptance.
  • plugin/skills/opentoolbox-tool/SKILL.md carries the same computed-field paragraph as AGENTS.md so the skill stays a thin pointer to the canonical documentation.

Change log excerpt (full version in CHANGELOG.md)

Added

  • compute(record) runs once per record per render pass and is memoised on the record for the lifetime of the page (#58).
  • A throwing compute renders the field as a dash and writes exactly one console warning per unique combination of entity, field, record id and error message (#58).
  • A computed field whose compute returns a number stands in for a stored number field in the closed sum(field) / avg(field) metric catalog (#58).
  • AGENTS.md and CLAUDE.md gained a computed section spelling out the memo, the warning key and the metric acceptance; the diff between the two remains byte-identical (#58).
  • README.md and README.de.md rewrite the computed-field paragraph to name the memo, the warning shape and the metric acceptance (#58).
  • The five short READMEs (zh/es/fr/ja/pt) carry computed fields in their feature lists at the same depth as the English README (#61).
  • Portfolio demo's dashboard gains a "Budget left" tile that sums the Budgetabweichung computed field; eleven screenshots under docs/screenshots/ are regenerated to mirror the table with the new column and the dashboard with the new tile (#63).
  • The seven demo build prompts under docs/demos/portfolio/generating_prompt_*.md are refreshed so a reader in de/en/es/fr/ja/pt/zh meets the new metric at the same depth (#63).
  • plugin/skills/opentoolbox-tool/SKILL.md carries the same computed-field paragraph as AGENTS.md (#58).
  • test/smoke.mjs adds the memo, warning, metric-acceptance, sum/avg and 1000-record cases (#58).

Live demo

The published demos at https://m-dohmen.github.io/openToolbox/demos/ render the new behaviour:

Consciously not in this version

  • No computed-of-computed chains by reactive subscription. A computed field may read stored fields and other computed fields by name, but the memo invalidates on record identity, not on dependency tracking.
  • No persistent cache. Computed values are still never written to the data block; saving the file is byte-identical to the saved state of a schema without computed fields.
  • No new metric kind. The catalogue stays closed at count, sum, avg; sum/avg only opened up to computed-returning-number sources, which is the same gating the stored-field forms already had.

Upgrade notes

Nothing required. Schemas that already declared type: 'computed' in v0.14.0 inherit the memoisation and the warning behaviour transparently. Schemas that already used sum(field) / avg(field) in their metric catalog may now point at a computed field whose formula returns a number.

PRs in this release: #58 (code, docs, tests), #61 (short READMEs), #63 (demo + screenshots + prompts).