-
-
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
[docs] Prepare scripts for migrating to new structure #30386
Conversation
…docs/migration-preparation
@@ -116,7 +116,7 @@ function reduceChildRoutes(context) { | |||
|
|||
if (page.children && page.children.length > 1) { | |||
const title = pageToTitleI18n(page, t); | |||
const topLevel = activePage ? activePage.pathname.indexOf(`${page.pathname}/`) === 0 : false; |
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.
/
is not necessary which makes the new URLs impossible. eg:
{
pathname: '/material/react-'
children: [
{ pathname: '/material/react-buttons' },
]
}
The logic will compare /material/react-/
with /material/react-
{ pathname: '/material/react-use-media-query', title: 'useMediaQuery' }, | ||
], | ||
}, | ||
{ |
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.
Why are the data-grid pages here?
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.
paths: [ | ||
path.join(__dirname, '../../../packages/mui-lab/src'), | ||
path.join(__dirname, '../../../packages/mui-material/src'), | ||
path.join(__dirname, '../../../packages/mui-base/src'), |
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.
Why is base here?
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.
because @mui/base
is a dependency on material.
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 part is related to only components (neglect utilities, hooks or constants for now)
How can we verify that all pages are identical as before? |
e2e tests should verify that the change is safe by running:
|
All three commands ( I think |
Good point, we haven't discussed it and I would leave that to @danilo-leal. I don't think we need to consider it in this PR and let's keep them the same as before is safest for now. |
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.
Yep, we don't need to discuss that in this PR. Looks good!
This PR update the migration and related scripts to generate pages & APIs according to the decided URLs. eg:
/components/buttons
=>/material/react-buttons
/components/data-grid/data-grid
=>/x/data-grid/react-data-grid
/api/button-unstyled
=>/base/api/mui-base/button-unstyled
This is a part of the 1st phase in #30091
Summary
Review recommend
yarn docs:migrate:pages && yarn docs:api
(you should see 5k+ of changes, the changes won't be committed in this PR)yarn docs:dev
yarn test:e2e-website:dev
(all the tests should pass)