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

Commit 0b2aaaf

Browse files
authored
Merge pull request #321 from ts-graphviz/upgrade-dependencies
upgrade dependencies to the latest
2 parents ead1344 + 4e7af5f commit 0b2aaaf

File tree

6 files changed

+843
-772
lines changed

6 files changed

+843
-772
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"airbnb",
3434
"plugin:prettier/recommended",
3535
"plugin:@typescript-eslint/recommended",
36-
"prettier/@typescript-eslint",
36+
"prettier",
3737
"plugin:jest/recommended",
3838
"plugin:react-hooks/recommended"
3939
],

package.json

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,48 +33,49 @@
3333
"example": "ts-node example/example",
3434
"build": "rollup -c && prettier --write './lib/index.d.ts'",
3535
"test": "jest",
36-
"lint": "eslint -c .eslintrc.json --ext ts,tsx src"
36+
"lint": "eslint -c .eslintrc.json --ext ts,tsx src",
37+
"format": "eslint -c .eslintrc.json --ext ts,tsx src --fix && prettier --write './src/**/*.(ts|tsx)'"
3738
},
3839
"peerDependencies": {
3940
"react": ">=16.8.0 || >=17"
4041
},
4142
"dependencies": {
4243
"prop-types": "^15.7.2",
43-
"react-dom": "^17.0.1",
44-
"react-reconciler": "^0.26.1",
45-
"ts-graphviz": "^0.14.0"
44+
"react-dom": "^17.0.2",
45+
"react-reconciler": "^0.26.2",
46+
"ts-graphviz": "^0.15.1"
4647
},
4748
"devDependencies": {
48-
"@testing-library/jest-dom": "^5.11.8",
49-
"@testing-library/react": "^11.2.3",
50-
"@testing-library/react-hooks": "^4.0.0",
49+
"@testing-library/jest-dom": "^5.12.0",
50+
"@testing-library/react": "^11.2.7",
51+
"@testing-library/react-hooks": "^5.1.2",
5152
"@types/prop-types": "^15.7.3",
52-
"@types/react": "^17.0.0",
53-
"@types/react-dom": "^17.0.0",
54-
"@types/react-reconciler": "^0.18.0",
55-
"@typescript-eslint/eslint-plugin": "^4.12.0",
56-
"@typescript-eslint/parser": "^4.12.0",
57-
"eslint": "^7.17.0",
53+
"@types/react": "^17.0.5",
54+
"@types/react-dom": "^17.0.5",
55+
"@types/react-reconciler": "^0.26.1",
56+
"@typescript-eslint/eslint-plugin": "^4.23.0",
57+
"@typescript-eslint/parser": "^4.23.0",
58+
"eslint": "^7.26.0",
5859
"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",
60+
"eslint-config-prettier": "^8.3.0",
61+
"eslint-plugin-import": "^2.23.1",
62+
"eslint-plugin-jest": "^24.3.6",
6263
"eslint-plugin-jsx-a11y": "^6.4.1",
63-
"eslint-plugin-prettier": "^3.3.1",
64-
"eslint-plugin-react": "^ 7.22.0",
64+
"eslint-plugin-prettier": "^3.4.0",
65+
"eslint-plugin-react": "^7.23.2",
6566
"eslint-plugin-react-hooks": "^4.2.0",
6667
"jest": "^26.6.3",
6768
"jest-graphviz": "^0.4.0",
68-
"prettier": "^2.2.1",
69-
"react": "^17.0.1",
70-
"react-test-renderer": "^17.0.1",
71-
"rollup": "^2.36.1",
69+
"prettier": "^2.3.0",
70+
"react": "^17.0.2",
71+
"react-test-renderer": "^17.0.2",
72+
"rollup": "^2.48.0",
7273
"rollup-plugin-delete": "^2.0.0",
73-
"rollup-plugin-dts": "^2.0.1",
74+
"rollup-plugin-dts": "^3.0.1",
7475
"rollup-plugin-terser": "^7.0.2",
75-
"rollup-plugin-typescript2": "^0.29.0",
76-
"ts-jest": "^26.4.4",
76+
"rollup-plugin-typescript2": "^0.30.0",
77+
"ts-jest": "^26.5.6",
7778
"ts-node": "^9.1.1",
78-
"typescript": "^4.1.3"
79+
"typescript": "^4.2.4"
7980
}
8081
}

src/hooks/__tests__/utils/wrapper.tsx

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,52 @@ import { Graph } from '../../../components/Graph';
77
import { GraphvizContext } from '../../../components/contexts/GraphvizContext';
88
import { Subgraph } from '../../../components/Subgraph';
99

10-
export const context = (): FC => ({ children }) => {
11-
return <GraphvizContext.Provider value={{}}>{children}</GraphvizContext.Provider>;
12-
};
10+
export const context =
11+
(): FC =>
12+
({ children }) => {
13+
return <GraphvizContext.Provider value={{}}>{children}</GraphvizContext.Provider>;
14+
};
1315

14-
export const digraph = (props: ComponentProps<typeof Digraph> = {}): FC => ({ children }) => {
15-
return (
16-
<GraphvizContext.Provider value={{}}>
17-
<Digraph {...props}>{children}</Digraph>
18-
</GraphvizContext.Provider>
19-
);
20-
};
16+
export const digraph =
17+
(props: ComponentProps<typeof Digraph> = {}): FC =>
18+
({ children }) => {
19+
return (
20+
<GraphvizContext.Provider value={{}}>
21+
<Digraph {...props}>{children}</Digraph>
22+
</GraphvizContext.Provider>
23+
);
24+
};
2125

22-
export const digraphInSubgraph = (props: ComponentProps<typeof Subgraph> = {}): FC => ({ children }) => {
23-
return (
24-
<GraphvizContext.Provider value={{}}>
25-
<Digraph>
26-
<Subgraph {...props}>{children}</Subgraph>
27-
</Digraph>
28-
</GraphvizContext.Provider>
29-
);
30-
};
26+
export const digraphInSubgraph =
27+
(props: ComponentProps<typeof Subgraph> = {}): FC =>
28+
({ children }) => {
29+
return (
30+
<GraphvizContext.Provider value={{}}>
31+
<Digraph>
32+
<Subgraph {...props}>{children}</Subgraph>
33+
</Digraph>
34+
</GraphvizContext.Provider>
35+
);
36+
};
3137

32-
export const graph = (props: ComponentProps<typeof Graph> = {}): FC => ({ children }) => {
33-
return (
34-
<GraphvizContext.Provider value={{}}>
35-
<Graph {...props}>{children}</Graph>
36-
</GraphvizContext.Provider>
37-
);
38-
};
38+
export const graph =
39+
(props: ComponentProps<typeof Graph> = {}): FC =>
40+
({ children }) => {
41+
return (
42+
<GraphvizContext.Provider value={{}}>
43+
<Graph {...props}>{children}</Graph>
44+
</GraphvizContext.Provider>
45+
);
46+
};
3947

40-
export const graphInSubgraph = (props: ComponentProps<typeof Subgraph> = {}): FC => ({ children }) => {
41-
return (
42-
<GraphvizContext.Provider value={{}}>
43-
<Graph>
44-
<Subgraph {...props}>{children}</Subgraph>
45-
</Graph>
46-
</GraphvizContext.Provider>
47-
);
48-
};
48+
export const graphInSubgraph =
49+
(props: ComponentProps<typeof Subgraph> = {}): FC =>
50+
({ children }) => {
51+
return (
52+
<GraphvizContext.Provider value={{}}>
53+
<Graph>
54+
<Subgraph {...props}>{children}</Subgraph>
55+
</Graph>
56+
</GraphvizContext.Provider>
57+
);
58+
};

src/renderer/reconciler.ts

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Container = Record<string, never>;
1111

1212
type Instance = any;
1313
type TextInstance = any;
14+
type SuspenseInstance = any;
1415
type HydratableInstance = any;
1516
type PublicInstance = any;
1617
type HostContext = any;
@@ -29,14 +30,48 @@ export class HostConfig
2930
Container,
3031
Instance,
3132
TextInstance,
33+
SuspenseInstance,
3234
HydratableInstance,
3335
PublicInstance,
3436
HostContext,
3537
UpdatePayload,
36-
ChildSet,
38+
ChildSet, // TODO Placeholder for undocumented API
3739
TimeoutHandle,
3840
NoTimeout
39-
> {
41+
>
42+
{
43+
preparePortalMount(containerInfo: Container): void {
44+
// NoOp
45+
}
46+
47+
scheduleTimeout(fn: (...args: unknown[]) => unknown, delay?: number) {
48+
// NoOp
49+
}
50+
51+
cancelTimeout(id: any): void {
52+
// NoOp
53+
}
54+
55+
queueMicrotask(fn: () => void): void {
56+
// NoOp
57+
}
58+
59+
cloneInstance?: any;
60+
61+
cloneFundamentalInstance?: any;
62+
63+
createContainerChildSet?: any;
64+
65+
appendChildToContainerChildSet?: any;
66+
67+
finalizeContainerChildren?: any;
68+
69+
replaceContainerChildren?: any;
70+
71+
cloneHiddenInstance?: any;
72+
73+
cloneHiddenTextInstance?: any;
74+
4075
public now = Date.now;
4176

4277
public setTimeout = setTimeout;
@@ -72,8 +107,8 @@ export class HostConfig
72107
return parentHostContext;
73108
}
74109

75-
public prepareForCommit(containerInfo: Container): void {
76-
// NoOp
110+
public prepareForCommit(containerInfo: Container): Record<string, any> | null {
111+
return null;
77112
}
78113

79114
public resetAfterCommit(containerInfo: Container): void {

src/renderer/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ClusterMap } from '../components/contexts/ClusterMap';
77
const noop = (): void => undefined;
88

99
export function render(element: ReactElement, context: Context): number {
10-
const container = reconciler.createContainer({}, false, false);
10+
const container = reconciler.createContainer({}, 0, false, null);
1111
// Clusters
1212
return reconciler.updateContainer(
1313
createElement(

0 commit comments

Comments
 (0)