-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CT Designed API changes detected, please roll them back or revise the reference API: #161
Comments
@zepumph and I discussed this with @jonathanolson and we have a workaround for phetioAPICompare that will work ok for RC. For a longer-term solution, we may need to introduce a new PhetioObject metadata key that can be used like this: Subject: [PATCH] Add UI sounds and projector mode, see https://github.com/phetsims/keplers-laws/issues/7
---
Index: js/phetioEngine.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/phetioEngine.ts b/js/phetioEngine.ts
--- a/js/phetioEngine.ts (revision 6fe38d98385e545e436f95ee2669e96047865ca8)
+++ b/js/phetioEngine.ts (date 1681924320674)
@@ -552,13 +552,15 @@
level[ Tandem.METADATA_KEY ] = {} as PhetioObjectMetadata;
const metadataObject = level[ Tandem.METADATA_KEY ];
- const dataDefaults = phetioObject.phetioType.getAllDataDefaults();
- const initialState = this.phetioStateEngine.getStateForObject( phetioID );
- assert && assert( dataDefaults.hasOwnProperty( 'initialState' ), 'initialState expected to have a default on the IOType' );
- if ( dataDefaults.initialState !== initialState && metadata.phetioState ) {
- level[ Tandem.DATA_KEY ] = {
- initialState: initialState
- };
+ if ( metadata.phetioDesignedInitialState ) {
+ const dataDefaults = phetioObject.phetioType.getAllDataDefaults();
+ const initialState = this.phetioStateEngine.getStateForObject( phetioID );
+ assert && assert( dataDefaults.hasOwnProperty( 'initialState' ), 'initialState expected to have a default on the IOType' );
+ if ( dataDefaults.initialState !== initialState && metadata.phetioState ) {
+ level[ Tandem.DATA_KEY ] = {
+ initialState: initialState
+ };
+ }
}
Object.keys( metadata ).forEach( key => {
Adding a metadata key is not trivial, so I don't know if it should be done for this RC or not. Also, we try to minimize those keys since we have a lot of PhetioObjects and don't want too much memory burden. |
Should be handled with the above workaround. |
This should be fixed generally by https://github.com/phetsims/phet-io/issues/1951 |
Seems like the solution here is to create an html page with the sim in an iframe with a constant size. This can be used for api-comparison AND for generation. This would make the screen size constant across all modes. |
We punted on this for now, because it wouldn't be a general enough fix. |
I'd like to do some investigation about this for Buoyancy because we will have to add to this workaround. If we lock in api-generation browser dimensions like mentioned in phetsims/aqua#200 that may help remove this workaround. |
I'm going to close this issue and we can work on a general solution over in https://github.com/phetsims/phet-io/issues/1951. @samreid and I made some good progress on how to keep "pure values" out of the API (and thus out of api comparison testing). This CT error is closed, and a workaround will be in place until a general solution is done. |
The text was updated successfully, but these errors were encountered: