phetsims / arithmetic

"Arithmetic" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/arithmetic
GNU General Public License v3.0
5 stars 5 forks source link

Missing dependency for timeText's PatternStringProperty #202

Closed pixelzoom closed 5 months ago

pixelzoom commented 5 months ago

In https://github.com/phetsims/axon/issues/441 strictAxonDependencies was turned on for all sims.

In ScoreBoardNode:

    const timeText = new Text( new PatternStringProperty( LABEL_TIME_STRING_PROPERTY, {
        time: currentElapsedTimeProperty
      },
      {
        formatNames: [ 'time' ],
        maps: {
          time: time => GameTimer.formatTime( time )
        }
      } ), TEXT_OPTIONS );

There are 2 StringProperties used by GameTimer.formatTimer that are not included in dependencies. One way this could be resolved is by using DerivedStringProperty instead of PatternStringProperty.

In the meantime, https://github.com/phetsims/arithmetic/commit/3b8b9e4c3f324a58b1f97b452e9e75bff99e5115 adds strictAxonDependencies: false to this PatternStringProperty to opt out.

pixelzoom commented 5 months ago

The missing dependencies that appear in GameTimer.formatTime are:

jbphet commented 5 months ago

Fixed using the DerivedStringProperty approach suggested above. Closing.