Skip to content

Commit 9e4e054

Browse files
fix(deps): update dependency jsondiffpatch to ^0.6.0 (#1586)
* fix(deps): update dependency jsondiffpatch to ^0.6.0 * Cleanup renovate.json * Code updates * Update test config --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathan Bierema <[email protected]>
1 parent 31aabfa commit 9e4e054

File tree

12 files changed

+42
-44
lines changed

12 files changed

+42
-44
lines changed

extension/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
77
},
88
transformIgnorePatterns: [
9-
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|chalk|d3|dateformat|delaunator|internmap|nanoid|robust-predicates|uuid)',
9+
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|chalk|d3|dateformat|delaunator|internmap|jsondiffpatch|nanoid|robust-predicates|uuid)',
1010
],
1111
};

packages/redux-devtools-app/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ module.exports = {
1010
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
1111
},
1212
transformIgnorePatterns: [
13-
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|chalk|d3|dateformat|delaunator|internmap|nanoid|robust-predicates|uuid)',
13+
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|chalk|d3|dateformat|delaunator|internmap|jsondiffpatch|nanoid|robust-predicates|uuid)',
1414
],
1515
};

packages/redux-devtools-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"d3-state-visualizer": "^2.0.0",
5555
"javascript-stringify": "^2.1.0",
5656
"jsan": "^3.1.14",
57-
"jsondiffpatch": "^0.5.0",
57+
"jsondiffpatch": "^0.6.0",
5858
"localforage": "^1.10.0",
5959
"lodash": "^4.17.21",
6060
"react-icons": "^5.0.1",

packages/redux-devtools-app/src/containers/monitors/InspectorWrapper/SubTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import RawTab from './RawTab';
1313
import ChartTab from './ChartTab';
1414
import VisualDiffTab from './VisualDiffTab';
1515
import { StoreState } from '../../../reducers';
16-
import { Delta } from 'jsondiffpatch';
16+
import type { Delta } from 'jsondiffpatch';
1717

1818
type StateProps = ReturnType<typeof mapStateToProps>;
1919
type DispatchProps = ResolveThunks<typeof actionCreators>;

packages/redux-devtools-app/src/containers/monitors/InspectorWrapper/VisualDiffTab.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Component } from 'react';
2-
import { Delta, formatters } from 'jsondiffpatch';
2+
import type { Delta } from 'jsondiffpatch';
3+
import * as htmlFormatter from 'jsondiffpatch/formatters/html';
34
import styled, { ThemedStyledProps } from 'styled-components';
45
import { effects, Theme } from '@redux-devtools/ui';
56

@@ -240,7 +241,7 @@ export default class VisualDiffTab extends Component<Props> {
240241
let __html: string | undefined;
241242
const data = this.props.data;
242243
if (data) {
243-
__html = formatters.html.format(data, undefined);
244+
__html = htmlFormatter.format(data, undefined);
244245
}
245246

246247
return <StyledContainer dangerouslySetInnerHTML={{ __html: __html! }} />;

packages/redux-devtools-inspector-monitor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"hex-rgba": "^1.0.2",
4747
"immutable": "^4.3.4",
4848
"javascript-stringify": "^2.1.0",
49-
"jsondiffpatch": "^0.5.0",
49+
"jsondiffpatch": "^0.6.0",
5050
"lodash.debounce": "^4.0.8",
5151
"react-base16-styling": "^0.9.1",
5252
"react-json-tree": "^0.18.0",

packages/redux-devtools-inspector-monitor/src/ActionPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Base16Theme } from 'redux-devtools-themes';
33
import { Action } from 'redux';
44
import type { LabelRenderer } from 'react-json-tree';
55
import { PerformAction } from '@redux-devtools/core';
6-
import { Delta } from 'jsondiffpatch';
6+
import type { Delta } from 'jsondiffpatch';
77
import type { JSX } from '@emotion/react/jsx-runtime';
88
import { DEFAULT_STATE, DevtoolsInspectorState } from './redux';
99
import ActionPreviewHeader from './ActionPreviewHeader';

packages/redux-devtools-inspector-monitor/src/DevtoolsInspector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
LiftedState,
77
} from '@redux-devtools/core';
88
import { Action, Dispatch } from 'redux';
9-
import { Delta, DiffContext } from 'jsondiffpatch';
9+
import type { Delta, DiffContext } from 'jsondiffpatch';
1010
import {
1111
createInspectorMonitorThemeFromBase16Theme,
1212
resolveBase16Theme,
@@ -154,7 +154,7 @@ export interface DevtoolsInspectorProps<S, A extends Action<string>>
154154
select: (state: S) => unknown;
155155
theme: Base16ThemeName | Base16Theme;
156156
supportImmutable: boolean;
157-
diffObjectHash?: (item: unknown, index: number) => string;
157+
diffObjectHash?: (item: unknown, index: number | undefined) => string;
158158
diffPropertyFilter?: (name: string, context: DiffContext) => boolean;
159159
hideMainButtons?: boolean;
160160
hideActionButtons?: boolean;

packages/redux-devtools-inspector-monitor/src/createDiffPatcher.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import { DiffContext, DiffPatcher } from 'jsondiffpatch';
1+
import { DiffPatcher } from 'jsondiffpatch';
2+
import type { DiffContext } from 'jsondiffpatch';
23

3-
const defaultObjectHash = (o: any, idx: number) =>
4-
(o === null && '$$null') ||
5-
(o && (o.id || o.id === 0) && `$$id:${JSON.stringify(o.id)}`) ||
6-
(o && (o._id || o._id === 0) && `$$_id:${JSON.stringify(o._id)}`) ||
7-
`$$index:${idx}`;
4+
const defaultObjectHash = (obj: object, idx: number | undefined) => {
5+
const o = obj as Record<string, unknown>;
6+
return (
7+
(o === null && '$$null') ||
8+
(o && (o.id || o.id === 0) && `$$id:${JSON.stringify(o.id)}`) ||
9+
(o && (o._id || o._id === 0) && `$$_id:${JSON.stringify(o._id)}`) ||
10+
`$$index:${idx}`
11+
);
12+
};
813

914
const defaultPropertyFilter = (name: string, context: DiffContext) =>
10-
typeof context.left[name] !== 'function' &&
11-
typeof context.right[name] !== 'function';
15+
typeof (context.left as Record<string, unknown>)[name] !== 'function' &&
16+
typeof (context.right as Record<string, unknown>)[name] !== 'function';
1217

1318
const defaultDiffPatcher = new DiffPatcher({
1419
arrays: { detectMove: false } as {
@@ -20,7 +25,9 @@ const defaultDiffPatcher = new DiffPatcher({
2025
});
2126

2227
export default function createDiffPatcher(
23-
objectHash: ((item: unknown, index: number) => string) | undefined,
28+
objectHash:
29+
| ((item: unknown, index: number | undefined) => string)
30+
| undefined,
2431
propertyFilter: ((name: string, context: DiffContext) => boolean) | undefined,
2532
) {
2633
if (!objectHash && !propertyFilter) {

packages/redux-devtools-inspector-monitor/src/tabs/JSONDiff.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import { JSONTree } from 'react-json-tree';
33
import type { LabelRenderer, ShouldExpandNodeInitially } from 'react-json-tree';
44
import { stringify } from 'javascript-stringify';
5-
import { Delta } from 'jsondiffpatch';
5+
import type { Delta } from 'jsondiffpatch';
66
import { Base16Theme } from 'redux-devtools-themes';
77
import { css } from '@emotion/react';
88
import type { Interpolation, Theme } from '@emotion/react';

0 commit comments

Comments
 (0)