Skip to content

Commit c8db25f

Browse files
committed
refactor: Adjust many react components to be compatible with the react compiler
1 parent 4cb8b4c commit c8db25f

25 files changed

+628
-668
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ Install by running ``sudo apt install libgtk-3-0 libnss3``
4848

4949
4. Run ``npm run start`` (at the root of the repository) to start the launcher. It is recommended to do this in a second command prompt / terminal.
5050

51-
5. **Optional** - It is highly recommended to set the launcher's "Flashpoint folder". This is where the launcher will read and write most data to and from. You can set the "Flashpoint folder" path at the "Config" tab in the launcher. Make sure the background of the text field is green (this means the path is valid) and don't forget to hit "Save and Exit"!
51+
5. React components use the React Compiler. If creating new components please make sure they are compiled, see this extension for a handy IDE hint in Vscode. Existing components are fine to be skipped. https://marketplace.visualstudio.com/items?itemName=blazejkustra.react-compiler-marker
52+
53+
6. **Optional** - It is highly recommended to set the launcher's "Flashpoint folder". This is where the launcher will read and write most data to and from. You can set the "Flashpoint folder" path at the "Config" tab in the launcher. Make sure the background of the text field is green (this means the path is valid) and don't forget to hit "Save and Exit"!
5254

5355
Notes:
5456

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default tseslint.config(
5050
"@typescript-eslint/no-namespace": "off",
5151
"@typescript-eslint/no-unused-vars": ["error", {
5252
"vars": "all",
53+
"caughtErrors": "none",
5354
"args": "none"
5455
}],
5556
"@typescript-eslint/no-use-before-define": "off",

package-lock.json

Lines changed: 117 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"axios": "1.6.7",
4343
"connected-react-router": "6.9.2",
4444
"dns-packet": "^5.6.1",
45-
"electron-extension-installer": "^1.2.0",
45+
"electron-extension-installer": "1.2.0",
4646
"electron-updater": "4.3.1",
4747
"electron-util": "0.14.2",
4848
"fast-xml-parser": "3.21.1",
@@ -89,6 +89,7 @@
8989
"@swc/cli": "0.3.12",
9090
"@swc/core": "1.5.5",
9191
"@types/dns-packet": "^5.6.5",
92+
"@types/electron-devtools-installer": "^2.2.5",
9293
"@types/eslint__js": "^8.42.3",
9394
"@types/follow-redirects": "1.8.0",
9495
"@types/fs-extra": "8.1.0",

rsbuild.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ import { defineConfig } from '@rsbuild/core';
22
import { pluginReact } from '@rsbuild/plugin-react';
33
import { pluginBabel } from '@rsbuild/plugin-babel';
44
import { builtinModules } from 'node:module';
5+
import { Logger, LoggerEvent, CompilerPipelineValue } from 'babel-plugin-react-compiler';
6+
7+
const stdoutLogger: Logger = {
8+
logEvent: (filename: string | null, event: LoggerEvent) => {
9+
console.error('LOG');
10+
},
11+
12+
debugLogIRs: (value: CompilerPipelineValue) => {
13+
console.error('LOG');
14+
}
15+
};
516

617
const externals = {
718
'electron': 'commonjs electron'
@@ -12,7 +23,8 @@ for (const module of builtinModules) {
1223

1324
const ReactCompilerConfig = {
1425
target: '17',
15-
sources: (filename) => {
26+
logger: stdoutLogger,
27+
sources: (filename: string) => {
1628
return filename.indexOf('src/renderer/') !== -1;
1729
},
1830
};

0 commit comments

Comments
 (0)