-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[core] Allow deeper import of @mui/utils #38806
Changes from 2 commits
a73ca99
48cb743
bc15e4b
c656dac
1d4dadf
b6cdc94
b87e4b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,13 +67,6 @@ module.exports = { | |
{ | ||
patterns: [ | ||
'@mui/*/*/*', | ||
// Begin block: Packages with files instead of packages in the top level | ||
// Importing from the top level pulls in CommonJS instead of ES modules | ||
// Allowing /icons as to reduce cold-start of dev builds significantly. | ||
// There's nothing to tree-shake when importing from /icons this way: | ||
// '@mui/icons-material/*/', | ||
'@mui/utils/*', | ||
// End block | ||
// Macros are fine since their import path is transpiled away | ||
'!@mui/utils/macros', | ||
'@mui/utils/macros/*', | ||
|
@@ -333,7 +326,7 @@ module.exports = { | |
'error', | ||
{ | ||
patterns: [ | ||
// Allow deeper imports for TypeScript types. TODO? | ||
// Allow deeper imports for TypeScript types. TODO remove | ||
'@mui/*/*/*/*', | ||
Comment on lines
-336
to
330
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Types should be exposed at the same level as the other modules. |
||
// Macros are fine since they're transpiled into something else | ||
'!@mui/utils/macros/*.macro', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
declare function integerPropType( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this related to the rest of this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
props: { [key: string]: any }, | ||
propName: string, | ||
componentName: string, | ||
location: string, | ||
propFullName: string, | ||
): Error | null; | ||
|
||
declare namespace integerPropType { | ||
let isRequired: PropTypes.Validator<number>; | ||
} | ||
|
||
export default integerPropType; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// Actual .ts source files are transpiled via babel | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"composite": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Almost the only package without this flag on https://www.typescriptlang.org/docs/handbook/project-references.html#composite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should aim to introduce this flag on all our projects (after we deal with circular references) to speed up the build times. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I wrote a typo: |
||
"declaration": true, | ||
"noEmit": false, | ||
"emitDeclarationOnly": true, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the pattern we want to allow, removing.