Skip to content
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

1577 - Upgrade frontend deps #3327

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open

Conversation

jtimpe
Copy link

@jtimpe jtimpe commented Dec 3, 2024

Summary of Changes

Pull request closes #1577

The goal of this was primarily to get react-scripts updated to version 5. I took the opportunity to bump all the dependencies to the latest possible (downgrading a select few only to avoid conflicts). Along the way, the following tasks were also necessary

  • Upgrading SASS and changing all imports to match the new module syntax
  • Upgrading USWDS to version 3 (with support for the new SASS module syntax). Also required changing the import syntax for many components.
  • A small set of changes to implement React 18
  • Replace the file-type library (requires node runtime, no longer compatible) with file-type-checker (browser runtime)
  • Configure jest to ignore the node/browser conflict for some packages (uswds and axios)
  • Changing the linter configuration to ignore new es6 rules (trailing comma)

A tech memo was drafted covering the upgrade process, as well as errors and resolutions experienced during the dependency upgrade.

The following tickets were created as follow-on work

How to Test

cd tdrs-backend && docker compose up --build
cd tdrs-frontend && docker compose up --build
  1. Open http://localhost:3000/ and sign in.
  2. Navigate the frontend and test critical features (file upload, download, search form behaviors, navigation)
  3. Test a11y compliance

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • react-scripts is updated to latest major version
  • file-type is updated to latest major version replaced with a browser-runtime-compatible alternative
  • package.json is updated
  • package-lock.json is updated
  • lfrohlich and/or adpennington confirmed that ACs are met.

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic?
  • Are links included to any other gov-approved PRs associated with epic?
  • Does PR include documentation for Raft's a11y review?
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR?

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces dependencies, are their licenses documented?
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

@jtimpe jtimpe self-assigned this Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.57%. Comparing base (8f5a452) to head (d33c871).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...-frontend/src/components/FileUpload/FileUpload.jsx 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3327      +/-   ##
===========================================
- Coverage    91.59%   91.57%   -0.03%     
===========================================
  Files          297      297              
  Lines         8509     8519      +10     
  Branches       621      623       +2     
===========================================
+ Hits          7794     7801       +7     
- Misses         601      603       +2     
- Partials       114      115       +1     
Flag Coverage Δ
dev-backend 91.42% <ø> (ø)
dev-frontend 92.60% <70.00%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tdrs-frontend/src/components/ComboBox/ComboBox.jsx 100.00% <ø> (ø)
...rs-frontend/src/components/GovBanner/GovBanner.jsx 80.00% <ø> (ø)
tdrs-frontend/src/components/Header/Header.jsx 95.65% <ø> (ø)
...-frontend/src/components/SplashPage/SplashPage.jsx 100.00% <ø> (ø)
...ntend/src/components/UploadReport/UploadReport.jsx 90.62% <ø> (ø)
tdrs-frontend/src/mirage.data.js 100.00% <ø> (ø)
...-frontend/src/components/FileUpload/FileUpload.jsx 92.59% <70.00%> (-5.14%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae340de...d33c871. Read the comment docs.

@jtimpe jtimpe added raft review This issue is ready for raft review a11y-review PR is ready for accessibility review labels Dec 3, 2024
@reitermb reitermb added the Deploy with CircleCI-raft Deploy to https://tdp-frontend-raft.app.cloud.gov through CircleCI label Dec 4, 2024
Copy link

@reitermb reitermb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to spend more time with this and test across a few different devices/OSes but for the most part this is already looking pretty good!

Automated scans I've run so far are showing up clear and I've only turned up a handful of issues (mix of a11y and general QA) with initial manual testing:

https://app.mural.co/t/raft2792/m/raft2792/1733347565459/e9b8748c8dbe09f65e57d9c07d07b506daf102e0?sender=ufa4902beba666df5bec09412

I'll confirm for sure in a subsequent review but it looks like this has fixed #2307 as expected.

@jtimpe
Copy link
Author

jtimpe commented Dec 10, 2024

thank you @reitermb! i've reviewed your findings and made three tickets. The usa-hero padding was an easy enough fix, so i went ahead and pushed that

image

Copy link

@elipe17 elipe17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find any other issues. Everything that I tried worked like a charm and didn't look weird! Great work on this!

section,
},
})
} else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love how much nicer this all is now!

@jtimpe jtimpe requested a review from reitermb December 11, 2024 16:47
Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good!

@@ -1,3 +1,6 @@
@use "uswds-core" as *;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this specific file but I am getting error on some of the CSS and JS assets, my best guess is that new changes want these to be available in the frontend, but we are relaying all /static files to backend (maybe?!!):

Screenshot 2024-12-04 at 11 27 33 AM

@jtimpe jtimpe added QASP Review and removed raft review This issue is ready for raft review labels Dec 13, 2024
@jtimpe jtimpe removed a11y-review PR is ready for accessibility review Deploy with CircleCI-raft Deploy to https://tdp-frontend-raft.app.cloud.gov through CircleCI labels Dec 13, 2024
@jtimpe jtimpe requested a review from ADPennington December 13, 2024 19:46
@reitermb
Copy link

thank you @reitermb! i've reviewed your findings and made three tickets. The usa-hero padding was an easy enough fix, so i went ahead and pushed that

image

Thanks @jtimpe! Just to make sure it's here too I'm good signing off of the padding fix. Just to track some of the more complicated followup a11y testing, in terms of next steps is the plan to merge this or keep it open until the spinoff fixes are added?

@jtimpe
Copy link
Author

jtimpe commented Dec 16, 2024

Thanks @jtimpe! Just to make sure it's here too I'm good signing off of the padding fix. Just to track some of the more complicated followup a11y testing, in terms of next steps is the plan to merge this or keep it open until the spinoff fixes are added?

Thanks @reitermb! And that's a good question. Perhaps @andrew-jameson or @ADPennington could weigh in. My assumption was that we'd merge/close this and work the follow-on tickets based on priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spike - Dependabot - Upgrade react-scripts to 5.0
6 participants