phetsims / axon

Axon provides powerful and concise models for interactive simulations, based on observable Properties and related patterns.
MIT License
11 stars 8 forks source link

Replace phetioType with phetioValueType #260

Closed chrisklus closed 1 year ago

chrisklus commented 5 years ago

@zepumph, @samreid, and @chrisklus think it would be nice to replace phetioType with phetioValueType for Properties. This would eliminate the use of PropertyIO all over in sim code, since it would be part of the default options. From GQModel.js (note: redundant valueType has been deleted for clarity).

this.savedQuadraticProperty = new Property( null, {
  tandem: tandem.createTandem( 'savedQuadraticProperty' ),
  phetioDocumentation: 'the saved quadratic, null if there is no saved quadratic',
  phetioType: PropertyIO( NullableIO( QuadraticIO ) )
} );

would become:

this.savedQuadraticProperty = new Property( null, {
  tandem: tandem.createTandem( 'savedQuadraticProperty' ),
  phetioDocumentation: 'the saved quadratic, null if there is no saved quadratic',
  phetioValueType: NullableIO( QuadraticIO )
} );

This would be a minor change, but we feel that it should be done soon. @pixelzoom what do you think?

pixelzoom commented 5 years ago

GREAT suggestion. There is currently a semantic mismatch between valueType and phetioType. So when converting from valueType to phetioType, I'm constantly forgetting to add the PropertyIO or DerivedPropertyIO wrapper. And it always feels like I'm adding redundant info that could be added by Property and DerivedProperty respectively. Based on decisions in https://github.com/phetsims/axon/issues/235, replacing valueType with phetioType is the new "standard", so anything that we can do to make that easier is a "win".

samreid commented 5 years ago

DerivedProperty may also need to provide the equivalent of outerTypeIO or some other way to indicate that its supertype Property should not create PropertyIO.

zepumph commented 5 years ago

I can take this one on.

zepumph commented 4 years ago

DerivedProperty may also need to provide the equivalent of outerTypeIO or some other way to indicate that its supertype Property should not create PropertyIO.

Yes this is the same thing we are doing for Emitter/Action, and it works well there.

zepumph commented 4 years ago
zepumph commented 2 years ago

You can find all the "outer types" by case insensitive search here: new IOType.*Property. There are currently 5:


DerivedProperty.ts
NumberProperty.ts
Property.ts
InterpolatedProperty.ts
RewindableProperty.ts
zepumph commented 2 years ago

We hit this today over in https://github.com/phetsims/studio/issues/253#issuecomment-1101754581. It would be nice to solve this at some point soon. @samreid and I both don't really seem to have the bandwidth, but I'll co-assign him just in case.

samreid commented 2 years ago

Working copy patch:

```diff Index: main/scenery-phet/js/buttons/PlayPauseStepButtonGroup.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery-phet/js/buttons/PlayPauseStepButtonGroup.ts b/main/scenery-phet/js/buttons/PlayPauseStepButtonGroup.ts --- a/main/scenery-phet/js/buttons/PlayPauseStepButtonGroup.ts (revision 2b767eaed6f1f531c19f1774685f2f811dd87792) +++ b/main/scenery-phet/js/buttons/PlayPauseStepButtonGroup.ts (date 1660062824153) @@ -105,7 +105,7 @@ if ( ( !options.stepForwardButtonOptions.enabledProperty ) || ( !options.stepBackwardButtonOptions.enabledProperty ) ) { const defaultEnabledProperty = DerivedProperty.not( isPlayingProperty, { tandem: options.tandem.createTandem( 'enabledProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); if ( !options.stepForwardButtonOptions.enabledProperty ) { Index: main/scenery/js/accessibility/FocusManager.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery/js/accessibility/FocusManager.ts b/main/scenery/js/accessibility/FocusManager.ts --- a/main/scenery/js/accessibility/FocusManager.ts (revision c57d3eab591cdc437f8f96dcda11ff7024cc88d8) +++ b/main/scenery/js/accessibility/FocusManager.ts (date 1660063218361) @@ -215,7 +215,7 @@ phetioDocumentation: 'Stores the current focus in the Parallel DOM, null if nothing has focus. This is not updated ' + 'based on mouse or touch input, only keyboard and other alternative inputs. Note that this only ' + 'applies to simulations that support alternative input.', - phetioType: Property.PropertyIO( NullableIO( Focus.FocusIO ) ), + phetioValueType: NullableIO( Focus.FocusIO ) , phetioState: false, phetioFeatured: true, phetioReadOnly: true Index: main/ratio-and-proportion/js/common/view/RAPMediaPipe.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/ratio-and-proportion/js/common/view/RAPMediaPipe.ts b/main/ratio-and-proportion/js/common/view/RAPMediaPipe.ts --- a/main/ratio-and-proportion/js/common/view/RAPMediaPipe.ts (revision 98b85ed6d5ce92ad4bee7d7959b3b199b7506e2e) +++ b/main/ratio-and-proportion/js/common/view/RAPMediaPipe.ts (date 1660062824140) @@ -122,7 +122,7 @@ return antecedentStationary && consequentStationary && !oHandGesturePresent; }, { tandem: options.tandem.createTandem( 'handsStationaryProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); this.isBeingInteractedWithProperty.lazyLink( interactedWith => { Index: main/circuit-construction-kit-common/js/model/Circuit.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/Circuit.ts b/main/circuit-construction-kit-common/js/model/Circuit.ts --- a/main/circuit-construction-kit-common/js/model/Circuit.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/Circuit.ts (date 1660063120021) @@ -294,7 +294,7 @@ this.selectedCircuitElementProperty = new Property( null, { tandem: tandem.createTandem( 'selectedCircuitElementProperty' ), - phetioType: Property.PropertyIO( NullableIO( ReferenceIO( CircuitElement.CircuitElementIO ) ) ) + phetioValueType: NullableIO( ReferenceIO( CircuitElement.CircuitElementIO ) ) } ); this.selectedCircuitElementProperty.link( selectedCircuitElement => { Index: main/circuit-construction-kit-common/js/model/Voltmeter.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/Voltmeter.ts b/main/circuit-construction-kit-common/js/model/Voltmeter.ts --- a/main/circuit-construction-kit-common/js/model/Voltmeter.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/Voltmeter.ts (date 1660063119992) @@ -33,7 +33,7 @@ this.voltageProperty = new Property( null, { tandem: tandem.createTandem( 'voltageProperty' ), units: 'V', - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ) + phetioValueType: NullableIO( NumberIO ) } ); this.redProbePositionProperty = new Vector2Property( Vector2.ZERO, { Index: main/circuit-construction-kit-common/js/model/CircuitElement.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/CircuitElement.ts b/main/circuit-construction-kit-common/js/model/CircuitElement.ts --- a/main/circuit-construction-kit-common/js/model/CircuitElement.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/CircuitElement.ts (date 1660063119937) @@ -150,13 +150,13 @@ this.isSizeChangedOnViewChange = options.isSizeChangedOnViewChange; this.startVertexProperty = new Property( startVertex, { - phetioType: Property.PropertyIO( Vertex.VertexIO ), + phetioValueType: Vertex.VertexIO, tandem: tandem.createTandem( 'startVertexProperty' ), phetioState: false } ); this.endVertexProperty = new Property( endVertex, { - phetioType: Property.PropertyIO( Vertex.VertexIO ), + phetioValueType: Vertex.VertexIO, tandem: tandem.createTandem( 'endVertexProperty' ), phetioState: false } ); Index: main/models-of-the-hydrogen-atom/js/common/view/MonochromaticControls.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/MonochromaticControls.ts b/main/models-of-the-hydrogen-atom/js/common/view/MonochromaticControls.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/MonochromaticControls.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/MonochromaticControls.ts (date 1660062824143) @@ -40,7 +40,7 @@ // Visible when light mode is 'monochromatic' visibleProperty: new DerivedProperty( [ lightModeProperty ], lightMode => ( lightMode === 'monochromatic' ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), align: 'center', spacing: 10, Index: main/dot/js/Vector2Property.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/dot/js/Vector2Property.ts b/main/dot/js/Vector2Property.ts --- a/main/dot/js/Vector2Property.ts (revision feb0d6b7a5ab8dd046d70ed42c5d5a2096a6e3b4) +++ b/main/dot/js/Vector2Property.ts (date 1660064074780) @@ -17,7 +17,7 @@ validBounds?: Bounds2 | null; }; -type Vector2PropertyOptions = SelfOptions & StrictOmit, 'phetioType' | 'valueType'>; +type Vector2PropertyOptions = SelfOptions & StrictOmit, 'phetioValueType' | 'valueType'>; class Vector2Property extends Property { public readonly validBounds: Bounds2 | null; @@ -34,7 +34,7 @@ validators: [], // phet-io - phetioType: Property.PropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO }, providedOptions ); options.validBounds && options.validators.push( { Index: main/phet-io/js/phetioEngine.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/phet-io/js/phetioEngine.ts b/main/phet-io/js/phetioEngine.ts --- a/main/phet-io/js/phetioEngine.ts (revision 398d8ee2a9f0a52238f85b6a5825dd09865388d0) +++ b/main/phet-io/js/phetioEngine.ts (date 1660063218478) @@ -225,7 +225,7 @@ tandem: phetioEngineTandem.createTandem( 'phetioElementMouseOverProperty' ), phetioHighFrequency: true, phetioDocumentation: 'The phetioID of the PhET-iO Element the mouse is over, or null. For internal usage only.', - phetioType: Property.PropertyIO( NullableIO( StringIO ) ), + phetioValueType: NullableIO( StringIO ), phetioReadOnly: true } ); Index: main/density-buoyancy-common/js/buoyancy/model/Bottle.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/buoyancy/model/Bottle.ts b/main/density-buoyancy-common/js/buoyancy/model/Bottle.ts --- a/main/density-buoyancy-common/js/buoyancy/model/Bottle.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/buoyancy/model/Bottle.ts (date 1660063120123) @@ -213,7 +213,7 @@ valueType: Material, reentrant: true, tandem: config.tandem.createTandem( 'interiorMaterialProperty' ), - phetioType: Property.PropertyIO( Material.MaterialIO ) + phetioValueType: Material.MaterialIO } ); this.interiorVolumeProperty = new NumberProperty( BOTTLE_INITIAL_INTERIOR_VOLUME, { Index: main/models-of-the-hydrogen-atom/js/common/view/ViewSnapshotsButton.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/ViewSnapshotsButton.ts b/main/models-of-the-hydrogen-atom/js/common/view/ViewSnapshotsButton.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/ViewSnapshotsButton.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/ViewSnapshotsButton.ts (date 1660062824155) @@ -37,7 +37,7 @@ // Visible when we have snapshots visibleProperty: new DerivedProperty( [ numberOfSnapshotsProperty ], n => ( n > 0 ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ) }, providedOptions ) ); } Index: main/scenery/js/util/ColorProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery/js/util/ColorProperty.ts b/main/scenery/js/util/ColorProperty.ts --- a/main/scenery/js/util/ColorProperty.ts (revision c57d3eab591cdc437f8f96dcda11ff7024cc88d8) +++ b/main/scenery/js/util/ColorProperty.ts (date 1660063218453) @@ -20,7 +20,7 @@ const options = optionize, EmptySelfOptions, PropertyOptions>()( { valueType: Color, - phetioType: Property.PropertyIO( Color.ColorIO ) + phetioValueType: Color.ColorIO }, providedOptions ); super( color, options ); } Index: main/ratio-and-proportion/js/common/model/RAPModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/ratio-and-proportion/js/common/model/RAPModel.ts b/main/ratio-and-proportion/js/common/model/RAPModel.ts --- a/main/ratio-and-proportion/js/common/model/RAPModel.ts (revision 98b85ed6d5ce92ad4bee7d7959b3b199b7506e2e) +++ b/main/ratio-and-proportion/js/common/model/RAPModel.ts (date 1660062824124) @@ -119,7 +119,7 @@ tandem: tandem.createTandem( 'unclampedFitnessProperty' ), phetioDocumentation: 'A number stating how "correct" the current ratio is to the target. The max is 1, and min is ' + 'based on what the target ratio is', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.ratioFitnessProperty = new DerivedProperty( [ this.unclampedFitnessProperty ], @@ -132,7 +132,7 @@ this.ratio.movingInDirectionProperty ], this.inProportion.bind( this ), { tandem: tandem.createTandem( 'inProportionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); // This must be done here, because of the reentrant nature of how fitness changes when the ratio is locked Index: main/ratio-and-proportion/js/common/model/RAPRatio.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/ratio-and-proportion/js/common/model/RAPRatio.ts b/main/ratio-and-proportion/js/common/model/RAPRatio.ts --- a/main/ratio-and-proportion/js/common/model/RAPRatio.ts (revision 98b85ed6d5ce92ad4bee7d7959b3b199b7506e2e) +++ b/main/ratio-and-proportion/js/common/model/RAPRatio.ts (date 1660063218448) @@ -65,7 +65,7 @@ this._enabledRatioTermsRangeProperty = new Property( DEFAULT_TERM_VALUE_RANGE, { tandem: tandem.createTandem( 'enabledRatioTermsRangeProperty' ), - phetioType: Property.PropertyIO( Range.RangeIO ) + phetioValueType: Range.RangeIO } ); this.enabledRatioTermsRangeProperty = this._enabledRatioTermsRangeProperty; @@ -76,7 +76,7 @@ // phet-io tandem: tandem.createTandem( 'tupleProperty' ), - phetioType: Property.PropertyIO( RAPRatioTuple.RAPRatioTupleIO ) + phetioValueType: RAPRatioTuple.RAPRatioTupleIO } ); this.lockedProperty = new BooleanProperty( false, { tandem: tandem.createTandem( 'lockedProperty' ) } ); @@ -101,7 +101,7 @@ return bothMoving && movingInSameDirection && ( movingFastEnough || ratioLocked ); }, { tandem: tandem.createTandem( 'movingInDirectionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); this.ratioLockListenerEnabled = true; Index: main/gravity-and-orbits/js/common/model/Pair.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/gravity-and-orbits/js/common/model/Pair.ts b/main/gravity-and-orbits/js/common/model/Pair.ts --- a/main/gravity-and-orbits/js/common/model/Pair.ts (revision cddab12586b0833c9f3932eb0d13b0e994e32413) +++ b/main/gravity-and-orbits/js/common/model/Pair.ts (date 1660062794645) @@ -29,7 +29,7 @@ this.body2.positionProperty ], ( body1Position, body2Position ) => body2Position.distance( body1Position ), { tandem: tandem.createTandem( 'distanceProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioHighFrequency: true, units: 'm' } ); Index: main/bending-light/js/intro/model/IntroModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/bending-light/js/intro/model/IntroModel.ts b/main/bending-light/js/intro/model/IntroModel.ts --- a/main/bending-light/js/intro/model/IntroModel.ts (revision 4aac42394824bb685df461c78ca3357cb6601c78) +++ b/main/bending-light/js/intro/model/IntroModel.ts (date 1660063119877) @@ -63,7 +63,7 @@ this.topMediumProperty = new Property( topMedium, { reentrant: true, tandem: tandem.createTandem( 'topMediumProperty' ), - phetioType: Property.PropertyIO( Medium.MediumIO ) + phetioValueType: Medium.MediumIO } ); // Bottom medium @@ -72,7 +72,7 @@ this.bottomMediumProperty = new Property( bottomMedium, { reentrant: true, tandem: tandem.createTandem( 'bottomMediumProperty' ), - phetioType: Property.PropertyIO( Medium.MediumIO ) + phetioValueType: Medium.MediumIO } ); this.time = 0; @@ -84,7 +84,7 @@ ], ( topMedium, color ) => topMedium.getIndexOfRefraction( color.wavelength ), { tandem: tandem.createTandem( 'indexOfRefractionOfTopMediumProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // Update the bottom medium index of refraction when bottom medium change @@ -95,7 +95,7 @@ ], ( bottomMedium, color ) => bottomMedium.getIndexOfRefraction( color.wavelength ), { tandem: tandem.createTandem( 'indexOfRefractionOfBottomMediumProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // (read-only)-model components Index: main/gravity-and-orbits/js/common/model/GravityAndOrbitsModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/gravity-and-orbits/js/common/model/GravityAndOrbitsModel.ts b/main/gravity-and-orbits/js/common/model/GravityAndOrbitsModel.ts --- a/main/gravity-and-orbits/js/common/model/GravityAndOrbitsModel.ts (revision cddab12586b0833c9f3932eb0d13b0e994e32413) +++ b/main/gravity-and-orbits/js/common/model/GravityAndOrbitsModel.ts (date 1660063120248) @@ -85,7 +85,7 @@ this.sceneProperty = new Property( this.sceneList.scenes[ 0 ], { tandem: tandem.createTandem( 'sceneProperty' ), validValues: this.sceneList.scenes, - phetioType: Property.PropertyIO( ReferenceIO( IOType.ObjectIO ) ) + phetioValueType: ReferenceIO( IOType.ObjectIO ) } ); } Index: main/scenery/js/nodes/Node.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery/js/nodes/Node.ts b/main/scenery/js/nodes/Node.ts --- a/main/scenery/js/nodes/Node.ts (revision c57d3eab591cdc437f8f96dcda11ff7024cc88d8) +++ b/main/scenery/js/nodes/Node.ts (date 1660063218433) @@ -6386,7 +6386,7 @@ // by default, use the value from the Node phetioReadOnly: this.phetioReadOnly, tandem: this.tandem.createTandem( INPUT_ENABLED_PROPERTY_TANDEM_NAME ), - phetioType: Property.PropertyIO( BooleanIO ), + phetioValueType: BooleanIO, phetioFeatured: true, // Since this property is opt-in, we typically only opt-in when it should be featured phetioDocumentation: 'Sets whether the element will have input enabled, and hence be interactive.' }, config.inputEnabledPropertyOptions ) ) Index: main/tandem/js/types/OrIO.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/tandem/js/types/OrIO.ts b/main/tandem/js/types/OrIO.ts --- a/main/tandem/js/types/OrIO.ts (revision 408b75abb82a3eb4c3b26c2d0b7ac2c08fca50c3) +++ b/main/tandem/js/types/OrIO.ts (date 1660063218457) @@ -8,7 +8,7 @@ * * window.numberOrStringProperty = new Property( 'I am currently a string', { tandem: Tandem.GENERAL_MODEL.createTandem( 'numberOrStringProperty' ), - phetioType: Property.PropertyIO( OrIO( [ StringIO, NumberIO ] ) ) + phetioValueType: OrIO( [ StringIO, NumberIO ] ) } ); * * @author Michael Kauzmann (PhET Interactive Simulations) Index: main/axon/js/ReadOnlyProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/ReadOnlyProperty.ts b/main/axon/js/ReadOnlyProperty.ts --- a/main/axon/js/ReadOnlyProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/ReadOnlyProperty.ts (date 1660064142906) @@ -25,6 +25,7 @@ import Validation, { Validator } from './Validation.js'; import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js'; import Property from './Property.js'; +import StrictOmit from '../../phet-core/js/types/StrictOmit.js'; // constants const VALIDATE_OPTIONS_FALSE = { validateValidator: false }; @@ -33,7 +34,7 @@ let globalId = 0; // auto-incremented for unique IDs // Options defined by Property -type SelfOptions = { +type SelfOptions = { // useDeepEquality: true => Use the `equals` method on the values // useDeepEquality: false => Use === for equality test @@ -47,10 +48,13 @@ // faulty logic, etc. This may be of particular interest for PhET-iO instrumentation, where such // cycles may pollute the data stream. See https://github.com/phetsims/axon/issues/179 reentrant?: boolean; + + phetioValueType?: IOType; + phetioOuterType?: ( parameterType: IOType ) => IOType; }; // Options that can be passed in -export type PropertyOptions = SelfOptions & Validator & PhetioObjectOptions; +export type PropertyOptions = SelfOptions & StrictOmit & PhetioObjectOptions, 'phetioType'>; export type LinkOptions = { phetioDependencies?: Array>; @@ -101,14 +105,16 @@ * @param [providedOptions] */ protected constructor( value: T, providedOptions?: PropertyOptions ) { - const options = optionize, SelfOptions, PhetioObjectOptions>()( { + const options = optionize, SelfOptions, PhetioObjectOptions>()( { useDeepEquality: false, units: null, reentrant: false, // phet-io - tandem: Tandem.OPTIONAL + tandem: Tandem.OPTIONAL, + phetioOuterType: Property.PropertyIO, + phetioValueType: IOType.ObjectIO }, providedOptions ); // Support non-validated Property Index: main/models-of-the-hydrogen-atom/js/common/model/ClassicalSolarSystemModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/model/ClassicalSolarSystemModel.ts b/main/models-of-the-hydrogen-atom/js/common/model/ClassicalSolarSystemModel.ts --- a/main/models-of-the-hydrogen-atom/js/common/model/ClassicalSolarSystemModel.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/model/ClassicalSolarSystemModel.ts (date 1660063119955) @@ -108,7 +108,7 @@ [ this.electronDistanceProperty, this.electronAngleProperty ], ( distance, angle ) => MOTHAUtils.polarToCartesian( distance, angle ), { tandem: options.tandem.createTandem( 'electronOffsetProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO } ); this.electronOffsetProperty.link( electronOffset => { @@ -123,7 +123,7 @@ this.isDestroyedProperty = new DerivedProperty( [ this.electronDistanceProperty ], electronDistance => ( electronDistance === 0 ), { tandem: options.tandem.createTandem( 'isDestroyedProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); } Index: main/axon/js/StringEnumerationProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/StringEnumerationProperty.ts b/main/axon/js/StringEnumerationProperty.ts --- a/main/axon/js/StringEnumerationProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/StringEnumerationProperty.ts (date 1660064074787) @@ -13,14 +13,14 @@ import PickRequired from '../../phet-core/js/types/PickRequired.js'; import StrictOmit from '../../phet-core/js/types/StrictOmit.js'; -type StringEnumerationPropertyOptions = StrictOmit, 'phetioType'> & +type StringEnumerationPropertyOptions = StrictOmit, 'phetioValueType'> & PickRequired, 'validValues'>; class StringEnumerationProperty extends Property { public constructor( value: T, providedOptions?: StringEnumerationPropertyOptions ) { const options = optionize, EmptySelfOptions, PropertyOptions>()( { - phetioType: Property.PropertyIO( StringIO ) + phetioValueType: StringIO }, providedOptions ); super( value, options ); Index: main/tandem/js/types/NullableIO.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/tandem/js/types/NullableIO.ts b/main/tandem/js/types/NullableIO.ts --- a/main/tandem/js/types/NullableIO.ts (revision 408b75abb82a3eb4c3b26c2d0b7ac2c08fca50c3) +++ b/main/tandem/js/types/NullableIO.ts (date 1660063218497) @@ -9,7 +9,7 @@ * * this.ageProperty = new Property( null, { * tandem: tandem.createTandem( 'ageProperty' ), - * phetioType: Property.PropertyIO( NullableIO( NumberIO ) ) // signifies that the Property can be Number or null + * phetioValueType: NullableIO( NumberIO ) // signifies that the Property can be Number or null * } ); * * @author Michael Kauzmann (PhET Interactive Simulations) Index: main/axon/js/ValidationTests.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/ValidationTests.ts b/main/axon/js/ValidationTests.ts --- a/main/axon/js/ValidationTests.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/ValidationTests.ts (date 1660063119974) @@ -233,7 +233,7 @@ testContainsErrorMessage( [ 4 ], { arrayElementType: 'boolean', validationMessage: 'arrayElementType with value:4' } ); testContainsErrorMessage( [ 4, true, 'hi' ], { arrayElementType: [ 'boolean', 'number' ], validationMessage: 'arrayElementType with value:[hi]' } ); testContainsErrorMessage( 4, { isValidValue: v => v === 3, validationMessage: 'isValidValue 3, value 4' } ); - testContainsErrorMessage( 'oh hello', { phetioType: Property.PropertyIO( BooleanIO ), validationMessage: 'isValidValue 3, value string' } ); + testContainsErrorMessage( 'oh hello', { phetioValueType: BooleanIO, validationMessage: 'isValidValue 3, value string' } ); const ioType = new IOType( 'TestIO', { valueType: 'boolean' } ); const ioTypeValidationMessage = 'should be a boolean from this IOType in tests'; Index: main/mean-share-and-balance/js/intro/model/IntroModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/mean-share-and-balance/js/intro/model/IntroModel.ts b/main/mean-share-and-balance/js/intro/model/IntroModel.ts --- a/main/mean-share-and-balance/js/intro/model/IntroModel.ts (revision df4e78c939d2d1dd273d999201874ce60d387951) +++ b/main/mean-share-and-balance/js/intro/model/IntroModel.ts (date 1660062794632) @@ -128,7 +128,7 @@ tandem: options.tandem.createTandem( 'meanProperty' ), phetioDocumentation: 'The ground-truth water-level mean.', phetioReadOnly: true, - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // add/remove water cups and pipes according to number spinner Index: main/geometric-optics/js/common/view/LightSceneNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/view/LightSceneNode.ts b/main/geometric-optics/js/common/view/LightSceneNode.ts --- a/main/geometric-optics/js/common/view/LightSceneNode.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/view/LightSceneNode.ts (date 1660062824129) @@ -138,7 +138,7 @@ scene.opticalImage1.visibleProperty ], { tandem: lightSpot1NodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: providedOptions.tandem.createTandem( 'lightSpot1Node' ) } ); @@ -154,7 +154,7 @@ visibleProperties.secondPointVisibleProperty ], { tandem: lightSpot2NodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: lightSpot2NodeTandem } ); Index: main/models-of-the-hydrogen-atom/js/common/model/BohrModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/model/BohrModel.ts b/main/models-of-the-hydrogen-atom/js/common/model/BohrModel.ts --- a/main/models-of-the-hydrogen-atom/js/common/model/BohrModel.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/model/BohrModel.ts (date 1660063120220) @@ -150,7 +150,7 @@ return MOTHAUtils.polarToCartesian( radius, angle ); }, { tandem: options.tandem.createTandem( 'electronOffsetProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO } ); this.electronOffsetProperty.link( electronOffset => { Index: main/joist/js/Sim.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/joist/js/Sim.ts b/main/joist/js/Sim.ts --- a/main/joist/js/Sim.ts (revision 1ac0703826d7353b7af360373fb91623436e46c3) +++ b/main/joist/js/Sim.ts (date 1660063119967) @@ -533,7 +533,7 @@ phetioFeatured: true, phetioDocumentation: 'Determines which screen is selected in the simulation', validValues: this.screens, - phetioType: Property.PropertyIO( Screen.ScreenIO ) + phetioValueType: Screen.ScreenIO } ); // If the activeSimScreens changes, we'll want to update what the active screen (or selected screen) is for specific Index: main/models-of-the-hydrogen-atom/js/common/view/PredictionPanel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/PredictionPanel.ts b/main/models-of-the-hydrogen-atom/js/common/view/PredictionPanel.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/PredictionPanel.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/PredictionPanel.ts (date 1660062824135) @@ -41,7 +41,7 @@ // Visible when model mode is 'prediction' visibleProperty: new DerivedProperty( [ modelModeProperty ], modelMode => ( modelMode === 'prediction' ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), fill: MOTHAColors.modelsPanelFillProperty, stroke: MOTHAColors.modelsPanelStrokeProperty, Index: main/models-of-the-hydrogen-atom/js/common/model/Light.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/model/Light.ts b/main/models-of-the-hydrogen-atom/js/common/model/Light.ts --- a/main/models-of-the-hydrogen-atom/js/common/model/Light.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/model/Light.ts (date 1660063119944) @@ -89,7 +89,7 @@ this.lightModeProperty = new Property( 'white', { validValues: LightModeValues, tandem: options.tandem.createTandem( 'lightModeProperty' ), - phetioType: Property.PropertyIO( StringIO ) + phetioValueType: StringIO } ); // Range goes from UV to max visible wavelength @@ -105,14 +105,14 @@ ( lightMode, monochromaticWavelength ) => ( lightMode === 'white' ) ? VisibleColor.WHITE_WAVELENGTH : monochromaticWavelength, { tandem: options.tandem.createTandem( 'wavelengthProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.colorProperty = new DerivedProperty( [ this.lightModeProperty, this.wavelengthProperty ], ( lightMode, wavelength ) => VisibleColor.wavelengthToColor( wavelength ), { tandem: options.tandem.createTandem( 'colorProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Color.ColorIO ) + phetioValueType: Color.ColorIO } ); this.photonCreatedEmitter = new Emitter<[ Photon ]>( { Index: main/sun/js/Slider.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/sun/js/Slider.ts b/main/sun/js/Slider.ts --- a/main/sun/js/Slider.ts (revision 3db576630e509d4a1a4423ebd24fb6fd8fdbe0cc) +++ b/main/sun/js/Slider.ts (date 1660063218443) @@ -305,7 +305,7 @@ valueType: Range, isValidValue: ( value: Range ) => ( value.min >= range.min && value.max <= range.max ), tandem: options.tandem.createTandem( 'enabledRangeProperty' ), - phetioType: Property.PropertyIO( Range.RangeIO ), + phetioValueType: Range.RangeIO, phetioDocumentation: 'Sliders support two ranges: the outer range which specifies the min and max of the track and ' + 'the enabledRangeProperty, which determines how low and high the thumb can be dragged within the track.' } ); Index: main/models-of-the-hydrogen-atom/js/common/view/HydrogenAtomNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/HydrogenAtomNode.ts b/main/models-of-the-hydrogen-atom/js/common/view/HydrogenAtomNode.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/HydrogenAtomNode.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/HydrogenAtomNode.ts (date 1660062824145) @@ -39,7 +39,7 @@ options.visibleProperty = new DerivedProperty( [ hydrogenAtomProperty ], value => ( value === hydrogenAtom ), { tandem: options.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); super( options ); Index: main/models-of-the-hydrogen-atom/js/common/view/ShowAbsorptionWavelengthsCheckbox.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/ShowAbsorptionWavelengthsCheckbox.ts b/main/models-of-the-hydrogen-atom/js/common/view/ShowAbsorptionWavelengthsCheckbox.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/ShowAbsorptionWavelengthsCheckbox.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/ShowAbsorptionWavelengthsCheckbox.ts (date 1660062824131) @@ -37,7 +37,7 @@ visibleProperty: new DerivedProperty( [ hydrogenAtomModelProperty ], hydrogenAtomModel => hydrogenAtomModel.hasTransitionWavelengths, { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), checkboxColor: MOTHAColors.showAbsorptionWavelengthCheckboxStrokeProperty, checkboxColorBackground: MOTHAColors.showAbsorptionWavelengthCheckboxFillProperty Index: main/scenery-phet/js/MeasuringTapeNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery-phet/js/MeasuringTapeNode.ts b/main/scenery-phet/js/MeasuringTapeNode.ts --- a/main/scenery-phet/js/MeasuringTapeNode.ts (revision 2b767eaed6f1f531c19f1774685f2f811dd87792) +++ b/main/scenery-phet/js/MeasuringTapeNode.ts (date 1660063119910) @@ -186,7 +186,7 @@ ( basePosition, tipPosition ) => basePosition.distance( tipPosition ), { tandem: options.tandem.createTandem( 'measuredDistanceProperty' ), phetioDocumentation: 'The distance measured by the measuring tape', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, units: this.basePositionProperty.units } ); @@ -233,7 +233,7 @@ } ); }, { tandem: options.tandem.createTandem( 'readoutTextProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( StringIO ), + phetioValueType: StringIO, phetioDocumentation: 'The text content of the readout on the measuring tape' } ); Index: main/models-of-the-hydrogen-atom/js/common/view/ClassicalSolarSystemNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/ClassicalSolarSystemNode.ts b/main/models-of-the-hydrogen-atom/js/common/view/ClassicalSolarSystemNode.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/ClassicalSolarSystemNode.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/ClassicalSolarSystemNode.ts (date 1660062824127) @@ -40,7 +40,7 @@ const protonNode = new ProtonNode( hydrogenAtom.proton, modelViewTransform, { visibleProperty: DerivedProperty.not( hydrogenAtom.isDestroyedProperty, { tandem: protonNodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: protonNodeTandem } ); @@ -49,7 +49,7 @@ const electronNode = new ElectronNode( hydrogenAtom.electron, modelViewTransform, { visibleProperty: DerivedProperty.not( hydrogenAtom.isDestroyedProperty, { tandem: electronNodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: electronNodeTandem } ); Index: main/circuit-construction-kit-common/js/model/VoltageSource.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/VoltageSource.ts b/main/circuit-construction-kit-common/js/model/VoltageSource.ts --- a/main/circuit-construction-kit-common/js/model/VoltageSource.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/VoltageSource.ts (date 1660062794644) @@ -75,7 +75,7 @@ [ this.currentProperty, this.voltageProperty ], ( current, voltage ) => Math.abs( current * voltage ), { tandem: tandem.createTandem( 'powerGeneratedProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.initialOrientation = options.initialOrientation; Index: main/joist/js/HomeScreenModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/joist/js/HomeScreenModel.ts b/main/joist/js/HomeScreenModel.ts --- a/main/joist/js/HomeScreenModel.ts (revision 1ac0703826d7353b7af360373fb91623436e46c3) +++ b/main/joist/js/HomeScreenModel.ts (date 1660063120041) @@ -34,7 +34,7 @@ this.activeSimScreensProperty = activeSimScreensProperty; this.selectedScreenProperty = new Property( simScreens[ 0 ], { validValues: simScreens, - phetioType: Property.PropertyIO( Screen.ScreenIO ), + phetioValueType: Screen.ScreenIO, tandem: tandem.createTandem( 'selectedScreenProperty' ), phetioFeatured: true } ); Index: main/geometric-optics/js/common/view/OpticalImageNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/view/OpticalImageNode.ts b/main/geometric-optics/js/common/view/OpticalImageNode.ts --- a/main/geometric-optics/js/common/view/OpticalImageNode.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/view/OpticalImageNode.ts (date 1660062824147) @@ -44,7 +44,7 @@ lightPropagationEnabled && objectVisible ); }, { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ) }, providedOptions ); Index: main/scenery-phet/js/ThermometerNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/scenery-phet/js/ThermometerNode.ts b/main/scenery-phet/js/ThermometerNode.ts --- a/main/scenery-phet/js/ThermometerNode.ts (revision 2b767eaed6f1f531c19f1774685f2f811dd87792) +++ b/main/scenery-phet/js/ThermometerNode.ts (date 1660063119927) @@ -245,7 +245,7 @@ }, { tandem: options.tandem.createTandem( 'percentProperty' ), phetioDocumentation: 'the percentage of the thermometer that is filled by the current temperature. If temperature is null, then percent will be 0', - phetioType: DerivedProperty.DerivedPropertyIO( NullableIO( NumberIO ) ) + phetioValueType: NullableIO( NumberIO ) } ); this.mutate( options ); Index: main/utterance-queue/js/SpeechSynthesisAnnouncer.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/utterance-queue/js/SpeechSynthesisAnnouncer.ts b/main/utterance-queue/js/SpeechSynthesisAnnouncer.ts --- a/main/utterance-queue/js/SpeechSynthesisAnnouncer.ts (revision cdde58c9eaf15f332d1b7002d06af00a3475cec2) +++ b/main/utterance-queue/js/SpeechSynthesisAnnouncer.ts (date 1660063218492) @@ -205,7 +205,7 @@ super( options ); this.voiceProperty = new Property( null, { tandem: options.tandem.createTandem( 'voiceProperty' ), - phetioType: Property.PropertyIO( NullableIO( SpeechSynthesisVoiceIO ) ), + phetioValueType: NullableIO( SpeechSynthesisVoiceIO ), phetioReadOnly: true, phetioState: false } ); Index: main/density-buoyancy-common/js/common/model/Basin.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/Basin.ts b/main/density-buoyancy-common/js/common/model/Basin.ts --- a/main/density-buoyancy-common/js/common/model/Basin.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/Basin.ts (date 1660064074810) @@ -59,7 +59,8 @@ this.liquidYInterpolatedProperty = new InterpolatedProperty( options.initialY, { interpolate: InterpolatedProperty.interpolateNumber, - phetioType: InterpolatedProperty.InterpolatedPropertyIO( NumberIO ), + phetioOuterType: InterpolatedProperty.InterpolatedPropertyIO, + phetioValueType: NumberIO, tandem: tandem.createTandem( 'liquidYInterpolatedProperty' ), phetioHighFrequency: true, phetioReadOnly: true, Index: main/density-buoyancy-common/js/common/model/Mass.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/Mass.ts b/main/density-buoyancy-common/js/common/model/Mass.ts --- a/main/density-buoyancy-common/js/common/model/Mass.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/Mass.ts (date 1660064074795) @@ -112,6 +112,7 @@ phetioDocumentation: 'Material values' } ); } + type MaterialNonCustomIdentifier = 'ALUMINUM' | 'BRICK' | 'COPPER' | 'ICE' | 'PLATINUM' | 'STEEL' | 'STYROFOAM' | 'WOOD'; type MaterialIdentifier = MaterialNonCustomIdentifier | 'CUSTOM'; @@ -299,7 +300,7 @@ valueType: Material, reentrant: true, tandem: tandem.createTandem( 'materialProperty' ), - phetioType: Property.PropertyIO( Material.MaterialIO ) + phetioValueType: Material.MaterialIO }, config.materialPropertyOptions ) ); if ( config.adjustableMaterial ) { @@ -411,7 +412,7 @@ interpolate: InterpolatedProperty.interpolateVector2, useDeepEquality: true, tandem: tandem.createTandem( 'gravityForceInterpolatedProperty' ), - phetioType: InterpolatedProperty.InterpolatedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioReadOnly: true, units: 'N', phetioHighFrequency: true @@ -421,7 +422,7 @@ interpolate: InterpolatedProperty.interpolateVector2, useDeepEquality: true, tandem: tandem.createTandem( 'buoyancyForceInterpolatedProperty' ), - phetioType: InterpolatedProperty.InterpolatedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioReadOnly: true, units: 'N', phetioHighFrequency: true @@ -431,7 +432,7 @@ interpolate: InterpolatedProperty.interpolateVector2, useDeepEquality: true, tandem: tandem.createTandem( 'contactForceInterpolatedProperty' ), - phetioType: InterpolatedProperty.InterpolatedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioReadOnly: true, units: 'N', phetioHighFrequency: true Index: main/tangible/js/mediaPipe/MediaPipe.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/tangible/js/mediaPipe/MediaPipe.ts b/main/tangible/js/mediaPipe/MediaPipe.ts --- a/main/tangible/js/mediaPipe/MediaPipe.ts (revision 62f862896e585ec08910f33bd16979e68962d555) +++ b/main/tangible/js/mediaPipe/MediaPipe.ts (date 1660063218463) @@ -91,7 +91,7 @@ // the most recent results from MediaPipe public static resultsProperty = new Property( null, { - phetioType: Property.PropertyIO( NullableIO( MediaPipeResultsIO ) ), + phetioValueType: NullableIO( MediaPipeResultsIO ), tandem: Tandem.GLOBAL_VIEW.createTandem( 'mediaPipe' ).createTandem( 'resultsProperty' ), phetioDocumentation: 'A Property that holds the raw data coming from MediaPipe. Set to null if there are no hands detected.' } ); Index: main/gravity-and-orbits/js/common/model/Body.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/gravity-and-orbits/js/common/model/Body.ts b/main/gravity-and-orbits/js/common/model/Body.ts --- a/main/gravity-and-orbits/js/common/model/Body.ts (revision cddab12586b0833c9f3932eb0d13b0e994e32413) +++ b/main/gravity-and-orbits/js/common/model/Body.ts (date 1660062794651) @@ -252,7 +252,7 @@ } ); this.speedProperty = new DerivedProperty( [ this.velocityProperty ], velocity => velocity.magnitude, { - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, tandem: tandem.createTandem( 'speedProperty' ), units: 'm/s', phetioHighFrequency: true, @@ -270,7 +270,7 @@ this.forceMagnitudeProperty = new DerivedProperty( [ this.forceProperty ], force => force.magnitude, { phetioDocumentation: 'The magnitude of the net force on this body by other bodies', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, tandem: tandem.createTandem( 'forceMagnitudeProperty' ), phetioHighFrequency: true, units: 'N' Index: main/geometric-optics/js/common/model/Optic.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/Optic.ts b/main/geometric-optics/js/common/model/Optic.ts --- a/main/geometric-optics/js/common/model/Optic.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/Optic.ts (date 1660062858215) @@ -197,7 +197,7 @@ }, { units: 'cm', tandem: options.tandem.createTandem( 'radiusOfCurvatureProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'The radius of curvature (ROC) of the optic. ' + 'A convex optic has a positive ROC, while a concave optic has a negative ROC.' } ); @@ -211,7 +211,7 @@ // units: unitless tandem: options.tandem.createTandem( 'indexOfRefractionProperty' ), phetioDocumentation: 'The index of refraction (IOR) of the optic', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // Get the focal-length magnitude from the current focal-length model, add the appropriate sign. @@ -236,7 +236,7 @@ }, { units: 'cm', tandem: options.tandem.createTandem( 'focalLengthProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'The signed focal length of the optic. A converging optic has a positive focal length, ' + 'while a diverging optic has a negative focal length.' } ); @@ -247,7 +247,7 @@ ( position, focalLength ) => position.plusXY( -Math.abs( focalLength ), 0 ), { units: 'cm', tandem: options.tandem.createTandem( 'leftFocalPointProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioDocumentation: 'focal point F, at a distance f to the left of the optic' } ); @@ -257,7 +257,7 @@ ( position, focalLength ) => position.plusXY( Math.abs( focalLength ), 0 ), { units: 'cm', tandem: options.tandem.createTandem( 'rightFocalPointProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioDocumentation: 'focal point F, at a distance f to the right of the optic' } ); @@ -265,7 +265,7 @@ this.twiceFocalLengthProperty = new DerivedProperty( [ this.focalLengthProperty ], focalLength => 2 * focalLength, { units: 'cm', tandem: options.tandem.createTandem( 'twiceFocalLengthProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: '2f, twice the focal length' } ); @@ -275,7 +275,7 @@ ( position, twiceFocalLength ) => position.plusXY( -Math.abs( twiceFocalLength ), 0 ), { units: 'cm', tandem: options.tandem.createTandem( 'left2FProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioDocumentation: 'point 2F, at a distance 2f to the left of the optic' } ); @@ -285,7 +285,7 @@ ( position, twiceFocalLength ) => position.plusXY( Math.abs( twiceFocalLength ), 0 ), { units: 'cm', tandem: options.tandem.createTandem( 'right2FProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioDocumentation: 'point 2F, at a distance 2f to the right of the optic' } ); Index: main/geometric-optics/js/common/view/GOSceneNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/view/GOSceneNode.ts b/main/geometric-optics/js/common/view/GOSceneNode.ts --- a/main/geometric-optics/js/common/view/GOSceneNode.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/view/GOSceneNode.ts (date 1660062824149) @@ -148,7 +148,7 @@ visibleProperties.secondPointVisibleProperty ], { tandem: guides2Tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: guides2Tandem, phetioDocumentation: 'guides associated with the second object' Index: main/geometric-optics/js/common/view/GOScreenView.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/view/GOScreenView.ts b/main/geometric-optics/js/common/view/GOScreenView.ts --- a/main/geometric-optics/js/common/view/GOScreenView.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/view/GOScreenView.ts (date 1660062824136) @@ -129,7 +129,7 @@ zoomLevel => ZOOM_SCALES[ zoomLevel ], { validValues: ZOOM_SCALES, tandem: options.tandem.createTandem( 'zoomScaleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'Scale that is applied to the view. This Property is derived from zoomLevelProperty, ' + ' which is controlled by the zoom buttons.' } ); @@ -329,7 +329,7 @@ visibleProperty: new DerivedProperty( [ model.opticalObjectChoiceProperty ], opticalObjectChoice => ( opticalObjectChoice.type === 'arrow' ), { tandem: arrowSceneNodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: arrowSceneNodeTandem } ); @@ -343,7 +343,7 @@ visibleProperty: new DerivedProperty( [ model.opticalObjectChoiceProperty ], opticalObjectChoice => ( opticalObjectChoice.type === 'framed' ), { tandem: frameSceneNodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: frameSceneNodeTandem } ); @@ -363,7 +363,7 @@ visibleProperty: new DerivedProperty( [ model.opticalObjectChoiceProperty ], opticalObjectChoice => ( opticalObjectChoice.type === 'light' ), { tandem: lightSceneNodeTandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ), tandem: lightSceneNodeTandem } ); Index: main/center-and-variability/js/common/model/SoccerModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/center-and-variability/js/common/model/SoccerModel.ts b/main/center-and-variability/js/common/model/SoccerModel.ts --- a/main/center-and-variability/js/common/model/SoccerModel.ts (revision ea7f84374c8e00fc5c1a7855827395b0c7c6cb1f) +++ b/main/center-and-variability/js/common/model/SoccerModel.ts (date 1660063120145) @@ -77,7 +77,7 @@ // Create an initial ball to show on startup this.nextBallToKickProperty = new Property( this.createBall(), { tandem: options.tandem.createTandem( 'nextBallToKickProperty' ), - phetioType: Property.PropertyIO( NullableIO( ReferenceIO( CAVObject.CAVObjectIO ) ) ) + phetioValueType: NullableIO( ReferenceIO( CAVObject.CAVObjectIO ) ) } ); this.ballPlayerMap = new Map(); @@ -98,7 +98,7 @@ this.distributionProperty = new Property( SoccerModel.chooseDistribution(), { tandem: options.tandem.createTandem( 'distributionProperty' ), - phetioType: Property.PropertyIO( ArrayIO( NumberIO ) ), + phetioValueType: ArrayIO( NumberIO ), phetioDocumentation: 'The distribution of probabilities of where the balls will land is represented as an un-normalized array of non-negative, floating-point numbers, one value for each location in the physical range', isValidValue: ( array: readonly number[] ) => array.length === this.physicalRange.getLength() + 1 && // inclusive of endpoints _.every( array, element => element >= 0 ) Index: main/center-and-variability/js/common/model/CAVModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/center-and-variability/js/common/model/CAVModel.ts b/main/center-and-variability/js/common/model/CAVModel.ts --- a/main/center-and-variability/js/common/model/CAVModel.ts (revision ea7f84374c8e00fc5c1a7855827395b0c7c6cb1f) +++ b/main/center-and-variability/js/common/model/CAVModel.ts (date 1660063120188) @@ -161,12 +161,12 @@ this.medianValueProperty = new Property( null, { tandem: options.tandem.createTandem( 'medianValueProperty' ), - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ), + phetioValueType: NullableIO( NumberIO ), phetioReadOnly: true } ); this.meanValueProperty = new Property( null, { tandem: options.tandem.createTandem( 'meanValueProperty' ), - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ), + phetioValueType: NullableIO( NumberIO ), phetioReadOnly: true } ); this.dataRangeProperty = new Property( null ); Index: main/axon/js/EnumerationProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/EnumerationProperty.ts b/main/axon/js/EnumerationProperty.ts --- a/main/axon/js/EnumerationProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/EnumerationProperty.ts (date 1660064074812) @@ -20,7 +20,7 @@ enumeration?: Enumeration; }; -export type EnumerationPropertyOptions = SelfOptions & StrictOmit, 'phetioType'>; +export type EnumerationPropertyOptions = SelfOptions & StrictOmit, 'phetioValueType'>; export default class EnumerationProperty extends Property { @@ -32,9 +32,9 @@ const options = optionize, EmptySelfOptions, PropertyOptions>()( { validValues: firstOptions.enumeration.values, - phetioType: Property.PropertyIO( EnumerationIO( { + phetioValueType: EnumerationIO( { enumeration: firstOptions.enumeration - } ) ) + } ) }, firstOptions ); super( value, options ); Index: main/center-and-variability/js/common/model/CAVObject.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/center-and-variability/js/common/model/CAVObject.ts b/main/center-and-variability/js/common/model/CAVObject.ts --- a/main/center-and-variability/js/common/model/CAVObject.ts (revision ea7f84374c8e00fc5c1a7855827395b0c7c6cb1f) +++ b/main/center-and-variability/js/common/model/CAVObject.ts (date 1660063119892) @@ -98,7 +98,7 @@ this.dragPositionProperty = new Vector2Property( options.position ); this.valueProperty = new Property( options.value, { tandem: options.tandem.createTandem( 'valueProperty' ), - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ) + phetioValueType: NullableIO( NumberIO ) } ); this.isMedianObjectProperty = new BooleanProperty( false, { tandem: options.tandem.createTandem( 'isMedianObjectProperty' ) Index: main/quadrilateral/js/quadrilateral/model/ParallelSideChecker.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/quadrilateral/js/quadrilateral/model/ParallelSideChecker.ts b/main/quadrilateral/js/quadrilateral/model/ParallelSideChecker.ts --- a/main/quadrilateral/js/quadrilateral/model/ParallelSideChecker.ts (revision b0f7ff8cf4a8590de053d55dcddbfff4dcb5a8d6) +++ b/main/quadrilateral/js/quadrilateral/model/ParallelSideChecker.ts (date 1660062794665) @@ -157,7 +157,7 @@ return toleranceInterval; }, { tandem: tandem.createTandem( 'angleToleranceIntervalProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // Primarily for debugging in the QuadrilateralModelValuePanel. We cannot actually use this Property because Index: main/quadrilateral/js/quadrilateral/model/QuadrilateralShapeModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/quadrilateral/js/quadrilateral/model/QuadrilateralShapeModel.ts b/main/quadrilateral/js/quadrilateral/model/QuadrilateralShapeModel.ts --- a/main/quadrilateral/js/quadrilateral/model/QuadrilateralShapeModel.ts (revision b0f7ff8cf4a8590de053d55dcddbfff4dcb5a8d6) +++ b/main/quadrilateral/js/quadrilateral/model/QuadrilateralShapeModel.ts (date 1660062794661) @@ -370,7 +370,7 @@ ); }, { tandem: options.tandem.createTandem( 'shapeAngleToleranceIntervalProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.shapeLengthToleranceIntervalProperty = new DerivedProperty( [ this.shapeNameProperty ], shapeName => { @@ -381,7 +381,7 @@ ); }, { tandem: options.tandem.createTandem( 'shapeLengthToleranceIntervalProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.sideABSideCDParallelSideChecker = new ParallelSideChecker( Index: main/quadrilateral/js/quadrilateral/model/QuadrilateralModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/quadrilateral/js/quadrilateral/model/QuadrilateralModel.ts b/main/quadrilateral/js/quadrilateral/model/QuadrilateralModel.ts --- a/main/quadrilateral/js/quadrilateral/model/QuadrilateralModel.ts (revision b0f7ff8cf4a8590de053d55dcddbfff4dcb5a8d6) +++ b/main/quadrilateral/js/quadrilateral/model/QuadrilateralModel.ts (date 1660063218437) @@ -125,12 +125,12 @@ this.modelBoundsProperty = new Property( null, { tandem: tandem.createTandem( 'modelBoundsProperty' ), - phetioType: Property.PropertyIO( NullableIO( Bounds2.Bounds2IO ) ) + phetioValueType: NullableIO( Bounds2.Bounds2IO ) } ); this.physicalModelBoundsProperty = new Property( null, { tandem: tandem.createTandem( 'physicalModelBoundsProperty' ), - phetioType: Property.PropertyIO( NullableIO( Bounds2.Bounds2IO ) ) + phetioValueType: NullableIO( Bounds2.Bounds2IO ) } ); this.isCalibratingProperty = new BooleanProperty( false, { Index: main/geometric-optics/js/common/model/IndirectFocalLengthModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/IndirectFocalLengthModel.ts b/main/geometric-optics/js/common/model/IndirectFocalLengthModel.ts --- a/main/geometric-optics/js/common/model/IndirectFocalLengthModel.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/IndirectFocalLengthModel.ts (date 1660062794655) @@ -76,7 +76,7 @@ units: 'cm', tandem: options.tandem.createTandem( 'focalLengthMagnitudeProperty' ), phetioDocumentation: 'magnitude of the focal length (no sign)', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.resetIndirectFocalLengthModel = () => { Index: main/geometric-optics/js/common/model/DirectFocalLengthModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/DirectFocalLengthModel.ts b/main/geometric-optics/js/common/model/DirectFocalLengthModel.ts --- a/main/geometric-optics/js/common/model/DirectFocalLengthModel.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/DirectFocalLengthModel.ts (date 1660062794676) @@ -79,7 +79,7 @@ units: 'cm', tandem: options.tandem.createTandem( 'radiusOfCurvatureMagnitudeProperty' ), phetioDocumentation: 'magnitude of the radius of curvature (no sign)', - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); this.resetDirectFocalLengthModel = () => { Index: main/quadrilateral/js/quadrilateral/model/Vertex.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/quadrilateral/js/quadrilateral/model/Vertex.ts b/main/quadrilateral/js/quadrilateral/model/Vertex.ts --- a/main/quadrilateral/js/quadrilateral/model/Vertex.ts (revision b0f7ff8cf4a8590de053d55dcddbfff4dcb5a8d6) +++ b/main/quadrilateral/js/quadrilateral/model/Vertex.ts (date 1660063218467) @@ -94,7 +94,7 @@ this.angleProperty = new Property( null, { tandem: tandem.createTandem( 'angleProperty' ), - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ) + phetioValueType: NullableIO( NumberIO ) } ); // The label for this vertex so we can get the same vertex on another QuadrilateralShapeModel. Index: main/models-of-the-hydrogen-atom/js/common/view/DeBroglieBrightnessNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieBrightnessNode.ts b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieBrightnessNode.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieBrightnessNode.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieBrightnessNode.ts (date 1660062824151) @@ -45,7 +45,7 @@ visibleProperty: new DerivedProperty( [ hydrogenAtom.deBroglieViewProperty ], deBroglieView => ( deBroglieView === 'brightness' ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ) }, providedOptions ); Index: main/quadrilateral/js/quadrilateral/model/Side.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/quadrilateral/js/quadrilateral/model/Side.ts b/main/quadrilateral/js/quadrilateral/model/Side.ts --- a/main/quadrilateral/js/quadrilateral/model/Side.ts (revision b0f7ff8cf4a8590de053d55dcddbfff4dcb5a8d6) +++ b/main/quadrilateral/js/quadrilateral/model/Side.ts (date 1660062794647) @@ -101,7 +101,7 @@ return Vertex.calculateAngle( vertex1Position, vertex2Position, vertex2Position.plus( options.offsetVectorForTiltCalculation ), options.validateShape ); }, { tandem: tandem.createTandem( 'tiltProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); // The distance between the two vertices, in model space. @@ -125,7 +125,7 @@ return length * QuadrilateralQueryParameters.lengthToleranceIntervalScaleFactor; }, { tandem: tandem.createTandem( 'lengthToleranceIntervalProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); } Index: main/models-of-the-hydrogen-atom/js/common/view/DeBroglieRadialNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieRadialNode.ts b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieRadialNode.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieRadialNode.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglieRadialNode.ts (date 1660062824126) @@ -45,7 +45,7 @@ visibleProperty: new DerivedProperty( [ hydrogenAtom.deBroglieViewProperty ], deBroglieView => ( deBroglieView === 'radial' ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ) }, providedOptions ); Index: main/density-buoyancy-common/js/common/view/MaterialMassVolumeControlNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/view/MaterialMassVolumeControlNode.ts b/main/density-buoyancy-common/js/common/view/MaterialMassVolumeControlNode.ts --- a/main/density-buoyancy-common/js/common/view/MaterialMassVolumeControlNode.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/view/MaterialMassVolumeControlNode.ts (date 1660063120003) @@ -112,7 +112,7 @@ phetioDocumentation: 'Current material of the block. Changing the material will result in changes to the mass, but the volume will remain the same.', validValues: MaterialEnumeration.VALUES as unknown as MaterialEnumValue[], // @ts-ignore - phetioType: Property.PropertyIO( EnumerationIO( MaterialEnumeration ) ) + phetioValueType: EnumerationIO( MaterialEnumeration ) } ); // We need to use "locks" since our behavior is different based on whether the model or user is changing the value @@ -137,7 +137,7 @@ }, { reentrant: true, phetioState: false, - phetioType: DerivedProperty.DerivedPropertyIO( Range.RangeIO ), + phetioValueType: Range.RangeIO, tandem: massNumberControlTandem.createTandem( 'enabledMassRangeProperty' ) } ); Index: main/density-buoyancy-common/js/common/model/DensityBuoyancyModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/DensityBuoyancyModel.ts b/main/density-buoyancy-common/js/common/model/DensityBuoyancyModel.ts --- a/main/density-buoyancy-common/js/common/model/DensityBuoyancyModel.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/DensityBuoyancyModel.ts (date 1660063120212) @@ -111,7 +111,7 @@ this.gravityProperty = new Property( Gravity.EARTH, { valueType: Gravity, - phetioType: Property.PropertyIO( Gravity.GravityIO ), + phetioValueType: Gravity.GravityIO, tandem: tandem.createTandem( 'gravityProperty' ), phetioReadOnly: true, phetioDocumentation: 'The acceleration due to gravity applied to all masses, (may be potentially custom or hidden from view)' @@ -119,7 +119,7 @@ this.liquidMaterialProperty = new Property( Material.WATER, { valueType: Material, - phetioType: Property.PropertyIO( Material.MaterialIO ), + phetioValueType: Material.MaterialIO, tandem: tandem.createTandem( 'liquidMaterialProperty' ), phetioReadOnly: true, phetioDocumentation: 'The material of the liquid in the pool' @@ -128,14 +128,14 @@ // DerivedProperty doesn't need disposal, since everything here lives for the lifetime of the simulation this.liquidDensityProperty = new DerivedProperty( [ this.liquidMaterialProperty ], liquidMaterial => liquidMaterial.density, { tandem: tandem.createTandem( 'liquidDensityProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, units: 'kg/m^3' } ); // DerivedProperty doesn't need disposal, since everything here lives for the lifetime of the simulation this.liquidViscosityProperty = new DerivedProperty( [ this.liquidMaterialProperty ], liquidMaterial => liquidMaterial.viscosity, { tandem: tandem.createTandem( 'liquidViscosityProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, units: 'Pa\u00b7s' } ); @@ -153,7 +153,7 @@ 0.875, 4, GROUND_FRONT_Z ), { valueType: Bounds3, - phetioType: Property.PropertyIO( Bounds3.Bounds3IO ), + phetioValueType: Bounds3.Bounds3IO, tandem: tandem.createTandem( 'invisibleBarrierBoundsProperty' ), phetioReadOnly: true, phetioDocumentation: 'We keep masses within these bounds, generally to stay in-screen', Index: main/geometric-optics/js/common/model/Guide.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/Guide.ts b/main/geometric-optics/js/common/model/Guide.ts --- a/main/geometric-optics/js/common/model/Guide.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/Guide.ts (date 1660062858217) @@ -58,7 +58,7 @@ ( opticPosition, opticDiameter ) => opticPosition.plusXY( 0, locationSign * opticDiameter / 2 ), { tandem: options.tandem.createTandem( 'fulcrumPositionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, units: 'cm' } ); @@ -69,7 +69,7 @@ return displacementVector.getAngle(); }, { tandem: options.tandem.createTandem( 'incidentAngleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, units: 'radians' } ); @@ -94,7 +94,7 @@ return throughAngle + deflectedAngle; }, { tandem: options.tandem.createTandem( 'transmittedAngleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, units: 'radians' } ); } Index: main/greenhouse-effect/js/common/model/FluxMeter.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/greenhouse-effect/js/common/model/FluxMeter.ts b/main/greenhouse-effect/js/common/model/FluxMeter.ts --- a/main/greenhouse-effect/js/common/model/FluxMeter.ts (revision e8a69211a942af282bec0a871d2f1f5368b5a7ee) +++ b/main/greenhouse-effect/js/common/model/FluxMeter.ts (date 1660063120034) @@ -92,7 +92,7 @@ }, { tandem: options.tandem.createTandem( 'wireSensorAttachmentPositionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO } ); Index: main/density-buoyancy-common/js/common/model/Cuboid.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/Cuboid.ts b/main/density-buoyancy-common/js/common/model/Cuboid.ts --- a/main/density-buoyancy-common/js/common/model/Cuboid.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/Cuboid.ts (date 1660063119917) @@ -52,7 +52,7 @@ valueType: Bounds3, useDeepEquality: true, tandem: config.tandem.createTandem( 'sizeProperty' ), - phetioType: Property.PropertyIO( Bounds3.Bounds3IO ), + phetioValueType: Bounds3.Bounds3IO, phetioReadOnly: true } ); Index: main/density-buoyancy-common/js/common/model/InterpolatedProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/InterpolatedProperty.ts b/main/density-buoyancy-common/js/common/model/InterpolatedProperty.ts --- a/main/density-buoyancy-common/js/common/model/InterpolatedProperty.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/InterpolatedProperty.ts (date 1660064074784) @@ -32,7 +32,9 @@ public constructor( initialValue: T, providedConfig: InterpolatedPropertyOptions ) { - const config = optionize, SelfOptions, PropertyOptions>()( {}, providedConfig ); + const config = optionize, SelfOptions, PropertyOptions>()( { + phetioOuterType: InterpolatedProperty.InterpolatedPropertyIO + }, providedConfig ); super( initialValue, config ); Index: main/density-buoyancy-common/js/common/model/Ellipsoid.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/Ellipsoid.ts b/main/density-buoyancy-common/js/common/model/Ellipsoid.ts --- a/main/density-buoyancy-common/js/common/model/Ellipsoid.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/Ellipsoid.ts (date 1660063120271) @@ -48,7 +48,7 @@ this.sizeProperty = new Property( size, { valueType: Bounds3, tandem: config.tandem.createTandem( 'sizeProperty' ), - phetioType: Property.PropertyIO( Bounds3.Bounds3IO ) + phetioValueType: Bounds3.Bounds3IO } ); this.stepMaximumArea = 0; Index: main/axon/js/DerivedProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/DerivedProperty.ts b/main/axon/js/DerivedProperty.ts --- a/main/axon/js/DerivedProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/DerivedProperty.ts (date 1660064074775) @@ -75,12 +75,10 @@ const options = optionize, SelfOptions, PropertyOptions>()( { tandem: Tandem.OPTIONAL, - phetioReadOnly: true // derived properties can be read but not set by PhET-iO + phetioReadOnly: true, // derived properties can be read but not set by PhET-iO + phetioOuterType: DerivedProperty.DerivedPropertyIO }, providedOptions ); - assert && options.tandem.supplied && assert( options.phetioType && options.phetioType.typeName.startsWith( DERIVED_PROPERTY_IO_PREFIX ), - `phetioType must be provided and start with ${DERIVED_PROPERTY_IO_PREFIX}` ); - assert && assert( dependencies.every( _.identity ), 'dependencies should all be truthy' ); assert && assert( dependencies.length === _.uniq( dependencies ).length, 'duplicate dependencies' ); @@ -92,7 +90,7 @@ if ( Tandem.VALIDATION && this.isPhetioInstrumented() ) { // The phetioType should be a concrete (instantiated) DerivedPropertyIO, hence we must check its outer type - assert && assert( options.phetioType.typeName.startsWith( 'DerivedPropertyIO' ), 'phetioType should be DerivedPropertyIO' ); + assert && assert( this.phetioType.typeName.startsWith( 'DerivedPropertyIO' ), 'phetioType should be DerivedPropertyIO' ); } this.dependencies = dependencies; Index: main/geometric-optics/js/common/model/LightSpot.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/LightSpot.ts b/main/geometric-optics/js/common/model/LightSpot.ts --- a/main/geometric-optics/js/common/model/LightSpot.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/LightSpot.ts (date 1660063120098) @@ -74,7 +74,7 @@ positionAndDiameter => positionAndDiameter.position, { units: 'cm', tandem: options.tandem.createTandem( 'positionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ), + phetioValueType: Vector2.Vector2IO, phetioDocumentation: 'position of the center of the light spot, in the vertical plane of the projection screen' } ); @@ -83,7 +83,7 @@ isValidValue: ( diameter: number ) => ( diameter >= 0 ), units: 'cm', tandem: options.tandem.createTandem( 'diameterProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'diameter (in the y dimension) of the light spot, in the vertical plane of the projection screen' } ); @@ -108,7 +108,7 @@ }, { isValidValue: ( value: number ) => GOConstants.INTENSITY_RANGE.contains( value ), tandem: options.tandem.createTandem( 'intensityProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NullableIO( NumberIO ) ), + phetioValueType: NullableIO( NumberIO ), phetioDocumentation: 'intensity of the light spot, in the range [0,1]' } ); @@ -118,7 +118,7 @@ position.y >= projectionScreenPosition.y - projectionScreen.height / 2 - diameter / 2 && position.y <= projectionScreenPosition.y + projectionScreen.height / 2 + diameter / 2, { tandem: options.tandem.createTandem( 'intersectsProjectionScreenProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ); } Index: main/models-of-the-hydrogen-atom/js/common/view/DeBroglie3DNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglie3DNode.ts b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglie3DNode.ts --- a/main/models-of-the-hydrogen-atom/js/common/view/DeBroglie3DNode.ts (revision f651e10552116dbf04f209619e6723f1867d603a) +++ b/main/models-of-the-hydrogen-atom/js/common/view/DeBroglie3DNode.ts (date 1660062824121) @@ -73,7 +73,7 @@ visibleProperty: new DerivedProperty( [ hydrogenAtom.deBroglieViewProperty ], deBroglieView => ( deBroglieView === '3D' ), { tandem: providedOptions.tandem.createTandem( 'visibleProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( BooleanIO ) + phetioValueType: BooleanIO } ) }, providedOptions ); Index: main/joist/js/Screen.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/joist/js/Screen.ts b/main/joist/js/Screen.ts --- a/main/joist/js/Screen.ts (revision 1ac0703826d7353b7af360373fb91623436e46c3) +++ b/main/joist/js/Screen.ts (date 1660063120314) @@ -180,7 +180,7 @@ // may be null for single-screen simulations this.nameProperty = new Property( options.name, { - phetioType: Property.PropertyIO( NullableIO( StringIO ) ), + phetioValueType: NullableIO( StringIO ), tandem: instrumentNameProperty ? options.tandem.createTandem( 'nameProperty' ) : Tandem.OPT_OUT, phetioFeatured: true, phetioDocumentation: 'The name of the screen. Changing this value will update the screen name for the screen\'s ' + Index: main/axon/js/BooleanProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/BooleanProperty.ts b/main/axon/js/BooleanProperty.ts --- a/main/axon/js/BooleanProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/BooleanProperty.ts (date 1660064074802) @@ -13,13 +13,10 @@ import axon from './axon.js'; import Property, { PropertyOptions } from './Property.js'; -// constants -const BooleanPropertyIO = Property.PropertyIO( BooleanIO ); - type SelfOptions = EmptySelfOptions; // client cannot specify superclass options that are controlled by BooleanProperty -export type BooleanPropertyOptions = SelfOptions & StrictOmit, 'isValidValue' | 'valueType' | 'phetioType'>; +export type BooleanPropertyOptions = SelfOptions & StrictOmit, 'isValidValue' | 'valueType' | 'phetioValueType'>; export default class BooleanProperty extends Property { @@ -28,7 +25,7 @@ // Fill in superclass options that are controlled by BooleanProperty. const options = optionize>()( { valueType: 'boolean', - phetioType: BooleanPropertyIO + phetioValueType: BooleanIO }, providedOptions ); super( value, options ); Index: main/greenhouse-effect/js/common/model/ConcentrationModel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/greenhouse-effect/js/common/model/ConcentrationModel.ts b/main/greenhouse-effect/js/common/model/ConcentrationModel.ts --- a/main/greenhouse-effect/js/common/model/ConcentrationModel.ts (revision e8a69211a942af282bec0a871d2f1f5368b5a7ee) +++ b/main/greenhouse-effect/js/common/model/ConcentrationModel.ts (date 1660062794658) @@ -117,7 +117,7 @@ }, { tandem: tandem.createTandem( 'concentrationProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'The concentration value being used in the model, set via the slider or the date control.' } ); Index: main/density-buoyancy-common/js/common/model/Scale.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/density-buoyancy-common/js/common/model/Scale.ts b/main/density-buoyancy-common/js/common/model/Scale.ts --- a/main/density-buoyancy-common/js/common/model/Scale.ts (revision 5c6e725ab01e00ed562ade9649b0b5a99a4d6117) +++ b/main/density-buoyancy-common/js/common/model/Scale.ts (date 1660064074799) @@ -111,7 +111,7 @@ this.scaleForceInterpolatedProperty = new InterpolatedProperty( 0, { interpolate: InterpolatedProperty.interpolateNumber, - phetioType: InterpolatedProperty.InterpolatedPropertyIO( NumberIO ), + phetioValueType: NumberIO, tandem: config.tandem.createTandem( 'scaleForceInterpolatedProperty' ), units: 'N', phetioReadOnly: true @@ -125,7 +125,7 @@ return 0; } }, { - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, tandem: config.tandem.createTandem( 'scaleMeasuredMassProperty' ), units: 'kg', phetioReadOnly: true Index: main/geometric-optics/js/common/model/FramedImage.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/FramedImage.ts b/main/geometric-optics/js/common/model/FramedImage.ts --- a/main/geometric-optics/js/common/model/FramedImage.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/FramedImage.ts (date 1660062794637) @@ -112,7 +112,7 @@ // Not necessarily useful to iO clients, but very useful when verifying this algorithm. tandem: providedOptions.tandem.createTandem( 'opacityProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ) + phetioValueType: NumberIO } ); } } Index: main/geometric-optics/js/common/model/OpticalImage.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/OpticalImage.ts b/main/geometric-optics/js/common/model/OpticalImage.ts --- a/main/geometric-optics/js/common/model/OpticalImage.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/OpticalImage.ts (date 1660063119901) @@ -110,7 +110,7 @@ }, { units: 'cm', tandem: options.tandem.createTandem( 'imageDistanceProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'Horizontal distance between optic and image, where the sign has the following significance.

' + 'For a lens:' + '
    ' + @@ -137,7 +137,7 @@ } }, { tandem: options.tandem.createTandem( 'magnificationProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'Magnification of the optical image. Negative indicates that the image is inverted.' } ); @@ -154,13 +154,13 @@ }, { units: 'cm', tandem: options.tandem.createTandem( 'positionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO } ); this.opticalImageTypeProperty = new DerivedProperty( [ this.imageDistanceProperty ], imageDistance => ( imageDistance < 0 ) ? 'virtual' : 'real', { tandem: options.tandem.createTandem( 'opticalImageTypeProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( StringIO ), + phetioValueType: StringIO, validValues: OpticalImageTypeValues } ); Index: main/circuit-construction-kit-common/js/model/PowerDissipatedProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/PowerDissipatedProperty.ts b/main/circuit-construction-kit-common/js/model/PowerDissipatedProperty.ts --- a/main/circuit-construction-kit-common/js/model/PowerDissipatedProperty.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/PowerDissipatedProperty.ts (date 1660062794680) @@ -15,7 +15,7 @@ ( current, resistance ) => Math.abs( current * current * resistance ), { units: 'W', tandem: tandem, - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'The dissipated power in Watts' } ); } Index: main/geometric-optics/js/common/model/OpticalObject.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/OpticalObject.ts b/main/geometric-optics/js/common/model/OpticalObject.ts --- a/main/geometric-optics/js/common/model/OpticalObject.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/OpticalObject.ts (date 1660062794678) @@ -81,7 +81,7 @@ ( opticPosition, opticalObjectPosition ) => ( opticPosition.x - opticalObjectPosition.x ), { units: 'cm', tandem: options.tandem.createTandem( 'objectDistanceProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( NumberIO ), + phetioValueType: NumberIO, phetioDocumentation: 'horizontal distance from the optical object to the optic' } ); Index: main/axon/js/NumberProperty.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/axon/js/NumberProperty.ts b/main/axon/js/NumberProperty.ts --- a/main/axon/js/NumberProperty.ts (revision a1ac9dfbd09d8b7a4aca49a659fc7f913a04e1c9) +++ b/main/axon/js/NumberProperty.ts (date 1660064074806) @@ -48,7 +48,7 @@ rangePropertyOptions?: PropertyOptions; }; -export type NumberPropertyOptions = SelfOptions & StrictOmit, 'phetioType' | 'valueType'>; +export type NumberPropertyOptions = SelfOptions & StrictOmit, 'phetioValueType' | 'valueType'>; // Minimal types for ranged Properties - Generally use `new NumberPropery( ... ).asRanged()` export type RangedProperty = Property & { range: Range; readonly rangeProperty: IReadOnlyProperty }; @@ -88,7 +88,7 @@ // Defaults for rangePropertyOptions, since it depends on options.tandem options.rangePropertyOptions = optionize, EmptySelfOptions, PropertyOptions>()( { phetioDocumentation: 'provides the range of possible values for the parent NumberProperty', - phetioType: Property.PropertyIO( NullableIO( Range.RangeIO ) ), + phetioValueType: NullableIO( Range.RangeIO ), phetioReadOnly: true, tandem: options.tandem.createTandem( RANGE_PROPERTY_TANDEM_NAME ) }, options.rangePropertyOptions ); @@ -98,7 +98,7 @@ // client cannot specify superclass options that are controlled by NumberProperty options.valueType = 'number'; - options.phetioType = NumberProperty.NumberPropertyIO; + options.phetioValueType = NumberIO; const rangePropertyProvided = options.range && options.range instanceof ReadOnlyProperty; const ownsRangeProperty = !rangePropertyProvided; Index: main/geometric-optics/js/common/model/SecondPoint.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/geometric-optics/js/common/model/SecondPoint.ts b/main/geometric-optics/js/common/model/SecondPoint.ts --- a/main/geometric-optics/js/common/model/SecondPoint.ts (revision 62a85f9693ec73ffb4808bdacd8a0b99d6c3e729) +++ b/main/geometric-optics/js/common/model/SecondPoint.ts (date 1660063119864) @@ -61,7 +61,7 @@ ( framedObjectPosition, verticalOffset ) => framedObjectPosition.plusXY( 0, verticalOffset ), { tandem: options.tandem.createTandem( 'positionProperty' ), - phetioType: DerivedProperty.DerivedPropertyIO( Vector2.Vector2IO ) + phetioValueType: Vector2.Vector2IO } ); this.framedObjectPositionProperty = framedObjectPositionProperty; Index: main/circuit-construction-kit-common/js/model/Ammeter.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/main/circuit-construction-kit-common/js/model/Ammeter.ts b/main/circuit-construction-kit-common/js/model/Ammeter.ts --- a/main/circuit-construction-kit-common/js/model/Ammeter.ts (revision 2584d0dd01440a3790626c0bf9e613fbc684fed8) +++ b/main/circuit-construction-kit-common/js/model/Ammeter.ts (date 1660063119884) @@ -30,7 +30,7 @@ this.currentProperty = new Property( null, { tandem: tandem.createTandem( 'currentProperty' ), units: 'A', - phetioType: Property.PropertyIO( NullableIO( NumberIO ) ) + phetioValueType: NullableIO( NumberIO ) } ); this.probePositionProperty = new Vector2Property( Vector2.ZERO, { ```
samreid commented 2 years ago

I'm ready to start committing this change. Local unit tests, lint & type checking are passing. Spot checked sims are running ok in phet brand, phet-io brand and studio. Aqua is looking good so far.

samreid commented 2 years ago

All pushed. Merge conflicts in 3 repos, all resolved. This seems like a good change. Will monitor CT for trouble, but closing for now.

zepumph commented 2 years ago

Perhaps It would be worth a review over here. @samreid and I just noticed that we are no longer using NumberPropertyIO, which presumably has changed the API and needs to be fixed.

samreid commented 2 years ago

I fixed the known issue in NumberProperty, over to @zepumph for a closer review.

zepumph commented 2 years ago

https://github.com/phetsims/axon/blob/81f8b66cfc1186bdb6592c4585e22557041afa3e/js/ReadOnlyProperty.ts#L146

This seems like the most important part of the code, to catch future issues.

What do you think about this patch?

Index: js/NumberProperty.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/NumberProperty.ts b/js/NumberProperty.ts
--- a/js/NumberProperty.ts  (revision 3cdec990c755d9677bba2a5bf98b9e30b49aaa79)
+++ b/js/NumberProperty.ts  (date 1664923495533)
@@ -99,6 +99,7 @@
     // client cannot specify superclass options that are controlled by NumberProperty
     options.valueType = 'number';
     options.phetioOuterType = () => NumberProperty.NumberPropertyIO;
+    options.phetioValueType = NumberIO; // not actually used, but for completeness, don't have ReadOnlyProperty storing the wrong default.

     const rangePropertyProvided = options.range && options.range instanceof ReadOnlyProperty;
     const ownsRangeProperty = !rangePropertyProvided;
samreid commented 2 years ago

I liked the recommendation so much, I went ahead and committed it. Anything else to do for this issue?

zepumph commented 1 year ago

Can this be deleted now?

https://github.com/phetsims/axon/blob/c76a70cc8c4958e18c01d570fc0a2f5b5fb818a8/js/ReadOnlyProperty.ts#L146-L150

zepumph commented 1 year ago

Hmmm, now I'm not so sure, but I would like to discuss if this should have caught the error @pixelzoom reported in https://github.com/phetsims/studio/issues/286

samreid commented 1 year ago

I feel that new code is generally done in TypeScript, but it is easy enough to keep around that assertion longer "just in case". Also, https://github.com/phetsims/studio/issues/286 was about a missing phetioValueType rather than a provided phetioType so I feel this issue is OK to close. Anyone feel free to disagree/repoen.