Closed zepumph closed 3 years ago
I got totally stuck here with circular dependencies.
We need IOType from PhetioObject (like when we create ObjectIO), but IOType needs to know about the base supertype, which is PhetioObject.ObjectIO. I tried to use phet.tandem.PhetioObject.ObjectIO
, but not all IOTypes are used by PhetioObjects, like FunctionIO and EnumerationIO. I thought I could get around this in a hacky way by just importing PhetioObject manually by those types, but that is a race condition in imports. I don't know how to proceed here, which means I also feel totally blocked on the conversion to metadataDefaults over in https://github.com/phetsims/phet-io/issues/1753.
Here is my patch so far, if I make any commits over in https://github.com/phetsims/phet-io/issues/1753 though it likely won't apply nicely.
Here's a patch that moves out the defaults for reuse in PhetioObject and IOType:
The above is not ideal, but we think it will work better than other ideas:
We will continue with the above patch, to be applied over in https://github.com/phetsims/phet-io/issues/1753, closing
This will help with https://github.com/phetsims/phet-io/issues/1753, and also just makes sense in general. Tagging @samreid.