Open zepumph opened 1 year ago
Please note https://github.com/phetsims/phet-info/blob/master/doc/typescript-conventions.md#L19. And we should probably go through the options and enums patterns together.
After discussing with @matthew-blackman, I decided to convert a single model/view pair as reference. Here are some notes about my conversion:
ParentOptions
pattern we discussed all to briefly this morning.I'm excited to discuss further!
The common model/view is fully converted, so I think this may be a good time for a code review before the final conversion push @zepumph
Overall things are looking really really good. Thanks for all the hard work here, it is really helping me to understand the sim code.
* {
will help find the rest.providedOptions:
should be providedOptions?:
, but I'll let you confirm for each case.range
used anywhere.merge
should instead by combineOptions
to keep type safety.public
to private
in the whole repo and see how many errors you get. That may help find spots where you missed a private thing. Note though that it is possible to find something with no usages publicly that you still want to be public, but most often that happens in common code, and not sim-specific stuff.satisfies
would be nice in ProjectileMotionConstants when it is clearly an options block for a particular type's options.UPDATE: 1/11/23
Thanks for all the good work. I definitely went fast and could have missed some stuff. I'd say stay diligent as you go through these items and feel free to convert the rest. I also think we likely want another issue to try to tease out the options type where we were mixing things in ProjectileMotionUIOptions. Likely a separate issue, and I believe you will run into that much much more in the specific screen code. Thanks!
@matthew-blackman has said the conversion to TypeScript is partway done, and I see lots of great review recommendations above. Also, this sim is in a sprint team for this sprint, so I think will get appropriate attention. Thus, removing the ready-for-review label for now.
Wahoo!