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

[charts] Remove outdated prop-types #10998

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Nov 10, 2023

Fixes #10989

The current fix ignores proptypes generated by react-spring. Maybe we could find a better solution. Did not went to far into props generation scripts

@alexfauquette alexfauquette added the component: charts This is the name of the generic UI component, not the React module! label Nov 10, 2023
@mui-bot
Copy link

mui-bot commented Nov 10, 2023

Deploy preview: https://deploy-preview-10998--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against f60798f

@akamfoad
Copy link
Contributor

@alexfauquette

The default exports aren't the only exports in the changed files, there are named and type exports as well, here is the diff patch you could apply that fixes the issues:

diff --git a/packages/x-charts/src/PieChart/PieArcLabelPlot.tsx b/packages/x-charts/src/PieChart/PieArcLabelPlot.tsx
index af9460b98..2e5b903ab 100644
--- a/packages/x-charts/src/PieChart/PieArcLabelPlot.tsx
+++ b/packages/x-charts/src/PieChart/PieArcLabelPlot.tsx
@@ -11,7 +11,7 @@ import {
   ValueWithHighlight,
   useTransformData,
 } from './dataTransform/useTransformData';
-import PieArcLabel, { PieArcLabelProps } from './PieArcLabel';
+import { PieArcLabel, PieArcLabelProps } from './PieArcLabel';
 import { DefaultizedProps } from '../models/helpers';
 
 const RATIO = 180 / Math.PI;
diff --git a/packages/x-charts/src/PieChart/PieArcPlot.tsx b/packages/x-charts/src/PieChart/PieArcPlot.tsx
index d4565ef4d..b74d4efed 100644
--- a/packages/x-charts/src/PieChart/PieArcPlot.tsx
+++ b/packages/x-charts/src/PieChart/PieArcPlot.tsx
@@ -1,6 +1,6 @@
 import * as React from 'react';
 import { useTransition } from '@react-spring/web';
-import PieArc, { PieArcProps } from './PieArc';
+import { PieArc, PieArcProps } from './PieArc';
 import {
   DefaultizedPieSeriesType,
   DefaultizedPieValueType,
diff --git a/packages/x-charts/src/PieChart/index.tsx b/packages/x-charts/src/PieChart/index.tsx
index 9c0799db3..2eb39ce13 100644
--- a/packages/x-charts/src/PieChart/index.tsx
+++ b/packages/x-charts/src/PieChart/index.tsx
@@ -1,4 +1,18 @@
 export { PiePlot } from './PiePlot';
 export { PieChart } from './PieChart';
-export { PieArcLabel } from './PieArcLabel';
-export { PieArc } from './PieArc';
+export {
+  PieArcLabel,
+  type PieArcLabelClassKey,
+  type PieArcLabelClasses,
+  type PieArcLabelProps,
+  getPieArcLabelUtilityClass,
+  pieArcLabelClasses,
+} from './PieArcLabel';
+export {
+  PieArc,
+  type PieArcClassKey,
+  type PieArcClasses,
+  type PieArcProps,
+  getPieArcUtilityClass,
+  pieArcClasses,
+} from './PieArc';

Confirmed by running yarn typescript:ci, all tests are green locally on my side

Comment on lines +3 to +6
export { PieArcLabel, getPieArcLabelUtilityClass, pieArcLabelClasses } from './PieArcLabel';
export type { PieArcLabelClassKey, PieArcLabelClasses, PieArcLabelProps } from './PieArcLabel';
export { PieArc, getPieArcUtilityClass, pieArcClasses } from './PieArc';
export type { PieArcClassKey, PieArcClasses, PieArcProps } from './PieArc';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing that to avoid breaking change, but not sure it's worth exporting them. For example, BarElements are not exported.

When doing cherry pick I would just remove the export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants