-
-
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-infra] Move imports into page data #38297
Conversation
Netlify deploy previewhttps://deploy-preview-38297--material-ui.netlify.app/ Bundle size report |
"imports": [ | ||
"import { Unstable_NumberInput as NumberInput } from '@mui/base/Unstable_NumberInput';", | ||
"import { Unstable_NumberInput as NumberInput } from '@mui/base';" | ||
], |
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.
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.
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(` |
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.
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/'; | |||
} | |||
|
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.
I like how it's much cleaner 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.
👍
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 thedocs:api
scriptComming from this comment
After/Before (screenshot order)
material
joy
base
components
hook
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