-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: remove React 16.4's obsolete React imports #28571
chore: remove React 16.4's obsolete React imports #28571
Conversation
Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
Converting this to |
Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
…tic JSX runtime bundling Signed-off-by: hainenber <[email protected]>
This is required to pass corresponding Jest test. Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
Phew! I've worked out all the edge cases and CI is green now, re-open for review :D |
Thank you for the PR @hainenber. Can we add a lint rule to prevent unused React imports? |
Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
I've added the lint rule as requested :D |
@@ -17,7 +17,8 @@ | |||
* under the License. | |||
*/ | |||
|
|||
import React from 'react'; | |||
// eslint-disable-next-line no-restricted-syntax -- whole React import is required for `reactify.test.tsx` Jest test passing. |
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.
Appreciate the comments!
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 should clarify that I was unable to refactor the reactify.test.tsx
to decouple it from whole React import :(
I hope someone much better than me can do the needful in the future.
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 review this big of a PR is giving my browser a heart attack, and making my eyes bleed :P
I've reviewed about 700 of the files in a somewhat random order, and all looks good to me.
GitHub makes me "load diff" for the rest of the files, and it takes foreeeeeeeever. You would think filtering by file type or filtering out "viewed" files would help, but NOPE.
Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
chore: remove unused React imports
SUMMARY
React imports are no longer necessary starting from React 16.4.0 (source), I ran
npx react-codemod update-react-imports
. Afterwards, I executed this snippet to confirm everything stays intactNotable changes:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
All CI should be green
ADDITIONAL INFORMATION