Skip to content

chore(deps): React 18 → 19 (react + react-dom + types) with JSX namespace fix - #211

Merged
oratis merged 1 commit into
mainfrom
deps/react-19
Aug 2, 2026
Merged

chore(deps): React 18 → 19 (react + react-dom + types) with JSX namespace fix#211
oratis merged 1 commit into
mainfrom
deps/react-19

Conversation

@oratis

@oratis oratis commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Supersedes #170 and #171.

Why these couldn't merge as-is

Dependabot split the React upgrade across two PRs — #170 bumps react + @types/react, #171 bumps react-dom + @types/react-dom. Neither can merge alone: each leaves the tree with react@19 + react-dom@18 (or the reverse), which is an unsupported combination. That's why #170 has been red since June.

Both are also missing the code change React 19 requires.

The code change

React 19's @types/react removed the global JSX namespace. It now lives under React.JSX and is re-exported as a named type from 'react'. This repo has 38 JSX.Element annotations across 25 desktop files that resolved against the old global, and every one fails with TS2503: Cannot find namespace 'JSX' under the new types.

Each file now imports the type explicitly, merged into its existing 'react' import where one exists so no duplicate-import lint warning appears — root lint is --max-warnings=0 as of #210.

-import { useCallback, useEffect, useState } from 'react';
+import { useCallback, useEffect, useState, type JSX } from 'react';

A note on how this was verified

My first local run of pnpm typecheck passed and it was wrong. tsc -b is incremental and reused .tsbuildinfo, silently skipping the desktop project — the exact project the breakage was in. CI caught what the local incremental build hid.

Everything below was re-run with tsc -b --force:

  • tsc -b --force — clean
  • pnpm lint (--max-warnings=0) — clean
  • pnpm format:check — clean
  • pnpm test1033 tests across 8 packages pass
  • pnpm build — clean
  • pnpm --filter @deepcode/desktop test:e2edesktop Playwright protocol journey, 4/4 pass

The browser journey matters here specifically: React 19 changes runtime behaviour, not just types, so a green typecheck alone would not have been sufficient evidence. The fixture from #193 exercises the real renderer bridge.

Scope

Types-only change to application code — no component logic, no hooks, no rendering behaviour touched. Versions land at react@19.2.8, react-dom@19.2.8, @types/react@19.2.18, @types/react-dom@19.2.3.

🤖 Generated with Claude Code

Supersedes #170 and #171, which each bump only half the pair and cannot
merge independently — react@19 with react-dom@18 (or vice versa) is a
broken tree.

React 19's @types/react removes the global `JSX` namespace; it now lives
under `React.JSX` and is re-exported as a named type from 'react'. 38
`JSX.Element` references across 25 desktop files were resolving against
the old global and fail with TS2503 under the new types. Each file now
imports the type explicitly, merged into its existing 'react' import
where one exists so no duplicate-import lint warning is introduced
(root lint is --max-warnings=0 as of #210).

Verified with a forced rebuild (`tsc -b --force`) rather than an
incremental one — `tsc -b` reuses .tsbuildinfo and silently skips the
desktop project, which masks exactly this class of failure.

- tsc -b --force, lint (--max-warnings=0), format:check: clean
- 1033 tests across 8 packages: pass
- pnpm build: pass
- desktop Playwright protocol journey (4 tests): pass

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oratis
oratis merged commit 2199b8f into main Aug 2, 2026
5 checks passed
oratis pushed a commit that referenced this pull request Aug 2, 2026
Supersedes #138 and #139, which are coupled (plugin-react 6 requires
vite 7+) and were deferred in June because `vite build` failed with
`Rolldown failed to resolve import "openai"` — vite 8 swaps in the
rolldown bundler, and the renderer was transitively pulling
core/dist/providers/deepseek.js.

That blocker is gone: #192 split dependency-free model metadata from the
provider implementation specifically so provider/OpenAI SDK code is
absent from renderer bundles. The import rolldown could not resolve no
longer reaches the renderer graph, so no `build.rolldownOptions.external`
migration is needed.

Also replaces `__dirname` with `import.meta.dirname` in vite.config.ts.
vite 8 warns that `__dirname` is unsupported by `configLoader: 'native'`,
which is planned to become the default in a future major. The repo
requires Node >=22, so `import.meta.dirname` is available.

Verified on top of React 19 (#211), forced rebuild throughout:
- tsc -b --force, lint (--max-warnings=0), format:check: clean
- 1033 tests across 8 packages: pass
- pnpm build + full build:tauri-assets pipeline: pass
  (app-server.cjs 599,395 bytes — within the 768 KiB #208 budget)
- desktop Playwright protocol journey (4 tests): pass

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
oratis added a commit that referenced this pull request Aug 2, 2026
Supersedes #138 and #139, which are coupled (plugin-react 6 requires
vite 7+) and were deferred in June because `vite build` failed with
`Rolldown failed to resolve import "openai"` — vite 8 swaps in the
rolldown bundler, and the renderer was transitively pulling
core/dist/providers/deepseek.js.

That blocker is gone: #192 split dependency-free model metadata from the
provider implementation specifically so provider/OpenAI SDK code is
absent from renderer bundles. The import rolldown could not resolve no
longer reaches the renderer graph, so no `build.rolldownOptions.external`
migration is needed.

Also replaces `__dirname` with `import.meta.dirname` in vite.config.ts.
vite 8 warns that `__dirname` is unsupported by `configLoader: 'native'`,
which is planned to become the default in a future major. The repo
requires Node >=22, so `import.meta.dirname` is available.

Verified on top of React 19 (#211), forced rebuild throughout:
- tsc -b --force, lint (--max-warnings=0), format:check: clean
- 1033 tests across 8 packages: pass
- pnpm build + full build:tauri-assets pipeline: pass
  (app-server.cjs 599,395 bytes — within the 768 KiB #208 budget)
- desktop Playwright protocol journey (4 tests): pass

Co-authored-by: t <t@t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
oratis added a commit that referenced this pull request Aug 2, 2026
…ajors (#215)

Covers the 31-PR Codex alignment stack (#180-#210) plus the dependency
work (#211-#214, #155, #177-#179).

Leads with the security section because that is what this release is:
the central tool gate could be skipped entirely when `mode` was omitted
(#181), and the desktop renderer held provider credentials (#192).

Upgrade notes call out the two things a user could otherwise be
surprised by — the ~6.7 MB → ~115 MB desktop size increase from the Node
sidecar, and that the plugin capability RPC is not an OS boundary.

Co-authored-by: t <t@t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant