-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up tandemNameSuffix
and delete TANDEM_NAME_SUFFIX
.
#310
Comments
Thanks for bringing this to my attention. I was unaware of cases where those suffixes are used to create the tandems, like: I had been leveraging |
I agree, that is its main value, to provide tandemName standardization for PhET-iO.
Agreed there too -- that's a really valuable search that I do all the time. So I think I'll avoid using That said... I'm wondering if we should make |
In the above commits, I replaced all usages of There are only 3 sim remaining uses of There are only 4 classes that define
|
Yikes. In RectangularRadioButton.ts we have: public static readonly TANDEM_NAME_SUFFIX = 'RadioButton';
....
tandemNameSuffix: 'Button',
...
assert && assert( !options.tandem.supplied || options.tandem.name.endsWith( RectangularRadioButton.TANDEM_NAME_SUFFIX ),
`RectangularRadioButton tandem.name must end with ${RectangularRadioButton.TANDEM_NAME_SUFFIX}: ${options.tandem.phetioID}` ); All of the above should be replaced with: tandemNameSuffix: 'RadioButton', Almost as bad in AquaRadioButton: public static readonly TANDEM_NAME_SUFFIX = 'RadioButton';
...
tandemNameSuffix: 'RadioButton',
...
assert && assert( !options.tandem.supplied || options.tandem.name.endsWith( AquaRadioButton.TANDEM_NAME_SUFFIX ),
`AquaRadioButton tandem.name must end with ${AquaRadioButton.TANDEM_NAME_SUFFIX}: ${options.tandem.phetioID}` ); |
@samreid and I discussed. Most common-code is using I'm going to take over this issue, transfer it to the tandem repo (the home of the To support ProfileColorProperty's arrow of valid suffixes, I'll investigated changing to I'll also look at cleaning up sun buttons, where |
tandemNameSuffix
and delete TANDEM_NAME_SUFFIX
.
This work is done. Option ReadOnlyProperty and Dialog were a little tricky, because they needed to handle archetypes: // ReadOnlyProperty.ts
tandemNameSuffix: [ 'Property', DYNAMIC_ARCHETYPE_NAME ], // DYNAMIC_ARCHETYPE_NAME means that this Property is an archetype.
// Diaog.ts
tandemNameSuffix: [ 'Dialog', DYNAMIC_ARCHETYPE_NAME ], // DYNAMIC_ARCHETYPE_NAME means that this Dialog is an archetype. There are only 2 places where I was unabled to get rid of (1) In ComboBox, we need (2) @samreid Would you like to have a look? Close if OK. |
I reviewed the commits and the notes, and everything seems good to me. Nice work and thanks. Closing. |
For code review phetsims/projectile-data-lab#32 ...
Common-code things that have a required tandemName suffix provide
TANDEM_NAME_SUFFIX
. E.g.RectangularRadioButton.TANDEM_NAME_SUFFIX
.This sim has zero uses of
TANDEM_NAME_SUFFIX
. Lots of examples where it could be used, here are a few. Search for "tandemName: " and "createTandem" and you'll find more.I'm on the fence about the importance of using
TANDEM_NAME_SUFFIX
to form tandem names, and whether that's actually even whatTANDEM_NAME_SUFFIX
should be used for. I know that I have not used it consistently, and I've never usedReadonlyProperty.TANDEM_NAME_SUFFIX
. If we ever need to change a suffix, it will be less painful if we useTANDEM_NAME_SUFFIX
. But the combined pain (and verbosity) of having to useTANDEM_NAME_SUFFIX
is probably greater than the one-time pain of changing some suffix.Anyway... You decide.
The text was updated successfully, but these errors were encountered: