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

[typescript] Fix theme overrides type failing #1873

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

bopfer
Copy link
Contributor

@bopfer bopfer commented Jun 9, 2020

Closes #1858

@vercel
Copy link

vercel bot commented Jun 9, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mui-org/material-ui-pickers/r71a3z33i
✅ Preview: https://material-ui-pickers-git-fork-bopfer-feature-fix-override-types.mui-org.now.sh

@cypress
Copy link

cypress bot commented Jun 9, 2020



Test summary

78 0 1 0


Run details

Project material-ui-pickers
Status Passed
Commit fe0930a
Started Jun 9, 2020 3:37 PM
Ended Jun 9, 2020 3:39 PM
Duration 01:30 💡
OS Linux Debian - 10.0
Browser Chrome 80

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@oliviertassinari
Copy link
Member

@bopfer Awesome, thanks for opening a standalone pull request.

It appears that something is wrong with the CI on the pickers repository. If I apply this diff in the main repository:

diff --git a/packages/material-ui/src/styles/overrides.d.ts b/packages/material-ui/src/styles/overrides.d.ts
index fe4dab79e..707323f0e 100644
--- a/packages/material-ui/src/styles/overrides.d.ts
+++ b/packages/material-ui/src/styles/overrides.d.ts
@@ -144,7 +144,7 @@ export interface ComponentNameToClassKey {
   MuiExpansionPanelDetails: ExpansionPanelDetailsClassKey;
   MuiExpansionPanelSummary: ExpansionPanelSummaryClassKey;
   MuiFab: FabClassKey;
-  MuiFilledInput: FilledInputClassKey;
+  MuiFilledInput?: FilledInputClassKey;
   MuiFormControl: FormControlClassKey;
   MuiFormControlLabel: FormControlLabelClassKey;
   MuiFormGroup: FormGroupClassKey;

and run yarn typescript, I get the following error:

' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

the same one that was reported on the linked issue: #1858.
This sounds like a new argument in favor of increasing the priority of mui/material-ui#19706.

Do we have any idea on how we could update the CI in the pickers to catch the problem in the first place? It could be interesting to figure out in order to further align pickers with the main repo, I would fear we either introduce regression until them migration is completed and that we have other similar cases like this on in the pickers repository.

@oliviertassinari oliviertassinari changed the title Remove the possibility of undefined from the overrides [typescript] Fix theme overrides type failing Jun 9, 2020
@dmtrKovalenko
Copy link
Member

I am not sure why the problem appears – our tests are telling us that everything works fine. Just checked it with up-to-date next https://github.com/mui-org/material-ui-pickers/blob/6cde0eaf11531d10667d9f4d78bbcb9b3d51763f/lib/src/__tests__/typescript/Overrides.tsx#L4

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 12, 2020

Yeah, I think that there is an issue with how the TypeScript runs in the pickers repository. I came to this conclusion after looking at the behavior on the main repository and the reproduction example.

Maybe it has something to do with the options we give to TypeScript here, and how strict we are with the soundness?

@dmtrKovalenko
Copy link
Member

our version is v3.9.3 and everything is as strict as possible.
Needs to investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript overrides are not working with v4.0.0-alpha.8
3 participants