-
Notifications
You must be signed in to change notification settings - Fork 41
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
Migration to react 18 #727
Conversation
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
…serEvent Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
…library Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #727 +/- ##
===========================================
- Coverage 56.30% 33.35% -22.96%
===========================================
Files 293 131 -162
Lines 6981 3676 -3305
Branches 943 836 -107
===========================================
- Hits 3931 1226 -2705
+ Misses 2858 2312 -546
+ Partials 192 138 -54
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 132 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
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.
* Adding link to unresolved issue to testing Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Added back missing test Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Reverting stack navigator tests Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Remove the rest of reporting components from react-components Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Remove deprecated command forms Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Revert to remove expectation of loading text since that is not what we are testing Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Add DashboardRoute to the route map since it returns undefined anyway Signed-off-by: Aaron Chong <aaronchongth@gmail.com> --------- Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
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.
LGTM!
What's new
React 18.
What changed?
Many dependencies had to change due to incompatibility with React 18.
The most relevant change was the routing handling.
It was upgraded to react router 6.
The most relevant change was to add
/*
to the paths that have children, in our case, only/admin
in order to render the child paths.Error before adding the /* path
You can test for this error by removing
/*
from line 17 of the file/util/url.ts
of the dashboard packageThe other changes are
react router v6
enhancements or different package names that serve the same purpose as the previous version. You can look at some of them hereOther dependencies changed were.
Many test files were changed due to incompatibility with react 18.
Some of the most relevant changes were:
Obs: In react-component it was not possible to upgrade to the latest
testing library
version due to incompatibility withwebpack
andkarma
. I consider something not relevant to address now. Therefore:Use fireEvent instead of userEvent in many cases because by default fireEvent is wrapped inside act function and this is useful when the user does some action and this action will cause component updates and re-render. (https://kentcdodds.com/blog/common-mistakes-with-react-testing-library)
This is a relatively major change, so please test all possible cases, (create tasks, create alerts, create schedules). Especially the interactions of the routes in admin.
Self-checks
Discussion