Skip to content

Commit 35acd9d

Browse files
authored
chore: replace react-json-view with @microlink/react-json-view (solana-foundation#939)
## Description - Replace unmaintained `react-json-view` (1.21.3) with the actively maintained `@microlink/react-json-view` (1.31.15) fork - Remove custom type declaration file (`app/types/react-json-view.d.ts`) since the fork ships its own types - Update imports in `JsonViewer.tsx` and `IdlRenderer.tsx` ## Type of change <!-- Check the appropriate options that apply to this PR --> - [x] Other (please describe): chore ## Screenshots No changes expected, an [example](http://localhost:3000/address/AXcxp15oz1L4YYtqZo6Qt6EkUj1jtLR6wXYqaJvn4oye/idl?cluster=devnet) <img width="1198" height="830" alt="localhost_3000_address_AXcxp15oz1L4YYtqZo6Qt6EkUj1jtLR6wXYqaJvn4oye_idl_cluster=devnet" src="https://github.com/user-attachments/assets/4c17556d-34c7-44bc-abb3-c797a0c55c8d" /> ## Testing Verify json views: - https://explorer-git-fork-hoodieshq-chore-repl-bb17ef-solana-foundation.vercel.app/address/AXcxp15oz1L4YYtqZo6Qt6EkUj1jtLR6wXYqaJvn4oye/idl?cluster=devnet ## Related Issues Closes [HOO-414](https://linear.app/solana-fndn/issue/HOO-414/use-json-viewer-library-compatible-with-react19) ## Checklist <!-- Verify that you have completed the following before requesting review --> - [x] My code follows the project's style guidelines - [x] I have added tests that prove my fix/feature works - [x] All tests pass locally and in CI - [x] I have updated documentation as needed - [x] I have run `build:info` script to update build information - [x] CI/CD checks pass - [x] I have included screenshots for protocol screens (if applicable)
1 parent 63dd492 commit 35acd9d

6 files changed

Lines changed: 119 additions & 157 deletions

File tree

app/components/common/JsonViewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import dynamic from 'next/dynamic';
44
import { ComponentProps } from 'react';
55

6-
// Dynamically import react-json-view with SSR disabled
7-
const ReactJsonView = dynamic(() => import('react-json-view'), {
6+
// Dynamically import @microlink/react-json-view with SSR disabled
7+
const ReactJsonView = dynamic(() => import('@microlink/react-json-view'), {
88
loading: () => <div className="text-muted">Loading JSON viewer...</div>,
99
ssr: false,
1010
});

app/features/idl/ui/IdlRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { type AnchorIdl, CodamaIdl, getDisplayIdlSpecType, type SupportedIdl } from '@entities/idl';
2+
import ReactJson from '@microlink/react-json-view';
23
import { PublicKey } from '@solana/web3.js';
34
import { useSetAtom } from 'jotai';
45
import { memo, useEffect } from 'react';
56
import { ErrorBoundary } from 'react-error-boundary';
6-
import ReactJson from 'react-json-view';
77

88
import { AnchorFormattedIdl } from '../formatted-idl/ui/AnchorFormattedIdl';
99
import { CodamaFormattedIdl } from '../formatted-idl/ui/CodamaFormattedIdl';

app/types/react-json-view.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

bench/BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
| Dynamic | `/address/[address]/idl` | 130 kB | 1.27 MB |
1919
| Dynamic | `/address/[address]/instructions` | 10 kB | 1.13 MB |
2020
| Dynamic | `/address/[address]/metadata` | 10 kB | 1.03 MB |
21-
| Dynamic | `/address/[address]/nftoken-collection-nfts` | 10 kB | 1.10 MB |
21+
| Dynamic | `/address/[address]/nftoken-collection-nfts` | 10 kB | 1.08 MB |
2222
| Dynamic | `/address/[address]/program-multisig` | 10 kB | 1.08 MB |
2323
| Dynamic | `/address/[address]/rewards` | 10 kB | 1.02 MB |
2424
| Dynamic | `/address/[address]/security` | 10 kB | 1.08 MB |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@metaplex-foundation/umi": "0.9.2",
3838
"@metaplex-foundation/umi-bundle-defaults": "0.9.2",
3939
"@metaplex-foundation/umi-web3js-adapters": "0.9.2",
40+
"@microlink/react-json-view": "1.31.15",
4041
"@noble/hashes": "1.5.0",
4142
"@onsol/tldparser": "0.6.5",
4243
"@project-serum/serum": "0.13.61",
@@ -109,7 +110,6 @@
109110
"react-error-boundary": "4.0.11",
110111
"react-feather": "2.0.10",
111112
"react-hook-form": "7.66.0",
112-
"react-json-view": "1.21.3",
113113
"react-markdown": "10.1.0",
114114
"react-moment": "1.1.3",
115115
"remark-frontmatter": "5.0.0",

0 commit comments

Comments
 (0)