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

[docs] Fix Material UI's API linking to Base UI #37121

Merged
merged 7 commits into from
May 2, 2023

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented May 1, 2023

The API links on the Material UI's documentation that conflicts with Base UI's components name, have the wrong links, for e.g.: https://mui.com/material-ui/react-button/#api (the Button link is pointing to the wrong API).

The problem comes from the fact that initially we were planning to use the Base UI's components inside Material UI, so we thought that we would like to document the Base UI components on the Material UI's pages. However, this is no longer the case, as we decided to use the headless hooks. We can basically drop this assumption now.

The problem arise after removing the unstyled suffix from the Base UI's components, so the names of the components conflicted.

Here is a link for verifying the fix: https://deploy-preview-37121--material-ui.netlify.app/material-ui/react-button/#api

Resolves #36873 (comment)

@mnajdova mnajdova added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels May 1, 2023
@mnajdova mnajdova marked this pull request as ready for review May 1, 2023 14:23
@mui-bot
Copy link

mui-bot commented May 1, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against d0f5bd3

Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

Works for all components, but only not for ClickAwayListener:

It is the only component that should point to the Base UI API. I think we will have to whitelist its file. A test for this component specifically would also be helpful.

@mnajdova
Copy link
Member Author

mnajdova commented May 1, 2023

Works for all components, but only not for ClickAwayListener

Nice catch, let me fix it.

@@ -38,9 +38,9 @@ const packages = [
{
product: 'material-ui',
paths: [
path.join(__dirname, '../../packages/mui-base/src'),
Copy link
Member Author

Choose a reason for hiding this comment

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

Material UI API links should win over the Base UI ones in case of a conflict in names.

Signed-off-by: Marija Najdova <mnajdova@gmail.com>
@mnajdova
Copy link
Member Author

mnajdova commented May 1, 2023

@ZeeshanTamboli all should be good now

Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

👍

@mnajdova mnajdova merged commit 3c0f01f into mui:master May 2, 2023
@oliviertassinari
Copy link
Member

Oh nice, so it fixes #36873 (comment)?

@oliviertassinari oliviertassinari added the regression A bug, but worse label May 2, 2023
@mnajdova
Copy link
Member Author

mnajdova commented May 5, 2023

@oliviertassinari
Copy link
Member

oliviertassinari commented May 5, 2023

However, this PR breaks something else 🙃

Maybe we could simply write the API section in markdown for these deprecated docs pages (portal, no-ssr, textarea-autosize), rather than generating it.

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented May 5, 2023

However, this PR breaks something else 🙃

@oliviertassinari It's the same issue as #37121 (review). Should be fixed in #37175. Is 301 not good?

binh1298 pushed a commit to binh1298/material-ui that referenced this pull request May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants