Skip to content

Commit 52e65f3

Browse files
authored
chore(code): upgrade Electron 42, React 19.2, Vite 7 and deps (#2817)
## Problem We had fallen several majors behind on core dependencies (Electron 41, React 19.1, Vite 6) plus a long tail of libraries, missing performance, security and bug fixes. A previous attempt (#2512) predated the electron-builder and electron-vite migration and was closed, so this redoes the upgrade from first principles on top of that work. ## Changes Dependency modernization across the monorepo: - Electron 41 to 42 (42.4.0). Native modules now rebuild against Electron 42's ABI (146), so a `node-abi: ^3.92.0` override is added (older node-abi can't resolve Electron 42's ABI). - better-sqlite3 to 12.10.1, which ships the upstream V8 sandbox external-pointer-tag fix for Electron 42's V8 (14.6), so it compiles cleanly with no patch. - React 19.1 to 19.2.6, unified across code, web and mobile via overrides. `@types/react` and `@types/react-dom` are deduped to one copy (a second copy made nominally distinct `Ref` types and broke shared UI ref props). - Vite 6 to 7 (with `@vitejs/plugin-react` on the Vite 7 line). Not Vite 8 or Rolldown: electron-vite 4 supports `vite ^5 || ^6 || ^7`, so 7 is the ceiling. - tRPC 11.12 to 11.17, TanStack Query 5.90 to 5.101 and Router 1.95 to 1.170, Tailwind 4.2 to 4.3, Storybook 10.2 to 10.4, Playwright 1.42 to 1.60, turbo 2.6 to 2.9, plus minor bumps (MCP SDK, drizzle, electron-log, posthog-node, semver, dotenv, fflate, jimp, memfs, postcss, tsx, typed-openapi, yaml, adm-zip). - zod deduped to a single 4.x line (`zod@^4.0.0` override) so cross-package schema types stay nameable. - Two small code adaptations for the upgraded APIs: the TanStack Query `setQueryData` call sites in `useSignalTeamConfigMutations` and `useTaskMutations` (a typed optimistic value and an explicit updater generic). Stacked on #2811 (electron-vite migration); review against `refactor/electron-vite`. ## How did you test this? Locally on macOS arm64: - `pnpm install` resolves cleanly and rebuilds better-sqlite3 against Electron 42.4.0 with no patch. - `pnpm typecheck` (22 of 22 packages), `pnpm lint` and `pnpm build` all pass. - `pnpm test` passes (`@posthog/core` 1615 tests and the rest). `@posthog/git` and `@posthog/agent` pass in isolation; they only flaked under concurrent build-plus-test load (a 15s git-ops timeout), not on their own. The standard PR checks (typecheck, build, unit tests) run on this PR. The full signed and notarized multi-platform packaging, with the Electron 42 native rebuild and smoke test, runs via the build workflow on `refactor/electron-vite` once this lands there. ## Automatic notifications - [ ] Publish to changelog? - [ ] Alert Sales and Marketing teams?
1 parent 0c36e81 commit 52e65f3

10 files changed

Lines changed: 4121 additions & 2690 deletions

File tree

apps/code/package.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,48 +42,48 @@
4242
"license": "MIT",
4343
"devDependencies": {
4444
"@biomejs/biome": "2.2.4",
45-
"@playwright/test": "^1.42.0",
46-
"@posthog/rollup-plugin": "^1.4.0",
47-
"@storybook/addon-a11y": "10.2.0",
48-
"@storybook/addon-docs": "10.2.0",
49-
"@storybook/react-vite": "10.2.0",
45+
"@playwright/test": "^1.60.0",
46+
"@posthog/rollup-plugin": "^1.4.4",
47+
"@storybook/addon-a11y": "10.4.1",
48+
"@storybook/addon-docs": "10.4.1",
49+
"@storybook/react-vite": "10.4.1",
5050
"@tanstack/devtools-vite": "^0.7.0",
5151
"@testing-library/jest-dom": "^6.9.1",
5252
"@testing-library/react": "^16.3.0",
5353
"@testing-library/user-event": "^14.6.1",
5454
"@types/better-sqlite3": "^7.6.13",
5555
"@types/canvas-confetti": "^1.9.0",
5656
"@types/node": "^24.0.0",
57-
"@types/react": "^19.1.0",
58-
"@types/react-dom": "^19.1.0",
57+
"@types/react": "^19.2.15",
58+
"@types/react-dom": "^19.2.3",
5959
"@types/semver": "^7.7.1",
60-
"@vitejs/plugin-react": "^4.2.1",
60+
"@vitejs/plugin-react": "^4.7.0",
6161
"@vitest/ui": "^4.1.8",
62-
"adm-zip": "^0.5.16",
63-
"electron": "^41.0.0",
62+
"adm-zip": "^0.5.17",
63+
"electron": "^42.3.0",
6464
"electron-builder": "^26.15.3",
6565
"electron-vite": "^4.0.1",
6666
"husky": "^9.1.7",
67-
"jimp": "^1.6.0",
67+
"jimp": "^1.6.1",
6868
"jsdom": "^26.0.0",
6969
"lint-staged": "^15.5.2",
70-
"memfs": "^4.56.10",
71-
"postcss": "^8.4.33",
72-
"storybook": "10.2.0",
73-
"tailwindcss": "^4.2.2",
74-
"tsx": "^4.20.6",
75-
"typed-openapi": "^2.2.2",
70+
"memfs": "^4.57.3",
71+
"postcss": "^8.5.15",
72+
"storybook": "10.4.1",
73+
"tailwindcss": "^4.3.0",
74+
"tsx": "^4.22.3",
75+
"typed-openapi": "^2.2.6",
7676
"typescript": "^5.9.3",
77-
"vite": "^6.0.7",
78-
"vite-tsconfig-paths": "^5.1.4",
77+
"vite": "^7.0.0",
78+
"vite-tsconfig-paths": "^6.0.0",
7979
"vitest": "^4.1.8",
80-
"yaml": "^2.8.1"
80+
"yaml": "^2.9.0"
8181
},
8282
"dependencies": {
8383
"@fontsource-variable/inter": "^5.2.8",
8484
"@inversifyjs/strongly-typed": "2.2.0",
8585
"@json-render/core": "^0.19.0",
86-
"@modelcontextprotocol/sdk": "^1.12.1",
86+
"@modelcontextprotocol/sdk": "^1.29.0",
8787
"@opentelemetry/api-logs": "^0.208.0",
8888
"@opentelemetry/exporter-logs-otlp-http": "^0.208.0",
8989
"@opentelemetry/resources": "^2.5.0",
@@ -109,21 +109,21 @@
109109
"@posthog/workspace-client": "workspace:*",
110110
"@posthog/workspace-server": "workspace:*",
111111
"@radix-ui/themes": "^3.2.1",
112-
"@tailwindcss/vite": "^4.2.2",
113-
"@tanstack/react-query": "^5.90.2",
114-
"@tanstack/router-plugin": "^1.95.0",
115-
"@trpc/client": "^11.12.0",
116-
"@trpc/server": "^11.12.0",
117-
"@trpc/tanstack-react-query": "^11.12.0",
118-
"better-sqlite3": "^12.8.0",
112+
"@tailwindcss/vite": "^4.3.0",
113+
"@tanstack/react-query": "^5.100.14",
114+
"@tanstack/router-plugin": "^1.168.13",
115+
"@trpc/client": "^11.17.0",
116+
"@trpc/server": "^11.17.0",
117+
"@trpc/tanstack-react-query": "^11.17.0",
118+
"better-sqlite3": "^12.10.1",
119119
"chokidar": "^5.0.0",
120120
"detect-libc": "^1.0.3",
121-
"dotenv": "^17.2.3",
122-
"drizzle-orm": "^0.45.1",
123-
"electron-log": "^5.4.3",
121+
"dotenv": "^17.4.2",
122+
"drizzle-orm": "^0.45.2",
123+
"electron-log": "^5.4.4",
124124
"electron-store": "^11.0.0",
125125
"electron-updater": "^6.8.9",
126-
"fflate": "^0.8.2",
126+
"fflate": "^0.8.3",
127127
"file-icon": "^6.0.0",
128128
"fzf": "^0.5.2",
129129
"ignore": "^7.0.5",
@@ -133,17 +133,17 @@
133133
"node-addon-api": "^8.5.0",
134134
"node-machine-id": "^1.1.12",
135135
"node-pty": "1.1.0",
136-
"posthog-node": "^5.24.10",
136+
"posthog-node": "^5.35.6",
137137
"radix-themes-tw": "0.2.3",
138-
"react": "19.1.0",
139-
"react-dom": "19.1.0",
138+
"react": "19.2.6",
139+
"react-dom": "19.2.6",
140140
"react-hotkeys-hook": "^4.4.4",
141141
"reflect-metadata": "^0.2.2",
142-
"semver": "^7.6.0",
142+
"semver": "^7.8.1",
143143
"shadcn": "^4.1.2",
144-
"smol-toml": "^1.6.0",
144+
"smol-toml": "^1.6.1",
145145
"tailwindcss-scroll-mask": "^0.0.3",
146146
"tw-animate-css": "^1.4.0",
147-
"zod": "^4.1.12"
147+
"zod": "^4.4.3"
148148
}
149149
}

apps/web/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"@posthog/shared": "workspace:*",
1919
"@posthog/ui": "workspace:*",
2020
"@posthog/workspace-client": "workspace:*",
21-
"@tanstack/react-query": "^5.90.2",
22-
"@trpc/client": "^11.12.0",
23-
"@trpc/tanstack-react-query": "^11.12.0",
21+
"@tanstack/react-query": "^5.100.14",
22+
"@trpc/client": "^11.17.0",
23+
"@trpc/tanstack-react-query": "^11.17.0",
2424
"inversify": "^7.10.6",
25-
"react": "19.1.0",
26-
"react-dom": "19.1.0",
25+
"react": "19.2.6",
26+
"react-dom": "19.2.6",
2727
"reflect-metadata": "^0.2.2"
2828
},
2929
"devDependencies": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"knip": "^5.66.3",
5454
"lint-staged": "^15.5.2",
5555
"mprocs": "^0.7.1",
56-
"turbo": "^2.6.2"
56+
"turbo": "^2.9.16"
5757
},
5858
"lint-staged": {
5959
"*.{ts,tsx,js,jsx}": [

packages/electron-trpc/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"@trpc/client": "^11.8.0",
3333
"@trpc/server": "^11.8.0",
3434
"@types/node": "^24.0.0",
35-
"@vitest/coverage-v8": "^0.34.0",
36-
"electron": "^41.0.0",
35+
"@vitest/coverage-v8": "^2.1.8",
36+
"electron": "^42.3.0",
3737
"superjson": "^2.2.2",
3838
"typescript": "^5.8.3",
39-
"vite": "^6.0.7",
39+
"vite": "^7.0.0",
4040
"vitest": "^2.1.8",
4141
"zod": "^4.2.0"
4242
},

packages/host-router/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"@posthog/shared": "workspace:*",
2525
"@posthog/workspace-client": "workspace:*",
2626
"@posthog/workspace-server": "workspace:*",
27-
"@trpc/client": "catalog:"
27+
"@trpc/client": "catalog:",
28+
"zod": "^4.4.3"
2829
},
2930
"peerDependencies": {
3031
"@tanstack/react-query": "catalog:",

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"unified": "^11.0.5",
109109
"virtua": "^0.48.6",
110110
"vscode-icons-js": "^11.6.1",
111+
"zod": "^4.4.3",
111112
"zustand": "^4.5.0"
112113
},
113114
"peerDependencies": {

packages/ui/src/features/inbox/hooks/useSignalTeamConfigMutations.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ export function useSignalTeamConfigMutations() {
6767
);
6868

6969
if (previous) {
70+
const optimistic: SignalTeamConfig = {
71+
...previous,
72+
autostart_base_branches: branches,
73+
};
7074
queryClient.setQueryData<SignalTeamConfig | null>(
7175
TEAM_CONFIG_QUERY_KEY,
72-
{
73-
...previous,
74-
autostart_base_branches: branches,
75-
},
76+
optimistic,
7677
);
7778
}
7879

packages/ui/src/features/tasks/useTaskMutations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ export function useRenameTask() {
124124
if (previousDetail) {
125125
queryClient.setQueryData<Task | undefined>(
126126
taskKeys.detail(taskId),
127-
(current) => rollbackDetailData(current, previousDetail, newTitle),
127+
(current) =>
128+
rollbackDetailData<Task>(current, previousDetail, newTitle),
128129
);
129130
}
130131
if (rollbackSession) {

0 commit comments

Comments
 (0)