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

Switch to version of react-json-view that supports React 18 (DC-733). #4035

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

cahrens
Copy link
Member

@cahrens cahrens commented Jul 17, 2023

Jira Ticket: https://broadworkbench.atlassian.net/browse/DC-733

Summary of changes:

Upgraded react--json-view to a version that supports React 18 and also ran yarn dedupe which cleaned up quite a bit of stuff.

Why

  • We are trying to move to React 18, and the original react-json-view library is no longer supported. This is a fork that at least has been updated for React 18 (though is not very actively maintained either).

Recommendation for this forked version came from mac-s-g/react-json-view#403.

Testing strategy

  • Manual testing, see screenshots.

@@ -1,7 +1,7 @@
import ReactJson from '@microlink/react-json-view';
import _ from 'lodash/fp';
Copy link
Member Author

@cahrens cahrens Jul 17, 2023

Choose a reason for hiding this comment

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

Before and after, tested that copy worked (both versions have copy, though it's only showing on the second screenshot below).

image
image

@broadbot broadbot temporarily deployed to pr-9 July 17, 2023 17:34 Inactive
@@ -1,6 +1,6 @@
import ReactJson from '@microlink/react-json-view';
import _ from 'lodash/fp';
Copy link
Member Author

@cahrens cahrens Jul 17, 2023

Choose a reason for hiding this comment

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

Before and after (clipboard not enabled on these usages):

image

image

import _ from 'lodash/fp';
import { Fragment, useRef, useState } from 'react';
import { div, h } from 'react-hyperscript-helpers';
import ReactJson from 'react-json-view';
Copy link
Member Author

Choose a reason for hiding this comment

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

Before and after:

image

image

@@ -1,7 +1,7 @@
import ReactJson from '@microlink/react-json-view';
import _ from 'lodash/fp';
Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't able to get into a state where I could use the CallCacheWizard, but given that the other 3 usages of this library work I think this is pretty safe.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. Thanks for the heads up!

@cahrens cahrens marked this pull request as ready for review July 17, 2023 17:55
@cahrens cahrens requested a review from a team as a code owner July 17, 2023 17:55
Copy link
Contributor

@s-rubenstein s-rubenstein left a comment

Choose a reason for hiding this comment

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

LGTM

@cahrens cahrens added this pull request to the merge queue Jul 17, 2023
Merged via the queue into dev with commit d76c1c9 Jul 17, 2023
8 checks passed
@cahrens cahrens deleted the react-json-view-replacement branch July 17, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants