-
Notifications
You must be signed in to change notification settings - Fork 14.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
refactor: Upgrade to React 17 #31961
base: master
Are you sure you want to change the base?
Conversation
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.
🚀 ! A few quick comments
"react": "^15 || ^16" | ||
"react": "^16 || ^17" |
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.
Here and elsewhere, could we just remove support for ^16
? As we're doing breaking changes, let's not be shy with the sledgehammer! 😁
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.
🛠️
@@ -23,7 +23,7 @@ import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'; | |||
import 'jest-enzyme'; | |||
import jQuery from 'jquery'; | |||
import { configure } from 'enzyme'; | |||
import Adapter from 'enzyme-adapter-react-16'; | |||
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; |
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 see this is an "unofficial" package - am I reading this correctly that Enzyme doesn't support React > 16 natively?
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.
Yep, that package is suggested as a substitute by chatgpt/stackoverflow. Hopefully though we can get rid of enzyme tests soon
@@ -415,7 +415,7 @@ export default class CRUDCollection extends PureComponent< | |||
)), | |||
); | |||
if (allowAddItem) { | |||
tds.push(<td key="add" />); | |||
tds.push(<td key="add" aria-label="dd" />); |
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 supposed to be aria-label="Add"
?
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.
Oops, typo!
8c87baf
to
fc875b4
Compare
Status update: |
Of course, if you've got an idea on how to fix the configs, I'm all ears, any suggestion is more then welcome 🙂 |
superset-frontend/package.json
Outdated
"babel-jest": "^29.7.0", | ||
"babel-loader": "^9.1.3", | ||
"babel-plugin-dynamic-import-node": "^2.3.3", | ||
"babel-plugin-jsx-remove-data-test-id": "^3.0.0", | ||
"babel-plugin-lodash": "^3.3.4", | ||
"babel-plugin-typescript-to-proptypes": "^2.0.0", | ||
"cheerio": "^1.0.0-rc.10", |
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.
enzyme tests break with the released version 1.0.0
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 feel we spend an unsustainable amount of time pampering old libraries and frameworks. Here's my two cents:
So I say: rip out all deps and tests that cause headaches with React 17. |
/korbit-review |
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Invalid Regex Pattern in transformIgnorePatterns ▹ view |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/components/ErrorMessage/IssueCode.tsx | ✅ |
superset-frontend/packages/superset-ui-chart-controls/src/utils/index.ts | ✅ |
superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx | ✅ |
superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx | ✅ |
superset-frontend/packages/superset-ui-core/src/chart-composition/legend/WithLegend.tsx | ✅ |
superset-frontend/jest.config.js | ✅ |
superset-frontend/babel.config.js | ✅ |
superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx | ✅ |
superset-frontend/packages/superset-ui-core/src/chart/components/SuperChart.tsx | ✅ |
superset-frontend/cypress-base/cypress/support/e2e.ts | ✅ |
superset-frontend/src/components/Datasource/CollectionTable.tsx | ✅ |
superset-frontend/src/SqlLab/components/SqlEditor/index.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
I pulled this PR and executed the unit tests to collect some insights to help with this discussion:
Given the low percentage of failing tests, IF we are able to resolve the problems with RTL tests, I would be OK with skipping failed Enzyme tests in favor of upgrading React. |
Any patterns identified in the failing, non-enzyme tests? |
Personally I support |
a11dbec
to
920b256
Compare
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION