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
Looking at the code, it is used to call SharedObject.bindToContext()
I see two problems with that:
there is nothing unique about SharedObject. I can build another base class for another set of DDSs and it should work exactly the same way.
I think the actual check and actions are wrong, because we moved to using handles and objects themselves should never be stored in DDSs. Some code actually correctly validates that:
publicset(value: Serializable<T>){if(SharedObject.is(value)){thrownewError("SharedObject sets are no longer supported. Instead set the SharedObject handle.");}
@scarlettjlee, Is this something you can help cleaning in January? @DLehenbauer - can you please glance at usage and confirm / deny my observations?
If we remove these checks completely, is there anything else we can do to help developers realize they are making mistake by putting some complex (non-serializable) object into DDS? I think @tylerbutler run into it or was passionate about it, so tagging you here too - the more the merrier :)
I agree that we can remove this code. It was an aid to help users transition when we introduced IFluidHandle.
The call to 'bindToContext()' was likely to allow old documents to load, but I think this is predating the 'Fluid Preview' app and ODSP.
In TypeScript, I'm pretty happy with the defense we get from the new improved `Serializable'.
If we want to add runtime checks for ES6 users, I'd suggest mixing these into the existing recursive descent we do during serialization to encode handles to minimize the runtime impact.
However, ES6 users live in an unsafe world, so these sorts of runtime checks have diminishing returns.
Looking at the code, it is used to call SharedObject.bindToContext()
I see two problems with that:
But most of the code seems to be wrong:
The text was updated successfully, but these errors were encountered: