-
Notifications
You must be signed in to change notification settings - Fork 19
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
Charts - replace getResizeObserver #206
Conversation
0212010
to
00ebd9d
Compare
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 there's a likelihood that react-charts' getResizeObserver was being imported by anyone else, and since the README includes an "Examples" section for in and output, it might be worth including a codemod that can be ran to fix the import from '@patternfly/react-charts'
to @patternfly/react-core'
.
Alternatively we could just mention the change and remove the Examples section in the README. @gitdallas wdyt?
@thatblindgeye - i believe nicole just let dan know he should either create a story or at least update the readme for this, but we definitely don't want to let it fall through the cracks. maybe one of us could take over creating the codemod - unless you want to, @dlabrecq
|
Per Nicole's instructions, I created issue patternfly/patternfly-react#8533 and updated the README in this repo. I wasn't planning to create and test codemods, so I'm fine having someone else implement 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.
Sounds good! @gitdallas unless you'd want to add a codemod and tests for this, I could push those changes to this PR
@gitdallas let me know if you think the codemod should be simpler and just update the import path. Tried taking into account other scenarios with what I pushed. |
fixes.push( | ||
fixer.insertTextAfterRange( | ||
node.range, | ||
"import {getResizeObserver} from '@patternfly/react-core';" |
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.
should we sneak a \n
in before "import"?
thanks, lgtm. while you resolve - this would be a good opportunity to add to the |
4f86ecf
to
8eaa24a
Compare
@gitdallas tried out the test.tsx file, pretty neat! Wasn't sure if we should keep additions saved as part of PRs or if it's better just to try locally so I didn't include it here. |
@thatblindgeye Thank you for adding the codemods. |
Replaced react-chart
getResizeObserver
with same function from react-core.Related to PR patternfly/patternfly-react#8533