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
It could be interesting if we modeled all property access in Documents through Proxies, that way we could add additional metadata / hooks on lookup.
For example, we could add a deprecated flag to a field which would then issue a console.warn('user.name is deprecated, use user.displayName instead!').
An example of the change to tyranid itself would be something like this...
//...asyncfindOne(...args){// ... normal find logicvarhandler={get: function(target,name){if(nameinthis.def.deprecatedFields){console.warn(`property ${name} is deprecated, use ${this.def.deprecatedFields[name].replacement} instead.`);}returntarget[name];}};returnnewProxy(doc,handler);}//...
The text was updated successfully, but these errors were encountered:
It could be interesting if we modeled all property access in
Document
s through Proxies, that way we could add additional metadata / hooks on lookup.For example, we could add a
deprecated
flag to a field which would then issue aconsole.warn('user.name is deprecated, use user.displayName instead!')
.An example of the change to tyranid itself would be something like this...
The text was updated successfully, but these errors were encountered: