-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Fix package layout inconsistencies #45491
Conversation
Netlify deploy previewhttps://deploy-preview-45491--material-ui.netlify.app/ Bundle size report |
fb0e736
to
d8ec7c5
Compare
👌
I'm not sure I fully understand, src/borders.js has a default export. It just looks like the declaration file that types this js file is missing a type for that. Don't we just need to fix src/borders.d.ts? index f6f3a6f9ba..e91d39b6ab 100644
--- a/packages/mui-system/src/borders/borders.d.ts
+++ b/packages/mui-system/src/borders/borders.d.ts
@@ -1,4 +1,4 @@
-import { PropsFor, SimpleStyleFunction, borders } from '../Box';
+import { PropsFor, SimpleStyleFunction, ComposedStyleFunction } from '../Box';
export const border: SimpleStyleFunction<'border'>;
export const borderTop: SimpleStyleFunction<'borderTop'>;
@@ -11,4 +11,27 @@ export const borderRightColor: SimpleStyleFunction<'borderRightColor'>;
export const borderBottomColor: SimpleStyleFunction<'borderBottomColor'>;
export const borderLeftColor: SimpleStyleFunction<'borderLeftColor'>;
export const borderRadius: SimpleStyleFunction<'borderRadius'>;
+export const outline: SimpleStyleFunction<'outline'>;
+export const outlineColor: SimpleStyleFunction<'outlineColor'>;
+
+declare const borders: ComposedStyleFunction<
+ [
+ typeof border,
+ typeof borderTop,
+ typeof borderRight,
+ typeof borderBottom,
+ typeof borderLeft,
+ typeof borderColor,
+ typeof borderTopColor,
+ typeof borderRightColor,
+ typeof borderBottomColor,
+ typeof borderLeftColor,
+ typeof borderRadius,
+ typeof outline,
+ typeof outlineColor,
+ ]
+>;
+
export type BordersProps = PropsFor<typeof borders>;
+
+export default borders; It looks like it's missing multiple exports in the declaration file. (And why are we importing utility types from We should probably just consider converting these to typescript instead of manually trying to keep declaration files in sync. |
@@ -15,13 +15,15 @@ export interface StyleOptions<PropKey> { | |||
themeKey?: string; | |||
transform?: TransformFunction; | |||
} | |||
export function style<PropKey extends string, Theme extends object>( |
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 default export in the .js file.
@@ -48,6 +48,8 @@ export { default as GlobalStyles } from './GlobalStyles'; | |||
export type { GlobalStylesProps } from './GlobalStyles'; | |||
|
|||
export * from './style'; | |||
export { default as style } from './style'; |
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 how it's exported in the .js file
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.
I updated the declaration files. We'll look into migrating to typescript separately.
I confirmed that the latest build in this PR fixes the issue 👌🏼 Thanks @Janpot! |
Fix two types issues discovered in mui/mui-x#16771:
@mui/utils/types
export couldn't be imported because it didn't follow theindex.d.ts
file patterntypes.ts
file into the anindex.ts
file insidetypes
folder (commit)