Skip to content

[RFC] Remove typings for @material-ui/core/es #14392

@eps1lon

Description

@eps1lon

Disclaimer: This can only break builds for typescript users. VSCode JS users will loose some intellisense.

We're currently duplicating our type declarations for the /es build folder to support
type definitions for imports like import Button from '@material-ui/core/es/Button'.

I propose the get rid of this duplication to reduce download size of this package and improve the typescript experience for codesandbox. Codesandbox is currently bailing out of type acquisition because it detects to many type declaration files.

This does not mean that explicit imports from the /es build are not supported anymore. Typescript/VSCode users would only have to add the following path alias to their tsconfig/jsconfig:

"paths": {
  "@material-ui/core/es*": ["@material-ui/core/*"]
}

I'm aware that this is not working for [email protected]. See facebook/create-react-app#5645

I would file this under "advanced build scenarios". The /es build does not support our supported platforms anyway and likely requires additional transpilation steps depending on your target. It shouldn't be part of your import paths and rather aliased (and processed) in your build pipeline.

/cc @mui-org/core-contributors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions