-
Notifications
You must be signed in to change notification settings - Fork 4
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
Migrate from CRA to Vite #1379 #1380
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## react-18-#1205 #1380 +/- ##
===================================================
- Coverage 96.76% 86.42% -10.35%
===================================================
Files 48 56 +8
Lines 1763 8561 +6798
Branches 497 893 +396
===================================================
+ Hits 1706 7399 +5693
- Misses 53 1155 +1102
- Partials 4 7 +3 ☔ View full report in Codecov by Sentry. |
9882f3b
to
47c20d0
Compare
47c20d0
to
7cebf93
Compare
7747b8b
to
505728c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1380 +/- ##
===========================================
+ Coverage 97.11% 97.66% +0.55%
===========================================
Files 49 54 +5
Lines 1802 5784 +3982
Branches 503 906 +403
===========================================
+ Hits 1750 5649 +3899
- Misses 48 133 +85
+ Partials 4 2 -2 ☔ View full report in Codecov by Sentry. |
5b0f17d
to
384f97b
Compare
f8125f2
to
09cb6b7
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.
Seems to be working ok, need to test with e.g. OG properly but I'll wait until my previous comments are addressed for a final 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.
LGTM and it's working well with OG. However, I don't want to merge this yet before we're ready to make the necessary deployment changes (e.g. scigateway-ansible).
I can probably make a branch for the changes for scigateway-ansible
to support this work and merge it in once we are ready to switch to v3.x.x in production.
I've created an issue in scigateway-ansible: ral-facilities/scigateway-ansible#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.
LGTM, tested with IMS
Description
Replaces CRA with Vite. Used the default settings that create-vite would have generated in the tsconfig. The only real change caused by that is a requirement of underscores on some unused variable & I removed the props on the footer as they weren't either (
noUnusedParameters
).Notes
react-redux-toastr
was incompatible (it used jsx in .js file) using old version, so upgraded v7.6.2 -> v7.6.13 which fixedclearInterval
inrouting.component.test.tsx
not being defined which was fixed by Component test with setTimeout and vitest fake timers not working testing-library/react-testing-library#1198{ shouldAdvanceTime: true }
in someuseFakeTimers
__mock__
not havingexpect.getState()
assigned as expected - fixed by mocking inside the test file itself (the token storage mock also needed to be hoisted to run correctly as it needed to be done before imports - see description here https://vitest.dev/api/vi#vi-hoisted)eslint-config-react-app
witheslint-plugin-react
,eslint-plugin-testing-library
andeslint-plugin-react-hooks
like Replace eslint-config-react-app with eslint-plugin-react and others #371 inventory-management-system#372react-app-polyfill
andcustom-event-polyfill
(IE is no longer supported anyway, also see https://vitejs.dev/guide/build#browser-compatibility, we could use @vitejs/plugin-legacy if required)browserslist-to-esbuild
to add support for browserslist (View the currently targeted builds usingnpx browserslist-to-esbuild
)Warning
The
index.html
has moved out of thepublic
folder into the root, sodocker-ims
needs to be updated on gitlab as the title can no longer be replaced as it used to be, and instead will be in/dist
after being built. Likely also effects any ansible config.Testing instructions
Add a set up instructions describing how the reviewer should test the code
Agile board tracking
Closes #1379