-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add Vite and required packages * Create vite.config.ts * Move and update index.html - Move index.html to root folder - Remove %PUBLIC_URL% references - Add Vite entry point * Update tsconfig.json * Create vite-env.d.ts * Remove react-scripts - Remove react-scripts - Delete react-app-env.d.ts * Update scripts in package.json * Update env variables * Change build output folder * Remove craco * Configure vite.config.ts for docker * Updated caniuse-lite Not necessary for vite migration, but removed warning message to update. * Upgraded react-csv Previous version was incompatible with Vite because Link component was .js file instead of .jsx * Set scss load paths * Hide uswds console notifications * Upgrade storybook * Upgrade Apollo * Fix build script * Fix Okta bug * Fix uswds theme paths * Enable css source maps * Add autoprefixer * Add autoprefixer to vite.config.ts * Add vitest * Snapshots * Remove Jest canvas mock * BusinessCaseReview test error Error: Uncaught [TypeError: Cannot read properties of null (reading 'offsetWidth')] * Upgrade Vite Multiple installed versions of vite was causing type error * Add vitest globals to tsconfig * Add vi global to .eslintrc * Replace jest global with vi * Set global timezone - Renamed jest-global-setup.js to global-setup.js - Set timezone to UTC in global-setup.js - Added globalSetup file to vite.config.ts * Mock getTrbRequestDocumentsQuery - Added mocked query to src/data/mock/trbRequest.ts - Fixed missing mock query error in Consult.test.tsx * Snapshots * Added Vitest UI package * Added vitest:ui Opens unit tests in Vitest UI * Removed jest-launchdarkly-references * Fix createObjectURL JSDOM error - Fixes error from react-csv: "TypeError: The "obj" argument must be an instance of Blob. Received an instance of Blob" - JSDOM does not support window.URL.createObjectURL, so needed to mock in setupTests.ts * Clay changes for vitest canvas mock, WIP, non functional * Fix navigationBar test * Fix setupTests typeError * Fix Header unit test errors - Fixed typo - Wrapped component in Provider - Updated to async function * Enable threads - Disabling threads causes tests to fail - See vitest-dev/vitest#1430 * Fix flaky TRB Consult test Test randomly threw error that no more mocked responses were available for getTRBRequestAttendeesQuery. Duplicating the query in the mocks array fixed this. * Skip Tabs test * Snapshots * Update yarn.lock * Update snapshot * Remove unit tests that render Okta signin widget * Remove vitest-canvas-mock * Add role attribute to csv download link byRole queries in unit tests were not recognizing csv download links as links because the href prop isn't set. Explicitly setting "role=link" solved this. * Fix "cannot find offset width of null" error * Fix unit test classlist argument error * Remove vitest UI * Fix references to REACT_APP_ env vars that have not yet been converted to use VITE_ * Enable test coverage when running yarn test:coverage with v8. See https://vitest.dev/guide/coverage.html for info * Fix cypress plugins env variables bug Changed import.meta.env to process.env * Add cypress-vite - Removed cypress/webpack-preprocessor - Added cypress-vite * Cypress-vite config updates * Empty commit * Debug file:preprocessor * Upgrade Cypress * Comment out tests that import app code * Comment out missed suite with imports * Re-introduce webpack for Cypress * Uncomment tests * Cleanup - Removed commented out debug code - Uncommented e2e test code * Enable cypress video * Set long timeout on Okta login * Try clicking multiple times * Try clicking multiple times * Upgrade okta-signin-widget from 6 to 7 * Undo multi click in Cypress * import css from okta widget using exported path. Add commonjsOptions to transform require to import in imported modules * Remove extra setting of VITE_OKTA_REDIRECT_URI * Remove references to craco, add ADR * Remove unused packages. Add comments, remove TODO comments. --------- Co-authored-by: ClayBenson94 <clay.benson@oddball.io>
- Loading branch information
1 parent
005fe51
commit a545d93
Showing
180 changed files
with
5,959 additions
and
12,951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Migrate from Create React App & Craco to Vite | ||
|
||
**User Story:** [EASI-3082](https://jiraent.cms.gov/browse/EASI-3082) | ||
|
||
Meta (the organization who created React) has formally stopped recommending that developers use Create React App. The reasons won't be enumerated here in perfect detail, but this [Pull Request](https://github.com/reactjs/react.dev/pull/5487) on the official React docs site is a good place to start if you want more context. | ||
|
||
Given this recommendation, and with the fact that Vite promises (and delivers) faster compilation times, we have considered (and settled on) migrating the application to Vite. | ||
|
||
|
||
## Considered Alternatives | ||
|
||
* Stay on CRA/Craco | ||
* Migrate to Vite | ||
|
||
## Decision Outcome | ||
|
||
* Chosen Alternative: **Migrate to Vite** | ||
|
||
This approach, while a heavy lift, should provide us with faster compilation, better support, and a more modern toolchain. | ||
|
||
## Pros and Cons of the Alternatives | ||
|
||
### Stay on CRA/Craco | ||
|
||
* `+` No config changes to make | ||
* `+` CRA is a popular tool, despite its age and limitations | ||
* `-` Less efficient (larger) bundle sizes | ||
* `-` Much slower compilation times | ||
|
||
### Migrate to Vite | ||
|
||
* `+` Faster build times | ||
* `+` More active support and development | ||
* `-` Requires a lot of trial and error to migrate, with potential breaking changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.