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] Prepare scripts + E2E tests for migration #3515

Merged
merged 50 commits into from Jan 24, 2022

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Dec 27, 2021

This PR is a part of the first phase described in mui/material-ui#30091

Summary

Try it out

  1. pull this PR
  2. yarn
  3. yarn docs:migrate:pages && yarn docs:api (the script will set enable_product_scope: true in the feature toggle file
  4. yarn docs:dev
  5. yarn test:e2e-website:dev

Next step
Open another PR and run yarn docs:migrate:pages && yarn docs:api.

@siriwatknp siriwatknp added the on hold There is a blocker, we need to wait label Dec 27, 2021
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 27, 2021
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 5, 2022
@siriwatknp siriwatknp marked this pull request as ready for review January 5, 2022 13:43
subheader: '/x/react-data-grid/overview',
title: 'Overview',
},
{ pathname: '/x/react-data-grid/demo' },
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about the react- prefix here
Could you explain why you added it instead of just /x/data-grid/* ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

But why react- on components and mui- on the apis ?
Just to have benefits for the SEO for both words ?

Copy link
Member Author

Choose a reason for hiding this comment

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

For mui-, I think it relates to the package or the folder in the repo:

  • /material/api/mui-material/button
  • /material/api/mui-lab/button (here mui-lab lives in material)

But this is an interesting question for x packages 🤔, mui- does not make sense here. @mui-org/x @oliviertassinari any thought?

Copy link
Member

Choose a reason for hiding this comment

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

For API pages it should be /x/api/x-data-grid/data-grid and /x/api/x-data-grid-pro/data-grid-pro, if we want to have the package name in the URL.

Copy link
Member

Choose a reason for hiding this comment

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

I have polished https://www.notion.so/mui-org/Documentation-per-product-decision-time-d9347d7d37b641129d2fea12d68555d2#67b6d390ec7c4977b5cb4d942ba2ee6b to be more in sync with the current direction. It covers why react-.

Regarding why mui- we have never really talked about it so far. For me, the idea was to match the code imports import Button from '@mui/material/Button. To be honest, there, If it was only about me, I think that I would have done a 1:1 mapping as close as possible with code, so https://mui.com/api/mui-material/button/ (which is different from the current direction). But skipping mui- or adding the product prefix makes sense too. I think that our only concern should be: How clear the API URL is? (not its length).

Copy link
Member Author

Choose a reason for hiding this comment

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

In my opinion, the product prefix is already explicit enough and as a user, I don't really care about the package or folder (in the URL). So I am good if we keep the URL the same and just add the product prefix.

  • /material/api/button
  • /x/api/data-grid/data-grid
  • /x/api/data-grid/grid-api

Copy link
Member Author

Choose a reason for hiding this comment

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

@m4theushw @flaviendelangle is this format looks good to you (similar to existing URLs, just prepend with the prefix x)?

  • /x/api/data-grid/data-grid
  • /x/api/data-grid/grid-api

Copy link
Member

Choose a reason for hiding this comment

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

The URL seems clean to me that way yes 👍

Copy link
Member

Choose a reason for hiding this comment

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

Would it be simpler by removing the /data-grid/ prefix? So using the previous example:

  • /x/api/data-grid/
  • /x/api/data-grid-overview!/

It would match what we do in the other "spaces".

docs/data/data-grid/pages.ts Outdated Show resolved Hide resolved
@@ -195,36 +196,6 @@ Tip: you can access the documentation \`theme\` object directly in the console.
);
}

// DO NOT REPLACE THIS FUNCTION WITH THE ONE FROM THE MONOREPO
Copy link
Member

Choose a reason for hiding this comment

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

Just in case, why was this comment here and did you check that we could replace it now ?

Copy link
Member Author

Choose a reason for hiding this comment

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

did you check that we could replace it now

These are what I checked:

  • the e2e-test make sure the page does not crash
  • the footer of the docs works as before (can link to the next page)

Copy link
Member Author

Choose a reason for hiding this comment

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

I suggest you try the migration steps I mentioned in the PR description.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 18, 2022
@siriwatknp
Copy link
Member Author

siriwatknp commented Jan 20, 2022

@m4theushw @flaviendelangle Can you review again? I think this is good to be merged.

Here is the result once we run the migration (I create a migration demo in this PR):
https://deploy-preview-3664--material-ui-x.netlify.app/x/react-data-grid/

cc @oliviertassinari

Copy link
Member

@m4theushw m4theushw left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Great work !

@siriwatknp siriwatknp merged commit 21afcba into mui:master Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold There is a blocker, we need to wait
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants