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

[Box] Fix usage of not supported features in TypeScript 3.5 #35877

Merged
merged 1 commit into from Jan 20, 2023

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Jan 19, 2023

Fixes #35860. This is a regression from #35532, as ReturnType is not supported in TypeScript 3.5

@mnajdova mnajdova added typescript component: Box The React component. regression A bug, but worse labels Jan 19, 2023
@mui-bot
Copy link

mui-bot commented Jan 19, 2023

Messages
📖 Netlify deploy preview: https://deploy-preview-35877--material-ui.netlify.app/

No bundle size changes

Generated by 🚫 dangerJS against 83dde61

@mnajdova mnajdova marked this pull request as ready for review January 19, 2023 20:40
@michaldudak
Copy link
Member

We definitely should have a test suite for old TS versions, as these errors are pretty hard to spot during reviews. It happened a few times before that we shipped something that wasn't supported in 3.5.

@mnajdova mnajdova merged commit 628b532 into mui:master Jan 20, 2023
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Jan 21, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 21, 2023

ReturnType is not supported in TypeScript 3.5

@mnajdova ReturnType is supported since v2.8 according to https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#predefined-conditional-types.

The issue seems to be with how we called createBox<MaterialTheme>: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#instantiation-expressions.

I have added this as an idea for #30660.

@pH-7
Copy link

pH-7 commented Jan 22, 2023

ReturnType is not supported in TypeScript 3.5

@mnajdova ReturnType is supported since v2.8 according to https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#predefined-conditional-types.

The issue seems to be with how we called createBox<MaterialTheme>: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#instantiation-expressions.

I have added this as an idea for #30660.

That's correct. And as my project was running on TS v4.2.4, upgrading to TS v4.7+ will do it.

@mnajdova
Copy link
Member Author

mnajdova commented Feb 8, 2023

The issue seems to be with how we called createBox: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#instantiation-expressions.

I see, nice to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: Box The React component. regression A bug, but worse typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS1109: Expression expected in Box.d.ts
5 participants