-
Notifications
You must be signed in to change notification settings - Fork 146
feat: add deprecated subpaths #3291
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
|
PF4 preview: https://patternfly-org-pr-3291-v4.surge.sh/v4 |
| ...reactTableModule, | ||
| ...(source === 'react-next' ? reactCoreNextModule : {}) | ||
| ...(source === 'react-next' ? reactCoreNextModule : {}), | ||
| ...(source === 'react-deprecated' ? reactCoreDeprecatedModule : {}) |
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.
It doesn't look like reactCoreDeprecatedModule is defined, and I think we want to extend upon react-table's module for this scope and not react-core (I assume we'll want both eventually, but for this change, at least react-table).
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.
truee
| 'react-composable': 1.2, | ||
| 'react-legacy': 1.3, | ||
| 'react-deprecated': 1.3, | ||
| 'react-legacy': 1.4, |
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.
Do we still have plans to use react-legacy after this change and introduction of react-deprecated?
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.
ultimately react-deprecated will replace the legacy here so I can remove it, but probably not until it's been removed after the breaking change. I don't want to remove it before then.
The deprecated work is going in the v5 branch
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.
Got it, so maybe we make a follow-up issue to remove this when we're ready?
| return exitCode; | ||
| } | ||
|
|
||
| // Build unique names for components if they are a part of the "next" module. |
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.
If we keep this function as you've expanded upon it, we should update this comment.
| function getTsDocName(name, isNextComponent) { | ||
| return `${name}${isNextComponent ? '-next' : ''}`; | ||
| }; | ||
| function getTsDocName(name, isNextComponent, isDeprecatedComponent) { |
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.
So as to not have to add new parameters to this function whenever a new condition arises, we might want to consider reworking this a bit. This is what I had in mind roughly, where if there's another "variant" at any point, we just have to update the 1 location in getTsDocNameVariant:
// Build unique names for components with a "variant" extension
function getTsDocName(name, variant) {
return `${name}${variant ? `-${variant}` : ''}`;
}
function getTsDocNameVariant(source) {
if (source.includes('next')) {
return 'next';
}
if (source.includes('deprecated')) {
return 'deprecated';
}
}
and the 2 usages above would then look like the following:
tsDocs[getTsDocName(name, getTsDocNameVariant(file))] = { name, description, props };
and
const name = getTsDocName(componentName, getTsDocNameVariant(source));
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. Once Jenny's PR is merged; patternfly/patternfly-react#8381, this build should pass.
3cc0849 to
f5a5722
Compare
| // React-table MD | ||
| sourceMD(path.join(reactTablePath, '/**/TableComposable/examples/*.md'), 'react-composable'); | ||
| sourceMD(path.join(reactTablePath, '/**/demos/*.md'), 'react-demos'); | ||
| sourceMD(path.join(reactTablePath, '/**/TableComposable/examples/*.md'), 'react'); |
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.
Was this tested locally by any chance? This regex might conflict with the deprecated path regex on line 61. To prevent the potential for that we can remove the wildcard at the beginning of this line and replace it with components (e.g. /components/TableComposable/...).
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.
not recently but i'll do that
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.
@jeffpuzzo so i'm realizing now that this line will be better tested in the react-docs package where we have our own patternfly-docs.source.js file defined. patternfly-react does not consume org's v4 package, it's actually the other way around, so if these lines dont work in the react workspace when the change is made there, then we can update it here to match whatever worked in the workspace. If this is good to be merged, hopefully this will unblock the work to deprecate table
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.
Ah right, that makes sense.
f5a5722 to
dcc4165
Compare
| '@patternfly/react-core/next': '@patternfly/react-core/dist/esm/next/index.js' // Can remove when webpack is updated to v5 | ||
| '@patternfly/react-core/next': '@patternfly/react-core/dist/esm/next/index.js', // Can remove when webpack is updated to v5 | ||
| '@patternfly/react-core/deprecated': '@patternfly/react-core/dist/esm/deprecated/index.js', // Can remove when webpack is updated to v5 | ||
| '@patternfly/react-table/deprecated': '@patternfly/react-table/dist/esm/deprecated/index.js' // Can remove when webpack is updated to v5 |
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 think all of these path aliases can be removed now since we're no longer using package exports in react-core/table.
| sourceProps(path.join(reactCodeEditorPath, '/**/*.tsx'),reactPropsIgnore); | ||
| sourceProps(path.join(reactChartsPath, '/**/*.tsx'),reactPropsIgnore); | ||
| sourceProps(path.join(reactLogViewerPath, '/**/*.tsx'), reactPropsIgnore); | ||
| //sourceProps(path.join(reactDragDropPath, '/**/*.tsx'), reactPropsIgnore); |
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.
Maybe for now, unless we want to add TODO comments explaining when we'd add this back in, we can remove this commented out line along with lines 43-44 & 81?
| ...(source === 'react-next' ? reactCoreNextModule : {}) | ||
| ...(source === 'react-next' ? reactCoreNextModule : {}), | ||
| ...(source === 'react-deprecated' ? reactCoreDeprecatedModule : {}), | ||
| ...(source === 'react-deprecated' ? reactTableDeprecatedModule : {}) |
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 think we can use the condition source === 'react-deprecated' just once for the inclusion of both of these deprecated modules.
jpuzz0
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.
Tested this locally against patternfly-react successfully. Code changes LGTM.
jenny-s51
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.
Looks great @nicolethoen !! 🚀
Also tested locally and I am able to now add demos under Table -> react-deprecated .
Closes #3289