You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf+feat(core): memoize derived title field + make nameField canonical (ADR-0079 Phase 2) (#2091)
record-title resolver follow-ups:
1. perf: memoize deriveTitleField per objectDef via a module-level
WeakMap<object, string|undefined>, so a 1000-row list scans
objectDef.fields once instead of 1000x. Behavior byte-identical;
only the field scan is cached, and only for non-null object defs
(split into computeDerivedTitleField + a memoizing wrapper).
2. Phase 2 (conservative): promote objectDef.nameField to the canonical
record-title pointer and de-prioritize the legacy render-only
titleFormat template. New precedence in getRecordDisplayName:
options.titleField -> objectDef.nameField -> displayNameField alias
-> titleFormat (LEGACY, now AFTER the declared field) -> type-aware
derivation -> record name-ish keys -> Record #<id>.
An object that sets nameField resolves via it even with a stale
titleFormat. titleFormat is KEPT for back-compat (not removed);
added an ADR-0079 deprecation note on its branch.
Tests: +nameField-wins-over-stale-titleFormat, titleFormat-only
back-compat, and memoization (same field across calls + no re-scan via
a read-counting Proxy + cached-undefined + cross-objectDef isolation).
record-title suite 66/66 green; @object-ui/core, app-shell, plugin-list
build green.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments