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-infra] Support code tabs overflow #42913

Merged
merged 5 commits into from
Jul 14, 2024

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Jul 12, 2024

Related to mui/mui-x#9270

With a lot of files, tab names get squashed together.

Before After
tabs-before tabs-after

Preview: https://deploy-preview-42913--material-ui.netlify.app/experiments/docs/demos/#multiple-tabs-demo

@mui-bot
Copy link

mui-bot commented Jul 12, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 978bb77

@arminmeh arminmeh changed the title [docs-infra] Code tabs improvements [docs-infra] Support code tabs overflow Jul 12, 2024
@alexfauquette
Copy link
Member

The build has 2 issues:

  1. It seems some of the stuff you import from '@mui/x-data-grid-generator' are not exported 🤔 Here is the lines of the build log on Netlify:
10:53:25 AM: ./pages/experiments/docs/DemoMultiTabs.js
10:53:25 AM: Attempted import error: 'COUNTRY_ISO_OPTIONS_SORTED' is not exported from '@mui/x-data-grid-generator' (imported as 'COUNTRY_ISO_OPTIONS_SORTED').
10:53:25 AM: ./pages/experiments/docs/DemoMultiTabs.js
10:53:25 AM: Attempted import error: 'STATUS_OPTIONS' is not exported from '@mui/x-data-grid-generator' (imported as 'STATUS_OPTIONS').
10:53:25 AM: ./pages/experiments/docs/DemoMultiTabs.js
10:53:25 AM: Attempted import error: 'INCOTERM_OPTIONS' is not exported from '@mui/x-data-grid-generator' (imported as 'INCOTERM_OPTIONS').
10:53:25 AM: ./pages/experiments/docs/renderers/country.js
10:53:25 AM: Attempted import error: 'COUNTRY_ISO_OPTIONS' is not exported from '@mui/x-data-grid-generator' (imported as 'COUNTRY_ISO_OPTIONS').
10:53:25 AM: ./pages/experiments/docs/renderers/incoterm.js
10:53:25 AM: Attempted import error: 'INCOTERM_OPTIONS' is not exported from '@mui/x-data-grid-generator' (imported as 'INCOTERM_OPTIONS').
10:53:25 AM: ./pages/experiments/docs/renderers/status.js
10:53:25 AM: Attempted import error: 'STATUS_OPTIONS' is not exported from '@mui/x-data-grid-generator' (imported as 'STATUS_OPTIONS').
  1. The experiement folder is a bit special.

The docs structure is the following one.
The demo and the file imported are in data folder. And pages field are just a layout importing the md

data/
  grid/
    Demo.js
    helperToImport.js
pages/
  grid.js

But the experiments is slightly different, because every think is directly in the pages folder. So all the JS files are expected to render a page.

For now the workaround was to import JSON files. You could probably create a data/experiments/renderer to store those helpers

10:53:42 AM: > Build optimization failed: found pages without a React Component as default export in
10:53:42 AM: pages/experiments/docs/renderers/country
10:53:42 AM: pages/experiments/docs/renderers/incoterm
10:53:42 AM: pages/experiments/docs/renderers/progress
10:53:42 AM: pages/experiments/docs/renderers/rating
10:53:42 AM: pages/experiments/docs/renderers/status

@arminmeh
Copy link
Contributor Author

It seems some of the stuff you import from '@mui/x-data-grid-generator' are not exported

Updated. eslint complains about the import path, so I have disabled it for those lines

@alexfauquette, I have moved the renderers as you have suggested. In the experiments demo the filenames are a bit long now, but in the actual docs for xGrid this should not be the problem as we can keep the renderers in the subfolder

@alexfauquette
Copy link
Member

In the experiments demo the filenames are a bit long now, but in the actual docs for xGrid this should not be the problem as we can keep the renderers in the subfolder

Yes, and it would be a nice feature to only keep the file name without its folder to be able to import from anywhere without having to care about the UI impact

@bharatkashyap
Copy link
Member

In the experiments demo the filenames are a bit long now, but in the actual docs for xGrid this should not be the problem as we can keep the renderers in the subfolder

Yes, and it would be a nice feature to only keep the file name without its folder to be able to import from anywhere without having to care about the UI impact

Good shout @alexfauquette and @arminmeh - I'll add this to #41754 which I'm working on

@arminmeh
Copy link
Contributor Author

In the experiments demo the filenames are a bit long now, but in the actual docs for xGrid this should not be the problem as we can keep the renderers in the subfolder

Yes, and it would be a nice feature to only keep the file name without its folder to be able to import from anywhere without having to care about the UI impact

Good shout @alexfauquette and @arminmeh - I'll add this to #41754 which I'm working on

Thanks @bharatkashyap. Nice list of improvements in #41754 👍

I will merge this one then, so that we can update the grid docs.
If you want help, I can also work on the point about having the labels.

@arminmeh arminmeh merged commit 385f0a4 into mui:next Jul 14, 2024
22 checks passed
@arminmeh arminmeh deleted the code-tabs-improvements branch July 14, 2024 20:10
@bharatkashyap
Copy link
Member

I will merge this one then, so that we can update the grid docs. If you want help, I can also work on the point about having the labels.

Please go ahead (only if it's not squeezing your existing bandwidth 😅)

joserodolfofreitas pushed a commit to joserodolfofreitas/material-ui that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants