I recently made some changes to low-level property behavior that could potentially be a breaking change for you (but probably not).
- Property.prototype._setter, Property.prototype._getter, and Property.prototype.init have been removed. These functions should not have been called directly outside of the framework, so if you were calling them you'll need to evaluate the reason for doing so.
- Removed obsolete isInited and wasInited event argument properties in property get and change events.
- Property init is now only called in two situations: 1) when initializing data for existing instances, and 2) when lazily assigning a default value for properties when accessed or setting the property value. All other scenarios where a value is being assigned are seen as a true property set.
- Throw an error if a setter is called on a ghosted instance or if a non-loaded array property is modified by client code or rules.
Now, for some background...
From the beginning ExoWeb has had a concept of property-level initialization. If you're ever written a client-side calculation and specified "init of" as one of the basedOn paths, then you've taken advantage of property-level initialization (this would have theoretically allowed for property-level loading if we chose to go down that path). In the majority of cases this behavior could be substituted for a type-level init event. For example, if you're calculating an initial value for a client-origin property based on "init of" a server-origin property, then you could just as easily calculate the value when the instance was fully initialized. In fact in some cases it may be more efficient to do so. Also, the concept of property init developed into a strange and confusion combination of "the property is assigned an initial value" and "the instance is being loaded". It isn't easy to reason about whether "change" or "init" events are appropriate for various combinations of new or existing instances, client- or server-origin properties, and list or non-list property types. ...and if "init" is taken to be synonymous with loading, then "init of this.Person" is somewhat ambiguous. Ok, so that's a bit of a stretch, but the point is that the concept tends to cause confusion. With the client-side rules refactor that Jamie recently completed, the client-side rules API now more closely matches the server-side rules API. This means that you write rules to respond to property change, instance init (new and/or existing), and a property rule can also be run when accessed (i.e. property get rules). This required doing away with the property-level init concept (at least in terms of the public API) and instead using type-level events. Hopefully this makes things easier and more consistent.
Also as a result, "Property.addChanged" and "Property.addGet" event handlers no longer include the concept of "wasInited" and "isInited", respectively. This is because, in addition to the fact that the property-level init concept no longer exists (in its original form), properties were always inited when a change event handler is fired, and they are always inited when the get event is fired. From what I could tell the "wasInited" flag was only ever used to ensure that change event logic only responded to an actual property change. I apologize wholeheartedly for that headache.
Since init is only ever called when loading data from the server or when assigning a default initial value, this means that you can be certain that calling set_Property (or Property.value, or Entity.set) will always raise property-level change events and it will always result in recording a change event in the change log...or an error.
Which brings us to the last point. As a part of Jamie's rule refactor he changed property getters to raise an error if you access the property for a ghosted (non-loaded) instance. This tended to result in hard-to-track-down errors, so we thought it was best to catch it as early as possible. Along those same lines, setting a property or modifying a list that is not loaded now results in an error as well.
Let me know if you see any problems with these changes or have any questions.