Latest Results
Bound replaced-default history and cache the mangled-name prefixes
Address the review round on the class-assignment fixes.
Field._assign_default kept every replaced default for patch/restore, so
a state that reassigns a class default at runtime grew the list without
bound. The history is now a deque of at most _MAX_REPLACED_DEFAULTS (16)
entries, dropping the oldest: undoing still unwinds nested patches, and
repeated plain assignments stay bounded. The attribute name is one
constant, _REPLACED_DEFAULTS_ATTR, used by _RESERVED_FIELD_ATTRS,
_assign_default and _restore_default. ComponentState.create already
copies fields per generated class without their history; a unit test
now pins that.
Fix a dev-mode performance regression from the mangled-name guard:
_is_plain_private_name rebuilt the prefix of every class in the MRO on
each call, so the first write of each name on a fresh state class cost
about 2.5 us instead of about 60 ns, and test_state_tree_delta ran
24-29% slower on CodSpeed. Names without a double underscore now return
at once, and the prefixes are cached per class with _cache_per_class
(class names are fixed once __init_subclass__ renames local states).
The base vars docs no longer claim that a declared default_factory
producing browser storage keeps its storage options on a plain string
assignment; it does not. The browser test now also covers SessionStorage:
the value is stored under its configured name, survives a same-tab
reload, and a new tab starts from the assigned default.
Refs #7471 #7472
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjCrbdguMkfe4bhbaREiwo Latest Branches
+4%
claude/docs-0.10-migration +10%
claude/n004-pickle-compat +16%
© 2026 CodSpeed Technology