Skip to content

Convert to TypeScript#308

Merged
wilkie merged 9 commits into
mainfrom
convert-to-typescript
May 21, 2026
Merged

Convert to TypeScript#308
wilkie merged 9 commits into
mainfrom
convert-to-typescript

Conversation

@wilkie
Copy link
Copy Markdown
Contributor

@wilkie wilkie commented Apr 9, 2026

Uses the strict TypeScript config in /frontend/packages/lint-config to get this repo locked to the same TypeScript and TS linting situation as the main repo.

This also converts function MyComponent({}) { } into const MyComponent = ({}: MyComponentProps) => { }

Snuck an upgrade to fontawesome which just updated the package.json/yarn.lock.

2026-04-09.14-54-52.mp4

@wilkie wilkie changed the base branch from main to switch-to-function-components April 9, 2026 05:41
@wilkie wilkie changed the title Convert to typescript Convert to TypeScript Apr 9, 2026
Copy link
Copy Markdown
Member

@stephenliang stephenliang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor nits, all of which are probably considered stylistic or out of scope for this PR (error handling scenarios). However I do think we can possibly avoid a type cast in the dispatcher.

Comment thread src/UIComponents/DataCard.tsx Outdated
Comment thread src/UIComponents/DataTable.tsx
Comment thread src/UIComponents/GenerateResults.tsx
Comment thread src/UIComponents/ModelCard.tsx Outdated
Copy link
Copy Markdown
Member

@stephenliang stephenliang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I think you need to also add a typecheck script. If I run typecheck manually, it seems to error.

npx tsc

throws quite a number of type errors.

@wilkie wilkie changed the base branch from switch-to-function-components to main May 21, 2026 00:45
@wilkie
Copy link
Copy Markdown
Contributor Author

wilkie commented May 21, 2026

I have rebased, added a yarn typecheck command, added the necessary type declarations, and addressed many of the weird situations from the old codebase where functions return null only to be assumed not-null by consumers later that the TypeScript port revealed (and the AI just... allowed for some reason.) I'm testing it and will push it up and then probably merge it and move toward the localization fixes we need for CSD and also introducing this to the main repo.

@wilkie wilkie force-pushed the convert-to-typescript branch from 3dd08be to 5303ee1 Compare May 21, 2026 01:20
@wilkie
Copy link
Copy Markdown
Contributor Author

wilkie commented May 21, 2026

Added prettier config to match the main repo and just had it 'fix' everything. Now it should conform 99% to what the frontend packages directory wants.

The empty string is so that the function is always typed to a string
since everything downstream just expects it to be a string anyway. This
is still falsey and I don't think it can ever be undefined anyway.
@wilkie
Copy link
Copy Markdown
Contributor Author

wilkie commented May 21, 2026

I confirmed that all of the modes work, the metrics fire, and the animations seem to be correct. No major issues, certainly.

@wilkie wilkie merged commit 3d277f8 into main May 21, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants