Unpack UI:JS task dependencies for easier maintainence #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
The previous iteration of this project used create-react-app and react-scripts, which anchored the dependencies of this project to now-deprecated packages that are hard to update.
By using the react-scripts
ejectcommand, we can remove the (very) deprecated react-scripts package and corral the project dependancies into better view.Unless #145 , this PR does not change any of the underlying function of the repo. Exactly the same packages are in use, other than bumped to the minimum stable level for us to pass
npm audit. Whether this approach is better/worse than 145 is up for discussion.Ethos
Make as few changes as possible to get the app to a security-stable place. Change no dependencies at all. Make as few changes to the source/test files as possible.
How
npm run ejectnpm start,npm buildandnpm testall run stablyOutcome
Before
After
Tests
All tests pass but one, which I believe intentionally fails (as there's no logic to refetch the data in the UI)
Verbose test output
``` $ npm testPASS src/dataFetcher/index.test.jsx
PASS src/components/Scorecard/Scorecard.test.jsx
PASS src/components/PartyLinks/PartyLinks.test.jsx
FAIL src/components/Scoreboard.test.jsx
● fetches results again when refresh button clicked
Test Suites: 1 failed, 3 passed, 4 total
Tests: 1 failed, 9 passed, 10 total
Snapshots: 0 total