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

[styles] Fix createStyles for TypeScript v3.5 #15990

Merged
merged 2 commits into from Jun 3, 2019

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented May 31, 2019

For TypeScript v3.5 P has to extend {} instead of object
See #15942
and microsoft/TypeScript#31735

Closes #15942

@mui-pr-bot
Copy link

mui-pr-bot commented May 31, 2019

No bundle size changes comparing b3cace6...3a1a263

Generated by 🚫 dangerJS against 3a1a263

@eps1lon
Copy link
Member

eps1lon commented Jun 1, 2019

Could you link to the part in the devblog that talks about object vs {}?

@eps1lon eps1lon added package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. typescript labels Jun 1, 2019
@merceyz
Copy link
Member Author

merceyz commented Jun 1, 2019

It's the first item in breaking changes, can't link to it but search for

As a workaround, you can add an explicit constraint of {} to a type parameter to get the old behavior

@eps1lon
Copy link
Member

eps1lon commented Jun 3, 2019

I don't understand how these breaking changes relate to this change. The breaking change is talking about unconstrained generic arguments. The generic arguments in createStyles are constrained however.

This sounds like either a bug in TS or an undocumented breaking change. I'll look through the issues and see if I can find a minimal example for the changed behavior.

@eps1lon eps1lon added on hold There is a blocker, we need to wait and removed on hold There is a blocker, we need to wait labels Jun 3, 2019
@eps1lon eps1lon merged commit f4dc7bb into mui:master Jun 3, 2019
@eps1lon
Copy link
Member

eps1lon commented Jun 3, 2019

@merceyz Thanks for looking into this!

@merceyz merceyz deleted the styles/createStyles branch June 3, 2019 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript 3.5 causes makeStyles problem
3 participants