-
Notifications
You must be signed in to change notification settings - Fork 2
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
Convert common code to Typescript #1096
Comments
My few experiences converting common-code to TS have been (mostly) smooth. The one thing I bump into all the time is how to handle options. For example, AquaRadioButtonGroup is a subclass of LayoutBox, so conversion should look like: type AquaRadioButtonGroupOptions = Omit< LayoutBoxOptions, 'children' >;
class AquaRadioButtonGroup<T> extends LayoutBox {
constructor( property: Property<T>, items: AquaRadioButtonGroupItem<T>[], options?: AquaRadioButtonGroupOptions ) { But LayoutBox has not been converted to TS, and LayoutBoxOptions does not exist. So I did this in the meantime: //TODO https://github.com/phetsims/phet-core/issues/128 replace any with LayoutBoxOptions, when it exists
type AquaRadioButtonGroupOptions = Omit< any, 'children' >; So it seems like we should give highest priority to converting more sim-facing scenery types. |
Yes understood, in the quarterly goals we decided that #1097 was a precursor to this issue. I marked phetsims/phet-core#128 as high priority to try to unblock these conversions as quickly as possible. |
From 1/27/22 dev meeting: We checked in on this and @zepumph recommended we hold off until more Design Pattern work (like options patterns) is completed. We're thinking ~3 weeks will be a good timeline. |
As of dev meeting today, @jonathanolson has been converting a lot of scenery, simula-rasa is in typescript. Joist seems important to do before converting much sim code. How to limit technical debt as we get to some files but not others.
@jonathanolson will sprint on scenery conversions to help aid other common code for later in the quarter. @samreid: We are not going to be done with this issue when our quarterly hours are up, and that's ok. @samreid: what if we convert all files to |
Thinking this through a bit more, currently 99% of my (or maybe everyone’s) any are the “todo” type. Maybe it would be better to be explicit about when an any is supposed to be any. We could call it ANY_BY_DESIGN or INTENTIONAL_ANY . That seems a better match for where we are at. I’ll also comment this in the issue. |
|
Using it in some mixins above. |
IntentionalAny has been working great, thanks! |
From quarterly checkin today:
|
From today's typescript conversion: SR: It has been helpful for me to convert common code as I run into it while developing my sims. We will create an issue to convert Dialog and Popupable. Status of conversion in lines of code: We are not complete with TS conversion, but this issue has run it's course. We are calling this sprint complete, and are ready to close. |
Devs- JO(20), JG(20), CM(20), JB(40), SR(40), CK(20), MK(8)
*Design Pattern work happens ahead of this work
Priority
Proactive conversions
scenery-phet items in typescript sims:
sun items in typescript sims:
scenery items in any typescript file:
The text was updated successfully, but these errors were encountered: