diff --git a/apps/electron-backend/tsconfig.json b/apps/electron-backend/tsconfig.json index 522574b2b..0d3637e7d 100644 --- a/apps/electron-backend/tsconfig.json +++ b/apps/electron-backend/tsconfig.json @@ -4,7 +4,9 @@ "types": ["node"], "moduleResolution": "nodenext", "module": "NodeNext", - "ignoreDeprecations": "6.0" + "ignoreDeprecations": "6.0", + "target": "ES2022", + "useDefineForClassFields": false }, "include": ["**/*.ts"] } diff --git a/docs/development/electron-debugging.md b/docs/development/electron-debugging.md index f4c594095..4ee34e510 100644 --- a/docs/development/electron-debugging.md +++ b/docs/development/electron-debugging.md @@ -134,3 +134,17 @@ from `app.asar`. The preload is [workspace shell](../architecture/workspace-shell.md) for window behavior, [DB worker](../architecture/sqlite-db-worker.md) for worker ownership and [Electron security](../architecture/electron-security.md) for bridge boundaries. + +`apps/electron-backend/tsconfig.json` sets `"target": "ES2022"` for the +main-process bundles (`main.js`, `main.app.js`, `deferred-events.js`), the +preloads and the backend's Jest specs; `tsconfig.base.json` stays at `es2015` +because other projects inherit it. Electron 43 (Node 24 and Chromium's V8) runs +ES2022 natively in the main process and in the sandboxed preload, so +async/await, optional chaining and `??` are no longer downleveled. +`"useDefineForClassFields": false` keeps the class-field semantics of the old +target (constructor assignment, not `[[Define]]`), so only syntax changed. The +workers built by `build-worker.js` (esbuild, `node18`) were already native. On +2026-09-29 the four bundles shrank from 2,008,115 to 1,853,599 bytes (every +inlined `__awaiter` gone); neither main-process CPU time to `did-finish-load` +nor the J1 launch journey's wall-clock changed measurably in an interleaved +A/B, and J1's counters were identical.