phetsims / build-an-atom

"Build an Atom" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/build-an-atom
GNU General Public License v3.0
11 stars 10 forks source link

Remove Tandem.GroupTandem and previous state pattern #221

Closed samreid closed 3 years ago

samreid commented 3 years ago

From https://github.com/phetsims/tandem/issues/87, we need to eliminate usages of createGroupTandem. Things should be converted to use PhetioGroup if necessary. I'll follow the instrumentation guide:

Here is an ordered list of how to approach instrumenting an element that is dynamically created:

  1. Does it even need instrumentation? Often instances don't need to be instrumented, or can perhaps be instrumented as a component of their parent (instead of being instrumented themselves)
  2. Can it be created eagerly? Allocating dynamic elements on startup simplifies the instrumentation process, especially when supporting PhET-iO state and API validation.
  3. Instrument the object dynamically, using PhetioGroup or PhetioCapsule. Use PhetioCapsule for single dynamic instances. Use PhetioGroup for multiple instances of the same type. If you have a use case that is not addressed by one or both of those, then please consult with the PhET-iO subteam, and potentially create a new IO Type suitable for your simulation.
samreid commented 3 years ago

For the last commit "opt out", I specified Tandem.OPT_OUT for the 2 primary containers. The game is not currently added for PhET-iO, nor is it running for PhET-iO. I think when we instrument the game fully it will need more consideration. But for now to move https://github.com/phetsims/tandem/issues/87 along, I used OPT_OUT, but left them as marker for the spots that may need attention during game instrumentation. That's everything for this issue, unless @zepumph wants to reopen for review.