Skip to content

[code-infra] Convert @mui/utils to typescript #45671

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

Merged
merged 10 commits into from
Apr 9, 2025

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 25, 2025

Trying to get a feel on how we can leverage Claude code to help us finish the typescript migration

Prompt (inside packages/mui-utils):

This folder contains a package that is in transition from js to ts. Some of the files are written in plain js and have an accompanying .d.ts file. it is your task to finish the conversion. concretely, in ./src, you must rename the .js files to .ts(x) (use git mv), then look at the content of the relevant .d.ts file and integrate its types into the freshly created ts file. It's important that functionally everything stays the same, meaning after type erasure, the ts file needs to be exactly the same as the original js file. and the exported types must be equal to the original .d.ts files. you can fix type issues local to each file (pnpm typescript runs a type checker). you don't need to keep the .d.ts files

Next time, need to make it clearer that it's not supposed to functionally change the code. It's only allowed to operate at the type level. Also need to explain that some js files contain jsx, so these need to get a tsx extension. It did get somewhat trigger happy altering code, so had to carefully review and make a lot of tweaks.

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Mar 25, 2025
@mui-bot
Copy link

mui-bot commented Mar 25, 2025

Netlify deploy preview

https://deploy-preview-45671--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 5fcc5d4

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 25, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 25, 2025
@Janpot Janpot changed the title [code-infra] Convert some utils to typescript [code-infra] Convert @mui/utils to typescript Mar 25, 2025
@Janpot Janpot marked this pull request as ready for review March 25, 2025 16:43
@Janpot Janpot requested a review from a team March 25, 2025 16:43
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 9, 2025
@Janpot Janpot merged commit 6effcbb into mui:master Apr 9, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants