Update base objects to use static and merge for configurable attributes.
Review Request #12909 — Created March 22, 2023 and submitted
Starting in Spina 2,
configurable attributes are now defined as
static, allowing them to be
accessed outside of instances. This is important for subclasses.
These make use of the new
prototypeAttrsoption, which ensures they'll
be accessible on the prototype, allowing Backbone to behave as normal
and for instances to continue accessing using
Types for both the
staticand instance/prototype versions are set on
these base classes. Since
staticis incompatible with generics, we use
the most base type for these there, but the ones on the prototype are
typed as expected. Subclasses may still define types for their versions.
Some attributes (
defaults) are also set
up to auto-merge between parents/subclasses. This means that subclasses
no longer have to manually call
_.extends, passing in
the parent class's attribute (but at the same time, it won't hurt if
they still do). This will keep things more maintainable going forward.
Porting existing code in Review Board to set the appropriate attributes
static, and verified that instances and subclasses could properly
access and extend these.