Skip to content

Commit 9b18655

Browse files
authored
chore(dependencies): Upgrade beta app dependencies - react to 18 and nx to 17 (#1321)
This PR upgrades some dependencies including react from 17 -> 18 (and all necessary dependencies like react-dom and react-test-runner) as well as upgrading the `nx` monorepo setup from 15.5.3 -> 17.0.3 using their migration tool: `YARN_NODE_LINKER="node-modules" npx nx migrate latest && npx nx migrate --run-migrations` I also added `"esModuleInterop": true` to all the package typescript configurations in an attempt to modernize the typescript setup. This then required me to change all `import * as Whatever from 'whatever'` import statements to `import Whatever from 'whatever'`
1 parent 6d7cf6c commit 9b18655

File tree

76 files changed

+744
-685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+744
-685
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ TODO
6565
!.yarn/plugins
6666
!.yarn/releases
6767
!.yarn/sdks
68-
!.yarn/versions
68+
!.yarn/versions
69+
.nx/cache

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
**/package.json
88
**/release
99
CHANGELOG.md
10+
11+
/.nx/cache

apps/reactotron-app/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@
5151
}
5252
},
5353
"dependencies": {
54-
"electron-log": "^4.4.8",
54+
"electron-log": "^5.0.0",
5555
"electron-store": "^8.1.0",
56-
"electron-updater": "^6.1.5",
56+
"electron-updater": "^6.1.7",
5757
"electron-window-state": "^5.0.3",
5858
"immer": "^10.0.3",
59-
"react": "17.0.2",
60-
"react-dom": "17.0.2",
59+
"react": "18.2.0",
60+
"react-dom": "18.2.0",
6161
"react-hotkeys": "^2.0.0",
6262
"react-icons": "^4.11.0",
6363
"react-modal": "3.16.1",
6464
"react-motion": "0.5.2",
65-
"react-router-dom": "^6.16.0",
65+
"react-router-dom": "^6.18.0",
6666
"react-tooltip": "4.5.1",
6767
"reactotron-core-contract": "workspace:*",
6868
"reactotron-core-server": "workspace:*",
@@ -82,14 +82,14 @@
8282
"@storybook/addons": "^5.2.8",
8383
"@storybook/react": "^5.2.8",
8484
"@testing-library/react-hooks": "^8.0.1",
85-
"@types/jest": "^29.5.5",
86-
"@types/react": "17.0.65",
87-
"@types/react-dom": "17.0.20",
85+
"@types/jest": "^29.5.7",
86+
"@types/react": "18.2.35",
87+
"@types/react-dom": "18.2.14",
8888
"@typescript-eslint/eslint-plugin": "^6.7.5",
8989
"@typescript-eslint/parser": "^6.7.5",
9090
"babel-loader": "^8.3.0",
91-
"electron": "26.4.0",
92-
"electron-builder": "^24.7.0",
91+
"electron": "27.0.3",
92+
"electron-builder": "^24.8.1",
9393
"electron-webpack": "2.8.2",
9494
"eslint": "^8.51.0",
9595
"eslint-config-prettier": "^9.0.0",
@@ -104,7 +104,7 @@
104104
"jest-environment-jsdom": "^29.7.0",
105105
"mime": "^3.0.0",
106106
"prettier": "^3.0.3",
107-
"react-test-renderer": "17.0.2",
107+
"react-test-renderer": "18.2.0",
108108
"rimraf": "^5.0.5",
109109
"ts-jest": "^29.1.1",
110110
"typescript": "^4.9.5"

apps/reactotron-app/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "reactotron-app",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"targets": {
45
"version": {
56
"executor": "@jscutlery/semver:version",

apps/reactotron-app/src/main/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { app, BrowserWindow } from "electron"
2-
import * as path from "path"
2+
import path from "path"
33
import { format as formatUrl } from "url"
44
import log from "electron-log"
55
import { autoUpdater } from "electron-updater"

apps/reactotron-app/src/renderer/ReactotronBrain.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TODO: Name this better...
2-
import React, { FunctionComponent } from "react"
2+
import React, { FunctionComponent, PropsWithChildren } from "react"
33
import { Command } from "reactotron-core-contract"
44
import {
55
ReactotronProvider,
@@ -19,7 +19,7 @@ interface Props {
1919
}
2020

2121
/** Wrapper for Reactotron context providers */
22-
const ReactotronBrain: FunctionComponent<Props> = ({
22+
const ReactotronBrain: FunctionComponent<PropsWithChildren<Props>> = ({
2323
commands,
2424
sendCommand,
2525
clearCommands,

apps/reactotron-app/src/renderer/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import "v8-compile-cache"
22
import React from "react"
3-
import { render } from "react-dom"
3+
import { createRoot } from "react-dom/client"
44
import { ReactotronAppProvider } from "reactotron-core-ui"
55

66
import "./global.css"
77

88
import App from "./App"
99

10-
render(
10+
const root = createRoot(document.getElementById("app"))
11+
root.render(
1112
<ReactotronAppProvider>
1213
<App />
13-
</ReactotronAppProvider>,
14-
document.getElementById("app")
14+
</ReactotronAppProvider>
1515
)
1616

1717
if ((module as any).hot) {

lib/reactotron-apisauce/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"@babel/plugin-proposal-class-properties": "^7.18.6",
4444
"@babel/preset-env": "^7.23.2",
4545
"@babel/preset-typescript": "^7.23.2",
46-
"@types/jest": "^29.5.5",
46+
"@types/jest": "^29.5.7",
4747
"@types/json-server": "^0.14.0",
48-
"@types/node": "^11.9.5",
48+
"@types/node": "^18.18.8",
4949
"@typescript-eslint/eslint-plugin": "^6.7.5",
5050
"@typescript-eslint/parser": "^6.7.5",
5151
"babel-jest": "^29.7.0",

lib/reactotron-apisauce/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "reactotron-apisauce",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"targets": {
45
"version": {
56
"executor": "@jscutlery/semver:version",

lib/reactotron-apisauce/test/plugin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as jsonServer from "json-server"
1+
import jsonServer from "json-server"
22
import apisauce from "apisauce"
33
import createPlugin from "../src/index"
44

lib/reactotron-apisauce/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"noImplicitThis": true,
1717
"noUnusedLocals": true,
1818
"sourceMap": true,
19-
"target": "es5"
19+
"target": "es5",
20+
"esModuleInterop": true
2021
},
2122
"exclude": ["node_modules"],
22-
"include": ["src"]
23+
"include": ["src", "test"]
2324
}

lib/reactotron-core-client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"@babel/plugin-proposal-class-properties": "^7.18.6",
4040
"@babel/preset-env": "^7.23.2",
4141
"@babel/preset-typescript": "^7.23.2",
42-
"@types/jest": "^29.5.5",
43-
"@types/node": "14.17.11",
44-
"@types/ws": "^8.5.7",
42+
"@types/jest": "^29.5.7",
43+
"@types/node": "^18.18.8",
44+
"@types/ws": "^8.5.8",
4545
"@typescript-eslint/eslint-plugin": "^6.7.5",
4646
"@typescript-eslint/parser": "^6.7.5",
4747
"babel-eslint": "^10.1.0",

lib/reactotron-core-client/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "reactotron-core-client",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"targets": {
45
"version": {
56
"executor": "@jscutlery/semver:version",

lib/reactotron-core-client/src/client-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { LifeCycleMethods, PluginCreator } from "./reactotron-core-client"
2-
import * as NodeWebSocket from "ws"
2+
import NodeWebSocket from "ws"
33

44
type BrowserWebSocket = WebSocket
55

lib/reactotron-core-client/src/reactotron-core-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as WebSocket from "ws"
1+
import WebSocket from "ws"
22
import { Command, CommandTypeKey } from "reactotron-core-contract"
33
import validate from "./validate"
44
import logger from "./plugins/logger"

lib/reactotron-core-client/test/api-response.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/state-responses"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path: string) => new WebSocket(path)
66

lib/reactotron-core-client/test/configure.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
2+
import WebSocket from "ws"
33

44
const createSocket = (path) => new WebSocket(path)
55

lib/reactotron-core-client/test/connect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44
import { createClosingServer } from "./create-closing-server"
55

66
const createSocket = (path) => new WebSocket(path)

lib/reactotron-core-client/test/create-closing-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as WebSocket from "ws"
1+
import WebSocket from "ws"
22

33
/**
44
* A server which shuts down after somebody connects.

lib/reactotron-core-client/test/on-command.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/on-connect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44
import { createClosingServer } from "./create-closing-server"
55

66
const createSocket = (path) => new WebSocket(path)

lib/reactotron-core-client/test/on-disconnect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44
import { createClosingServer } from "./create-closing-server"
55

66
const createSocket = (path: string) => new WebSocket(path)

lib/reactotron-core-client/test/plugin-benchmark.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/benchmark"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path: string) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-clear.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/clear"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-features.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
2+
import WebSocket from "ws"
33

44
const createSocket = (path) => new WebSocket(path)
55

lib/reactotron-core-client/test/plugin-image.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/image"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path: string) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-interface.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/ban-ts-comment */
22
import { createClient, corePlugins, ReactotronCore } from "../src/reactotron-core-client"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/logger"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-on-command.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44

55
const createSocket = (path) => new WebSocket(path)
66
const mock = { type: "type", payload: "payload" }

lib/reactotron-core-client/test/plugin-on-connect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/plugin-on-disconnect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Plugin, ReactotronCore, createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44
import { createClosingServer } from "./create-closing-server"
55

66
const createSocket = (path: string) => new WebSocket(path)

lib/reactotron-core-client/test/plugin-on-plugin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
2+
import WebSocket from "ws"
33

44
const createSocket = (path) => new WebSocket(path)
55

lib/reactotron-core-client/test/plugin-send.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactotronCore, createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44
import { PluginCreator } from "reactotron-core-client"
55

66
const createSocket = (path) => new WebSocket(path)

lib/reactotron-core-client/test/plugin-state-responses.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient, corePlugins } from "../src/reactotron-core-client"
22
import plugin from "../src/plugins/api-response"
3-
import * as WebSocket from "ws"
3+
import WebSocket from "ws"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/send.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
3-
import * as getPort from "get-port"
2+
import WebSocket from "ws"
3+
import getPort from "get-port"
44

55
const createSocket = (path) => new WebSocket(path)
66

lib/reactotron-core-client/test/start-timer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createClient } from "../src/reactotron-core-client"
2-
import * as WebSocket from "ws"
2+
import WebSocket from "ws"
33

44
const createSocket = (path) => new WebSocket(path)
55

lib/reactotron-core-client/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"noImplicitThis": true,
1717
"noUnusedLocals": true,
1818
"sourceMap": true,
19-
"target": "es5"
19+
"target": "es5",
20+
"esModuleInterop": true
2021
},
2122
"exclude": ["node_modules"],
2223
"include": ["src"]

lib/reactotron-core-contract/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"@babel/plugin-proposal-class-properties": "^7.18.6",
4040
"@babel/preset-env": "^7.23.2",
4141
"@babel/preset-typescript": "^7.23.2",
42-
"@types/jest": "^29.5.5",
43-
"@types/node": "14.17.11",
44-
"@types/ws": "^8.5.7",
42+
"@types/jest": "^29.5.7",
43+
"@types/node": "^18.18.8",
44+
"@types/ws": "^8.5.8",
4545
"@typescript-eslint/eslint-plugin": "^6.7.5",
4646
"@typescript-eslint/parser": "^6.7.5",
4747
"babel-eslint": "^10.1.0",

lib/reactotron-core-contract/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "reactotron-core-contract",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"targets": {
45
"version": {
56
"executor": "@jscutlery/semver:version"

lib/reactotron-core-contract/src/server-events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as WebSocket from "ws"
1+
import WebSocket from "ws"
22
import { Command } from "./command"
33

44
export interface PfxServerOptions {

0 commit comments

Comments
 (0)