Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit 22c9ce3

Browse files
authored
Merge pull request #239 from ts-graphviz/support-react17
Support react 17 and update dependencies
2 parents ce9f408 + c049e68 commit 22c9ce3

File tree

8 files changed

+1443
-2238
lines changed

8 files changed

+1443
-2238
lines changed

.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"useJSXTextNode": true
1111
},
1212
"settings": {
13+
"react": {
14+
"version": "detect"
15+
},
1316
"import/resolver": {
1417
"node": {
1518
"extensions": [
@@ -36,6 +39,8 @@
3639
],
3740
"rules": {
3841
"@typescript-eslint/no-explicit-any": "off",
42+
"no-use-before-define": [0],
43+
"@typescript-eslint/no-use-before-define": [1],
3944
"prettier/prettier": "error",
4045
"import/extensions": "off",
4146
"import/prefer-default-export": "off",

package.json

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,53 +33,49 @@
3333
"lint": "eslint -c .eslintrc.json --ext ts,tsx src"
3434
},
3535
"peerDependencies": {
36-
"react": ">=16.8.0",
37-
"react-dom": ">=16.8.0",
38-
"ts-graphviz": "^0.13.1"
36+
"react": ">=16.8.0 || >=17"
3937
},
4038
"dependencies": {
4139
"prop-types": "^15.7.2",
42-
"react-reconciler": "^0.25.1"
40+
"react-dom": "^17.0.1",
41+
"react-reconciler": "^0.26.1",
42+
"ts-graphviz": "^0.14.0"
4343
},
4444
"devDependencies": {
45-
"@rollup/plugin-commonjs": "^15.0.0",
46-
"@testing-library/jest-dom": "^5.5.0",
47-
"@testing-library/react": "^10.0.4",
48-
"@testing-library/react-hooks": "^3.2.1",
45+
"@rollup/plugin-commonjs": "^17.0.0",
46+
"@testing-library/jest-dom": "^5.11.8",
47+
"@testing-library/react": "^11.2.3",
48+
"@testing-library/react-hooks": "^4.0.0",
4949
"@types/fs-extra": "^9.0.1",
5050
"@types/glob": "^7.1.3",
5151
"@types/prop-types": "^15.7.3",
52-
"@types/react": "^16.9.17",
53-
"@types/react-dom": "^16.9.4",
52+
"@types/react": "^17.0.0",
53+
"@types/react-dom": "^17.0.0",
5454
"@types/react-reconciler": "^0.18.0",
55-
"@typescript-eslint/eslint-plugin": "^2.28.0",
56-
"@typescript-eslint/parser": "^2.28.0",
57-
"babel-loader": "^8.1.0",
58-
"eslint": "^6.8.0",
59-
"eslint-config-airbnb": "^18.1.0",
60-
"eslint-config-prettier": "^6.10.1",
61-
"eslint-plugin-import": "^2.20.2",
62-
"eslint-plugin-jest": "^23.8.2",
63-
"eslint-plugin-jsx-a11y": "^6.2.3",
64-
"eslint-plugin-prettier": "^3.1.3",
65-
"eslint-plugin-react": "^7.19.0",
66-
"eslint-plugin-react-hooks": "^4.0.0",
67-
"fs-extra": "^9.0.0",
55+
"@typescript-eslint/eslint-plugin": "^4.12.0",
56+
"@typescript-eslint/parser": "^4.12.0",
57+
"eslint": "^7.17.0",
58+
"eslint-config-airbnb": "^18.2.1",
59+
"eslint-config-prettier": "^7.1.0",
60+
"eslint-plugin-import": "^2.22.1",
61+
"eslint-plugin-jest": "^24.1.3",
62+
"eslint-plugin-jsx-a11y": "^6.4.1",
63+
"eslint-plugin-prettier": "^3.3.1",
64+
"eslint-plugin-react": "^ 7.22.0",
65+
"eslint-plugin-react-hooks": "^4.2.0",
66+
"fs-extra": "^9.0.1",
6867
"glob": "^7.1.6",
69-
"jest": "^25.3.0",
70-
"jest-graphviz": "^0.3.1",
71-
"prettier": "^2.0.5",
72-
"react": "^16.13.1",
73-
"react-dom": "^16.13.1",
74-
"react-test-renderer": "^16.13.1",
75-
"rollup": "^2.6.1",
76-
"rollup-plugin-dts": "^1.4.9",
77-
"rollup-plugin-terser": "^7.0.0",
78-
"rollup-plugin-typescript2": "^0.27.0",
79-
"ts-graphviz": "^0.13.1",
80-
"ts-jest": "^25.3.1",
81-
"ts-loader": "^8.0.3",
82-
"ts-node": "^8.9.1",
83-
"typescript": "^3.8.2"
68+
"jest": "^26.6.3",
69+
"jest-graphviz": "^0.4.0",
70+
"prettier": "^2.2.1",
71+
"react": "^17.0.1",
72+
"react-test-renderer": "^17.0.1",
73+
"rollup": "^2.36.1",
74+
"rollup-plugin-dts": "^2.0.1",
75+
"rollup-plugin-terser": "^7.0.2",
76+
"rollup-plugin-typescript2": "^0.29.0",
77+
"ts-jest": "^26.4.4",
78+
"ts-node": "^9.1.1",
79+
"typescript": "^4.1.3"
8480
}
8581
}

src/components/HtmlLike.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type TableProps = {
2727
WIDTH?: AttributesValue; // "value"
2828
};
2929

30-
type NoAttributes = {};
30+
type NoAttributes = Record<string, unknown>;
3131

3232
export type TrProps = NoAttributes;
3333

src/components/__tests__/utils/renderExpectToThrow.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import React, { Component, ReactElement } from 'react';
44
import { render } from '../../../renderer/render';
55

6-
export function renderExpectToThrow(element: ReactElement, expectedError: string) {
6+
export function renderExpectToThrow(element: ReactElement, expectedError: string): void {
77
const errors: Error[] = [];
8-
class ErrorBoundary extends Component<{}, { hasError: boolean }> {
9-
constructor(props: {}) {
8+
class ErrorBoundary extends Component<Record<string, unknown>, { hasError: boolean }> {
9+
constructor(props: Record<string, unknown>) {
1010
super(props);
1111
this.state = { hasError: false };
1212
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`useRenderedID 1`] = `"hoge"`;
3+
exports[`useRenderedID case 1`] = `"hoge"`;
44

5-
exports[`useRenderedID 2`] = `"<<b>bold</b>>"`;
5+
exports[`useRenderedID case 2`] = `"<<b>bold</b>>"`;
66

7-
exports[`useRenderedID 3`] = `"<<B>bold</B>>"`;
7+
exports[`useRenderedID case 3`] = `"<<B>bold</B>>"`;
88

9-
exports[`useRenderedID 4`] = `"<<TABLE BORDER=\\"0\\" CELLBORDER=\\"1\\" CELLSPACING=\\"0\\"><TR><TD>left</TD><TD PORT=\\"m\\">middle</TD><TD PORT=\\"r\\">right</TD></TR></TABLE>>"`;
9+
exports[`useRenderedID case 4`] = `"<<TABLE BORDER=\\"0\\" CELLBORDER=\\"1\\" CELLSPACING=\\"0\\"><TR><TD>left</TD><TD PORT=\\"m\\">middle</TD><TD PORT=\\"r\\">right</TD></TR></TABLE>>"`;

src/hooks/__tests__/use-rendered-id.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('useRenderedID', () => {
1616
<DOT.TD PORT="r">right</DOT.TD>
1717
</DOT.TR>
1818
</DOT.TABLE>,
19-
])('', (id) => {
19+
])('case', (id) => {
2020
const { result } = renderHook(() => useRenderedID(id), {
2121
wrapper: context(),
2222
});

src/renderer/reconciler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
12
/* eslint-disable class-methods-use-this */
23
/* eslint-disable @typescript-eslint/no-unused-vars */
34
/* eslint-disable class-methods-use-this */
@@ -6,7 +7,7 @@ import ReactReconciler from 'react-reconciler';
67

78
type Type = FC;
89
type Props = any;
9-
type Container = {};
10+
type Container = Record<string, never>;
1011

1112
type Instance = any;
1213
type TextInstance = any;

0 commit comments

Comments
 (0)