Skip to content

Commit

Permalink
Updated to React 18. There may still be some Jotai-related issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Frei committed Jun 17, 2024
1 parent 0c63b3d commit 64dba39
Show file tree
Hide file tree
Showing 11 changed files with 1,623 additions and 1,717 deletions.
610 changes: 305 additions & 305 deletions .yarn/releases/yarn-4.2.2.cjs → .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.3.0.cjs
36 changes: 28 additions & 8 deletions electron/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,7 @@ export async function CreateWindow(
mainWindow.maximize();
}
// Call the user specified "ready to go" function
windowCreated()
.then(() => {
// open the devtools
if (!app.isPackaged) {
mainWindow?.webContents.openDevTools();
}
})
.catch(wrn);
windowCreated().then(openDevTools).catch(wrn);
}
});

Expand All @@ -101,6 +94,33 @@ export async function CreateWindow(
}
}

async function installExtensions() {
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS,
} = await import('electron-devtools-installer');

const extensions = [REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS];
for (const extension of extensions) {
try {
const name = await installExtension(extension);
console.log(`Added Extension: ${name}`);
} catch (e) {
console.log('An error occurred: ', e);
}
}
}

async function openDevTools() {
// Make sure we have the dev tools installed
// open the devtools
if (!app.isPackaged) {
await installExtensions();
mainWindow?.webContents.openDevTools();
}
}

let prevWidth = 0;

export function ToggleMiniPlayer(): void {
Expand Down
10 changes: 5 additions & 5 deletions modules/audiofileindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
"@types/jest": "^29.5.12",
"@types/rmfr": "^2.0.5",
"@types/xxhashjs": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"eslint": "^9.4.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"rmfr": "^2.0.0",
"ts-jest": "^29.1.4",
"ts-jest": "^29.1.5",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.3",
"typescript": "^5.4.5"
Expand Down
12 changes: 6 additions & 6 deletions modules/emain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
"@freik/node-utils": "^1.6.3",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"electron": "^30.0.9",
"eslint": "^9.4.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"electron": "^31.0.1",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ts-jest": "^29.1.4",
"ts-jest": "^29.1.5",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.3",
"typescript": "^5.4.5"
Expand Down
12 changes: 6 additions & 6 deletions modules/epreload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
"@freik/electron-render": "^0.1.0",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"electron": "^30.0.9",
"eslint": "^9.4.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"electron": "^31.0.1",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ts-jest": "^29.1.4",
"ts-jest": "^29.1.5",
"typescript": "^5.4.5"
},
"files": ["lib/**/*"],
Expand Down
26 changes: 13 additions & 13 deletions modules/erenderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@freik/seqnum": "^1.1.10",
"@freik/typechk": "^0.5.11",
"@freik/web-utils": "^0.5.2",
"electron": "^30.0.9"
"electron": "^31.0.1"
},
"peerDependencies": {
"react": ">=17.0.2",
Expand All @@ -47,13 +47,13 @@
"@freik/web-utils": "^0.5.2",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.12",
"@types/react": "^17.0.80",
"@types/react-dom": "^17.0.25",
"@types/react-test-renderer": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"electron": "^30.0.9",
"eslint": "^9.4.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"electron": "^31.0.1",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
Expand All @@ -62,14 +62,14 @@
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"prettier": "^3.3.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "^5.0.1",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.3.1",
"recoil": "^0.7.7",
"rimraf": "^5.0.7",
"ts-jest": "^29.1.4",
"ts-jest": "^29.1.5",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.3",
"typescript": "^5.4.5"
Expand Down
49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"hook-push": "yarn test"
},
"dependencies": {
"@fluentui/react": "^8.118.6",
"@fluentui/react-components": "^9.53.0",
"@fluentui/react-icons-mdl2": "^1.3.67",
"@fluentui/react": "^8.118.8",
"@fluentui/react-components": "^9.54.1",
"@fluentui/react-icons-mdl2": "^1.3.69",
"@freik/audiodb": "^0.8.3",
"@freik/containers": "^0.2.13",
"@freik/electron-main": "^0.1.0",
Expand All @@ -56,8 +56,8 @@
"jimp": "^0.22.12",
"jotai": "^2.8.3",
"open": "^10.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"recoil": "^0.7.7",
"rimraf": "^5.0.7",
"xxhashjs": "^0.2.2"
Expand All @@ -71,50 +71,51 @@
]
},
"devDependencies": {
"@eslint/js": "^9.4.0",
"@eslint/js": "^9.5.0",
"@freik/build-tools": "^3.6.10",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@types/debug": "^4.1.12",
"@types/electron-devtools-installer": "^2.2.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.2",
"@types/react": "^17.0.80",
"@types/react-dom": "^17.0.25",
"@types/react-test-renderer": "^17.0.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-test-renderer": "^18.3.0",
"@types/xxhashjs": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@vitejs/plugin-react": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@vitejs/plugin-react": "^4.3.1",
"cross-env": "^7.0.3",
"electron": "^30.0.9",
"electron-builder": "^25.0.0-alpha.9",
"eslint": "^9.4.0",
"electron": "^31.0.1",
"electron-builder": "^24.13.3",
"electron-devtools-installer": "^3.2.0",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"globals": "^15.3.0",
"globals": "^15.5.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-css": "^6.0.1",
"lerna": "^8.1.3",
"lerna": "^8.1.4",
"postcss": "8.4.38",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"react-scripts": "^5.0.1",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.3.1",
"svg-react-loader": "^0.4.6",
"tree-kill": "^1.2.2",
"ts-jest": "^29.1.4",
"ts-jest": "^29.1.5",
"typescript": "^5.4.5",
"typescript-eslint": "^7.12.0",
"vite": "^5.2.12",
"typescript-eslint": "^7.13.0",
"vite": "^5.3.1",
"vite-plugin-electron": "^0.28.7",
"vite-plugin-electron-renderer": "^0.14.5"
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.3.0"
}
8 changes: 4 additions & 4 deletions src/UI/Utilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
CSSProperties,
Component,
ForwardedRef,
ReactChildren,
SyntheticEvent,
useEffect,
} from 'react';
Expand Down Expand Up @@ -245,9 +244,10 @@ export function StringSpinButton({
);
}

export class ErrorBoundary extends Component {
state: { hasError: boolean };
constructor(props: { children: ReactChildren }) {
type EBProps = { children: React.ReactNode };
type EBState = { hasError: boolean };
export class ErrorBoundary extends Component<EBProps, EBState> {
constructor(props: EBProps) {
super(props);
this.state = { hasError: false };
}
Expand Down
11 changes: 6 additions & 5 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
// import { Util } from '@freik/electron-render';
import { Util } from '@freik/electron-render';
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { FluentInitIcons } from './FluentInit';
import { App } from './UI/App';
import './UI/styles/index.css';

Util.SetInit(() => {
// unregisterIcons(['']);
FluentInitIcons();
const root = document.getElementById('root');
if (root) {
ReactDOM.render(

const container = document.getElementById('root');
if (container) {
const root = createRoot(container);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
root,
);
}
});
Expand Down
Loading

0 comments on commit 64dba39

Please sign in to comment.