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

[material-ui] Update TypeScript supports in v6 #40996

Open
oliviertassinari opened this issue Feb 7, 2024 · 1 comment
Open

[material-ui] Update TypeScript supports in v6 #40996

oliviertassinari opened this issue Feb 7, 2024 · 1 comment
Assignees
Labels
breaking change package: base-ui Specific to @mui/base package: material-ui Specific to @mui/material package: system Specific to @mui/system

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 7, 2024

Summary

We likely can increase the minimum version of TypeScript supported: https://mui.com/material-ui/getting-started/supported-platforms/#typescript. I don't know about how much but likely some level.

Related issue with TypeScript support (which could indicate how far down we need to support TypeScript in terms of versions)

Examples

No response

Motivation

No response

Search keywords: TypeScript minimum version

@oliviertassinari oliviertassinari added breaking change package: system Specific to @mui/system package: material-ui Specific to @mui/material status: waiting for maintainer These issues haven't been looked at yet by a maintainer package: base-ui Specific to @mui/base labels Feb 7, 2024
@oliviertassinari oliviertassinari added this to the Material UI: v6 milestone Feb 7, 2024
@danilo-leal danilo-leal removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 5, 2024
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Apr 20, 2024

Base UI is in theory not allowed to do this in its latest version: https://github.com/mui/base-ui/blob/4a4ccebd750dea6252cfdc07c55eb4ea474eaebe/packages/mui-base/src/index.ts#L16 cc @atomiks for context (Base UI version range can only be wider than Material UI since it's a dependency)

It breaks https://mui.com/material-ui/getting-started/supported-platforms/#typescript because this was only added in v4.5: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names.

So 👍 on my end to at the very least bump TypeScrpt min version support from v3.5 to v3.8 to get access to https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html. It's actually already broken today in Material UI and I didn't see issues about it.

Also worth looking at: https://tools-public.mui.com/prod/pages/npmVersion?package=typescript. It looks like we could bump this to at least v4.0:

SCR-20240421-cfvv

Should we maybe go to v4.5 to get import { type Foo }? I don't know. It's already old: https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/. So maybe we could say:

3.8 was released February 20th, 2020. Material UI v5 was released Sep 16, 2021. We could hence pick the TypeScript version that is 18 months old: TypeScript 4.9.

If we instead uses https://github.com/DefinitelyTyped/DefinitelyTyped?tab=readme-ov-file#support-window

SCR-20240421-ckvs

we would then go with v4.8. I guess it's the simplest we can do? What we already say we do in the docs:

Material UI requires a minimum version of TypeScript 3.5. This aims to match the policy of DefinitelyTyped, with the support of the versions of TypeScript that are less than two years old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change package: base-ui Specific to @mui/base package: material-ui Specific to @mui/material package: system Specific to @mui/system
Projects
Status: Selected
Development

No branches or pull requests

3 participants