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

Poulter/44523 react 18 upgrade 1 #1699

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

hawkespoulterva
Copy link

Resolves APPEALS-44522

Description

The following details the changes made to upgrade eFolder to React 18.2.0. The changes made involve necessary syntax updates, complaint versioning, and addressing breaking changes, all of which are made to resolve warnings received during the upgrade process.

React and React-DOM Versions:

  • Old: React and React-DOM were at version ^16.2.0.
  • Updated: React and React-DOM are now at version 18.2.0.

React-Router-DOM Version:

  • Old: React-Router-DOM was at version ^4.2.2.
  • Updated: React-Router-DOM is now at version 5.3.4.

*Note - React Router is necessary to upgrade to be compliant with the React 18 which deprecates childContextTypes API which is no longer supported and will be removed in the next major release.
The upgrade is made to v5 to be consistent with Caseflow Frontend Toolkit.

Caseflow Frontend Toolkit:

  • Old: It was added with commit hash a05abe6.
  • Updated: The toolkit is now specified from the "upgrade-test" branch of the repository.

*Note - the above upgrade to the Caseflow Frontend toolkit is a test branch that points to upgrades necessary for the toolkits compliance with both Caseflow and eFolder. The toolkit itself also requires updates to React 18.2.0. As far as eFolder is concerned the update only includes a change for the Redux Base component which wraps the root and passes the redux store. Caseflow Frontend toolkit upgrade branch

Refactoring of index.jsx

  • React 18 introduces createRoot as the recommended way to create a root for rendering in concurrent mode. By updating to use createRoot, the codebase ensures compatibility with React 18 and takes advantage of its new features and optimizations.

Refactoring of the following components:

  • DowloadContainer
  • WelcomeContainer
  • RecentDownloadsContainer

In React 18, the lifecycle methods like componentDidMount, componentWillReceiveProps, and componentWillUpdate are not deprecated or removed. However, they are considered legacy lifecycle methods and are generally discouraged from use in favor of newer lifecycle methods or alternative approaches.

Because of this the above components which use componentDidMount were updated to functional components. These updates align with modern React best practices and can lead to a more maintainable, readable, and performant codebase.

Acceptance Criteria

  • Code compiles correctly

Testing Plan

  1. Go to ...

User Facing Changes

  • Screenshots of UI changes added to PR & Original Issue
BEFORE AFTER

Code Documentation Updates

  • Add or update code comments at the top of the class, module, and/or component.

Database Changes

Only for Schema Changes

  • Timestamps (created_at, updated_at) for new tables
  • Column comments updated
  • Verify that migrate:rollback works as desired (change supported functions)
  • Query profiling performed (eyeball Rails log, check bullet and fasterer output)
  • Appropriate indexes added (especially for foreign keys, polymorphic columns, unique constraints, and Rails scopes)
  • Add your indexes safely (see Caseflow::Migrations
  • DB schema docs updated with make docs (after running make migrate)
  • #appeals-schema notified with summary and link to this PR
  • Any non-obvious semantics or logic useful for interpreting database data is documented at Caseflow Data Model and Dictionary

Integrations: Adding endpoints for external APIs

  • Check that Caseflow's external API code for the endpoint matches the code in the relevant integration repo
    • Request: Service name, method name, input field names
    • Response: Check expected data structure
  • Update Fakes
  • Integrations impacting functionality are tested in Caseflow UAT

AdamShawBAH and others added 17 commits May 6, 2024 15:46
* MetricsService.record added for Semaphore lock

* noelle/appeals-39842 (#1574)

Co-authored-by: Noelle Adkin <[email protected]>

---------

Co-authored-by: Anusha Palliyil <[email protected]>
Co-authored-by: Noelle Adkin <[email protected]>
* changed node version

* yarn.lock

* Update with node version

* changed xlink to xmlnsXlink

---------

Co-authored-by: Jeff Bowers <[email protected]>
* adding ruby_claim_evidence_api gem

* Added ruby ce api gem branch

* Update v2_fetch_documents_for to Call New API Endpoint

* Fix Incorrect JSON Response Paging Value

* Update Gem and Fix Misc. Bugs

- Use newest version of the CE API gem.

- Fix bug in JSON parser causing some fields not to be populated.

- Fix bug in date display causing dates to be off by one day.

- Update fake to use gem fake in development.

* Fix Spec Failure

* Deepak/appeals 45276 (#1563)

* update fetch_delta_documents_for with CE-api

* update specs for fetch_delta_documents_for

* update specs

---------

Co-authored-by: youfoundmanesh <[email protected]>

* Kev ma/appeals 45277 v2 (#1564)

* include ce_api call in feature toggle

* Refactor

* Updated spec for v2_fetch_file_document with ce_api

* V2 of 45277

* Added ruby ce api response to fakes

* Temp changes

* removed binding.pry

* Revert change

* Revert temp cache change

* update gemfile with latest commit ID (#1565)

* Move PagedDocuments Under CE API Feature Toggle (#1573)

* Fix Bug Preventing File Fetching (#1586)

* Fix Bug Preventing File Fetching

* Update download_manifest_job.rb

Remove comment added during testing.

* catch ClaimEvidenceApi errors (#1587)

* update error class

* Updated gem version

* Fix Misc. Issues with JSON API Response Handling (#1595)

* Fix Misc. Issues with JSON API Response Handling

- Add curly braces expected by code depending on the SOAP response.

- Update ruby_claim_evidence_api gem version to bugfix version.

- Revert display date fix causing issues with old functionality.

* Fix Failing Spec

* Update received_at Date Parsing Logic (#1596)

- Use slashes instead of hyphens to help JS correctly parse the
date.

* Add Logger to ruby_claim_evidence_api Initializer (#1598)

* Add Logger to ruby_claim_evidence_api Initializer

* Update to Latest ruby_claim_evidence_api Gem Version

* Correctly Handle Blank JSON Responses (#1602)

* Correctly Handle Blank JSON Responses

* Simplify Error Checking

* Fix Line Formatting

* Update gem file after bundle install (#1600)

* Updated ruby_claim_evidence_api gem

* Updated ruby_claim_evidence_api gem

* Alec k/appeals 46664 (#1622)

* locking aws-sdk-core to 3.131.0

* aws-sdk v2 -> aws-sdk-s3

* ec2 added, caseflow ref added

* bundler updated to 2.4.19 for parity

* Reverted d3-rails version

---------

Co-authored-by: Alec Kagebein <[email protected]>

* Andre/appeals-46702 (#1619) (#1625)

* Return VBMS document directly to Reader on S3 cache miss

* Add separate path for reader api call for document to return from vbms directly for s3 miss

* update test for new record api fetch

* update record fetcher to use parent child for api only fetcher

* update test for reader s3 miss and s3 hits

* clean up unneeded spec file

---------

Co-authored-by: Andre Pollard <[email protected]>

* Andre/appeals-46702 (#1619) (#1632)

* Andre/appeals-46702 (#1619)

* Return VBMS document directly to Reader on S3 cache miss

* Add separate path for reader api call for document to return from vbms directly for s3 miss

* update test for new record api fetch

* update record fetcher to use parent child for api only fetcher

* update test for reader s3 miss and s3 hits

* clean up unneeded spec file

---------

Co-authored-by: Andre Pollard <[email protected]>

* Change FeatureFlag to specify Users (#1630) (#1631)

Co-authored-by: andrecolinone <[email protected]>

---------

Co-authored-by: Andre Pollard <[email protected]>
Co-authored-by: andrecolinone <[email protected]>

* Revert "Andre/appeals-46702 (#1619) (#1632)"

This reverts commit abf6f08.

* Revert "Andre/appeals-46702 (#1619) (#1625)"

This reverts commit c64483d.

* Updated dependinces faked for CEAPI

---------

Co-authored-by: Deepak <[email protected]>
Co-authored-by: youfoundmanesh <[email protected]>
Co-authored-by: Alexander Smith <[email protected]>
Co-authored-by: SanthiParakal133 <[email protected]>
Co-authored-by: youfoundmanesh <[email protected]>
Co-authored-by: Kevma50287 <[email protected]>
Co-authored-by: Alex Smith <[email protected]>
Co-authored-by: Alex Smith <[email protected]>
Co-authored-by: Kevin Ma <[email protected]>
Co-authored-by: sbashamoni <[email protected]>
Co-authored-by: Alec Kagebein <[email protected]>
Co-authored-by: Andre Pollard <[email protected]>
Co-authored-by: andrecolinone <[email protected]>
* add missing binwriter from record_fetcher

* update metric wording to include API
…18.20.x-attempt-upgrade-in-the-local-environment
…pt-upgrade-in-the-local-environment' into Poulter/44523-React-18-Upgrade-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants