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] Move imports into page data #38297

Merged
merged 12 commits into from
Aug 9, 2023

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Aug 3, 2023

To reuse the ApiPage component from the monorepo, X needs to be able provide its own import data. So I move the import snipets from the API page components to the docs:api script

Comming from this comment

After/Before (screenshot order)

material

image

joy

image

base

components

image

hook

image

System

The right side is from the production website. The preview does not have it so it's a bug fix ;)
I don't know why I(s the only component with this behavior

image

@alexfauquette alexfauquette added the scope: docs-infra Specific to the docs-infra product label Aug 3, 2023
@mui-bot
Copy link

mui-bot commented Aug 3, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 91ab7b3

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
Comment on lines +45 to +48
"imports": [
"import { Unstable_NumberInput as NumberInput } from '@mui/base/Unstable_NumberInput';",
"import { Unstable_NumberInput as NumberInput } from '@mui/base';"
],
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

@michaldudak michaldudak 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! I've got one small remark, but besides that it's good to go!

return (
<React.Fragment key={`component-api-${key}`}>
<MarkdownElement>
<Heading hash={componentNameKebabCase} text={`${componentName} API`} />
<Heading text="import" hash={`${componentNameKebabCase}-import`} level="h3" />
<HighlightedCode code={importInstructions} language="jsx" />
<HighlightedCode
code={imports.join(`
Copy link
Member

@michaldudak michaldudak Aug 8, 2023

Choose a reason for hiding this comment

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

Nit: could you extract this to a variable? Having multiline template string within JSX looks a bit off to me (same in HooksApiContent).

@@ -109,30 +110,6 @@ export default function ComponentsApiContent(props) {
slotGuideLink = '/base-ui/guides/overriding-component-structure/';
}

Copy link
Member

Choose a reason for hiding this comment

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

I like how it's much cleaner now :)

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

👍

@alexfauquette alexfauquette merged commit 509cc39 into mui:master Aug 9, 2023
8 checks passed
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.

3 participants