Skip to content
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 to typescript #404

Closed
zepumph opened this issue Oct 19, 2021 · 20 comments
Closed

Convert to typescript #404

zepumph opened this issue Oct 19, 2021 · 20 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Oct 19, 2021

Discussed during quarterly planning last week, every developer is to take on converting a sim to typescript to take the new language for a test drive. Since this sim is my next sim I'm going to be working on (for voicing), I will start here, and with https://github.com/phetsims/chipper/blob/master/doc/typescript-quick-start.md. My expectation is that it will take one day (8 hours).

Note phetsims/tasks#1096

@zepumph
Copy link
Member Author

zepumph commented Oct 19, 2021

Big work that I'm putting off right now:

  • adding types out stateObject outputs, for example, NumberIO returns a number, but sometimes a string too.

@zepumph
Copy link
Member Author

zepumph commented Oct 19, 2021

I started with about 1350 compiler errors when converting all resources to *.ts. After completing the model, I'm down to 1100, and with strict mode off, its 888. I'm going to commit to a branch to start.

zepumph added a commit that referenced this issue Oct 19, 2021
zepumph added a commit to phetsims/tambo that referenced this issue Oct 20, 2021
zepumph added a commit that referenced this issue Oct 20, 2021
zepumph added a commit that referenced this issue Oct 20, 2021
@zepumph
Copy link
Member Author

zepumph commented Oct 21, 2021

After the above commits, I am down to 500 compile errors.

@zepumph
Copy link
Member Author

zepumph commented Oct 21, 2021

So far, I have found ~3 actual bugs (boolean passed in for number, or null for number, etc), and about 5-10 cleanup pieces, like extra parameters passed in that were ignored.

zepumph added a commit that referenced this issue Oct 21, 2021
zepumph added a commit to phetsims/axon that referenced this issue Oct 21, 2021
zepumph added a commit that referenced this issue Oct 21, 2021
zepumph added a commit that referenced this issue Oct 22, 2021
zepumph added a commit to phetsims/scenery that referenced this issue Oct 23, 2021
@zepumph
Copy link
Member Author

zepumph commented Oct 23, 2021

Branch merged, lint and ts compile errors have been either fixed or worked around.

@zepumph
Copy link
Member Author

zepumph commented Jan 24, 2022

There are still a fair number of usage of merge that I kept around because the supertype isn't in typescript yet. I thought that was easiest. I also got rid of a bunch of ts-ignore usages. All that are left are from old-style mixins.

@zepumph
Copy link
Member Author

zepumph commented Feb 28, 2022

010ffb4 was a documentation and general Typescript review. I haven't updated options, ts-ignores, TODOs or anys just yet.

@zepumph
Copy link
Member Author

zepumph commented Feb 28, 2022

Ok, I have done all the optionize that I can do at this time. I'll wait for more common code to be converted.

Other TODOs will be discussed during this week's dev meeting.

zepumph added a commit to phetsims/phet-info that referenced this issue Mar 23, 2022
@zepumph
Copy link
Member Author

zepumph commented Mar 23, 2022

Ok! I got rid of many TODOs here, still some remain as common code is not yet in typescript yet (SoundClip, SoundGenerator, ScreenIcon, KeyboardHelpSection).

@zepumph
Copy link
Member Author

zepumph commented Mar 28, 2022

A couple more TODOs taken care of here since SoundClip and SoundGenerator are now typescript.

zepumph added a commit that referenced this issue Mar 28, 2022
samreid pushed a commit to phetsims/phet-info that referenced this issue Apr 23, 2022
@zepumph
Copy link
Member Author

zepumph commented Apr 27, 2022

The only thing left for this issue is to convert KeyboardHelpSection code to typescript once those common code types are complete.

@zepumph
Copy link
Member Author

zepumph commented Apr 28, 2022

New convention to adopt: initialize in the declaration site when possible.

pixelzoom added a commit that referenced this issue Jul 22, 2022
pixelzoom added a commit to phetsims/scenery-phet that referenced this issue Jul 22, 2022
zepumph added a commit that referenced this issue Jul 22, 2022
@zepumph
Copy link
Member Author

zepumph commented Aug 11, 2022

New convention to adopt: initialize in the declaration site when possible.

I went through all files. Closing!

@zepumph zepumph closed this as completed Aug 11, 2022
zepumph added a commit that referenced this issue Aug 11, 2022
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant