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

[base-ui] Update props using Array to ReadonlyArray type #40754

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

RaghavenderSingh
Copy link
Contributor

@RaghavenderSingh RaghavenderSingh commented Jan 23, 2024

I have followed (at least) the PR section of the contributing guide.

Replaced Array API with ReadonlyArray
Closes #40750

@mui-bot
Copy link

mui-bot commented Jan 23, 2024

Netlify deploy preview

https://deploy-preview-40754--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 94e86ae

@danilo-leal danilo-leal added the package: base-ui Specific to @mui/base label Jan 23, 2024
@danilo-leal danilo-leal changed the title fix for API use Array while using ReadonlyArray would be better [base-ui] Change APIs using Array to ReadonlyArray Jan 23, 2024
@DiegoAndai
Copy link
Member

Hey @RaghavenderSingh, thanks for working on this 😊. Before reviewing, please fix the failing build checks.

@RaghavenderSingh
Copy link
Contributor Author

Hey @RaghavenderSingh, thanks for working on this 😊. Before reviewing, please fix the failing build checks.

Yea sure will fix the failing build checks.

@ZeeshanTamboli
Copy link
Member

Since this PR predates a similar one (#40760) created to address the same issue (#40750), perhaps we should prioritize reviewing this one instead.

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

There are couple more occurrences of a mutable arrays in Base UI that could be changed to ReadonlyArray. Search for [] in ./packages/mui-base/**/*.types.ts

packages/mui-base/src/useSlider/useSlider.ts Outdated Show resolved Hide resolved
@ZeeshanTamboli ZeeshanTamboli added the enhancement This is not a bug, nor a new feature label Feb 5, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [base-ui] Change APIs using Array to ReadonlyArray [base-ui] Update APIs using Array to ReadonlyArray Feb 5, 2024
@ZeeshanTamboli
Copy link
Member

@michaldudak Since the PR author isn't active, I've made the changes myself. Could you review?

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Thanks, Zeeshan!

@ZeeshanTamboli ZeeshanTamboli changed the title [base-ui] Update APIs using Array to ReadonlyArray [base-ui] Update props using Array to ReadonlyArray Feb 7, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [base-ui] Update props using Array to ReadonlyArray [base-ui] Update props using Array to ReadonlyArray type Feb 7, 2024
@ZeeshanTamboli ZeeshanTamboli merged commit 67552ad into mui:master Feb 7, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[typescript] Replace Array API with ReadonlyArray
7 participants