-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Redirect NoSsr, Portal and TextareaAutosize to Base UI API page #37175
[docs] Redirect NoSsr, Portal and TextareaAutosize to Base UI API page #37175
Conversation
Netlify deploy previewhttps://deploy-preview-37175--material-ui.netlify.app/ Bundle size report |
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.
- The URL is incorrect. https://deploy-preview-37175--material-ui.netlify.app/material-ui/react-no-ssr/#api links to
https://deploy-preview-37175--material-ui.netlify.app/base/api/no-ssr/
which is a 301. It's better than a 404 but it's not correct. It degrades the UX, and wastes some SEO crawl budget, e.g.
Screen.Recording.2023-05-06.at.22.06.14.mov
- We got a 2-3 regressions around the links, this is maybe worth a test case.
It at-least is better than adding the API doc manually. If we add the docs manually, the API list can get outdated easily. Anyway, we are going to remove these components from Material UI in the next major release.
Added tests. |
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.
Thanks! Agree, we should fix these urls to point to the correct pages (not use redirects). We probably will need to store somewhere the data about where the API page is shown (we can't create it based on the component name anymore, as the docs lays on some documentation page).
test(`should have correct API link when linking Base UI component ${component}`, async ({ | ||
page, | ||
}) => { | ||
await page.goto(`/material-ui/react-${kebabCase(component || '')}/`); |
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.
End to end tests are slow, why not write a test case on the text output of the markdown logic? It would be about x100 faster to run.
await page.goto(`/material-ui/react-${kebabCase(component || '')}/`); |
The markdown logic runs in a webpack plugin. I guess we could either:
|
Fixes issue mentioned in comment #37121 (comment)