-
Notifications
You must be signed in to change notification settings - Fork 145
feat(doc-framework): Allow for 'next' core component usage alongside core components #3126
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
Conversation
| const propComponents = [...new Set(frontmatter.propComponents || [])].reduce((acc, componentName) => { | ||
| const name = getTsDocName(componentName, source === 'react-next'); | ||
|
|
||
| if (tsDocs[name]) { |
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.
Trying to understand. So if there's let's say ...next/components/Wizard/Wizard.tsx, then it exists as tsDocs['Wizard-next']?
And then it will get pushed to
propComponents[
{
"name": "Wizard-next",
"props": []
}
]
?
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.
No, the name of the component would be "Wizard" still, but the props would be that of the appropriate component.
Here's an example generated output for the "Next" Wizard:
const pageData = {
"id": "Wizard",
"section": "components",
"source": "react-next",
"slug": "/components/wizard/react-next",
"sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/next/components/Wizard/examples/Wizard.md",
"propComponents": [
{
"name": "Wizard",
| const defaultImports = [ | ||
| 'react', | ||
| '@reach/router', | ||
| '@patternfly/react-core/next', |
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 this not added to versions.json?
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 did not update that file. What are the expectations there? The /next subpath doesn't have its own versioning so I think this will still be required.
packages/documentation-framework/scripts/webpack/webpack.base.config.js
Outdated
Show resolved
Hide resolved
2136864 to
cd18519
Compare
|
PF4 preview: https://patternfly-org-pr-3126-v4.surge.sh/v4 |
tlabaj
left a comment
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 am not familiar with the framework. Looks good to me if @jschuler or @CooperRedhat are good with it.
…core components with the same names
e9d8aa6 to
de1aeca
Compare
…core components (patternfly#3126) * feat(doc-framework): Allow for 'next' core component usage alongside core components with the same names * address feedback * allowing more memory space * add example prop back * remove dependency since implicit react-core version is now updated
Closes: #3125
Depends on: patternfly/patternfly-react#7824