feat: Upgrade React from 17.0.2 to 18.3.1 in Feast UI by peruukki · Pull Request #4620 · feast-dev/feast
What this PR does / why we need it:
Upgrade from React 17 to 18 in Feast UI CLI, and support both major versions when using it as a module.
Which issue(s) this PR fixes:
Resolves #3784.
Misc
I followed the React 18 upgrade guide, in the end most sections there didn't seem to be a concern.
Some related packages also needed upgrading to better work with React 18.
Note on test changes:
- Some tests were initially failing after the upgrade, so
userEventusage is updated to callsetup()first and await all interactions so that the DOM updates before continuing with the test, according to e.g. https://testing-library.com/docs/user-event/intro#writing-tests-with-userevent. - In test-utils, the
childrentype needed a change to compile, and theoptionstype was changed to a more accurate one, following the example in the current docs in https://testing-library.com/docs/react-testing-library/setup#custom-render.
I tested this as a module with my simple example app with React 17 and React 18 specific branches. They use a locally built package of @feast-dev/feast-ui from this branch, so they don't work out-of-the-box on other machines, but just mentioned as a reference.