feat(react19): migrate React 18 to 19 - #54
Merged
Merged
Conversation
Upgrade react/react-dom ^18.3.1 -> ^19.3.0 and @types/react(+dom) to ^19.3.0 (versions aligned); drop the React>=19 ignore block from .github/dependabot.yml now that React 19 has landed. React 19 impact surface (grep-audited): - forwardRef: 1 site (ResumePreview), still supported, kept as-is - no react-dom/test-utils, findDOMNode or ReactDOM.render usage; entry already createRoot; RTL 16 provides the act compat layer - RefObject/MutableRefObject prop types widened to React 19 semantics (useRef<T>(null) now yields RefObject<T | null>) Test-convention updates (React 19 evidence, assertions not loosened): - GenerateResumeModal: mock now returns running before completed, and the "watching" declaration now detaches only on modal close - React 19's passive-effect scheduling made the pre-existing race between watchResumeTask's immediate tick and the completion-driven detach deterministic; closing the modal mid-generation still escalates to the centered modal (covered by the existing test) - SettingsPage ApiKeyInput: antd 6 Password controlled visibility settles one tick late; type assertions await waitFor - QuestionBankPanel: wait for the collapse button to leave antd's loading debounce window before clicking Verified: vitest 801/801, eslint 0 errors (11 pre-existing warnings), tsc clean, prettier clean, rolldown build ok, dev smoke ok, lockfile platform bindings match main (rolldown 15 / lightningcss 12 / fsevents 1).
The navigation settings card fetches visibility on mount; while loading the reset button is disabled and React swallows the click. On slower CI runners the mock resolution lost the race. Assertions unchanged.
magicapple123
added a commit
that referenced
this pull request
Oct 2, 2026
antd 6 Form.useWatch notifies asynchronously and React 19 scheduling defers the re-render, so on slow CI machines the synchronous assertion read the fallback text before data injection rendered. Waits for the correct value to land (findByText) — assertion values unchanged. Fixes the post-#54 main CI Frontend flake.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
react/react-dom^18.3.1→^19.3.0,@types/react/@types/react-dom→^19.3.0(版本逐字对齐)。同时删除.github/dependabot.ymlnpm 段中 react/react-dom/@types/react/@types/react-dom 的>=19ignore 块(连同注释)——React 19 已正式落地。Peer 全链核查(React 19 前置确认)
antd@6.6.5:react >= 18✓(且 v6 不再需要 react-19 patch)react-router-dom@7.18.2:react >= 18✓@testing-library/react@16.3.3:^18.0.0 || ^19.0.0✓(自带 act 兼容层)React 19 代码面(grep 审计)
forwardRef仅 1 处(ResumePreview),v19 仍支持,本次不动结构react-dom/test-utils、findDOMNode、ReactDOM.render用法;入口已是createRootuseRef<T>(null)返回RefObject<T | null>,相关组件 ref prop 类型同步放宽(ResumePreviewCanvas / ResumePreviewToolbar / ResumeDetailPreview / AssistantMessageList / useAssistantStream 等)测试惯例变化(断言不放松,均有证据)
watchResumeTask注册时会"立刻拉一次",此前 mock 让任务注册瞬间即 completed,finish()对"界面在看"的判定与弹窗完成收尾的 detach 存在竞态——React 19 的被动副作用落点使其从偶发变为确定性发生。修复:① mock 忠实于真实时序(首次 running、其后 completed);② "在看"声明改为只在弹窗真正关闭时 detach(完成收尾置空 taskId 不再误判"用户已走开")。"关闭弹窗后台继续 → 居中弹窗"的既有用例仍然通过。visible经内部 effect 同步,React 19 下晚一拍落地,type翻转断言改用waitFor。Button.handleClick对 innerLoading 直接 return),收起前先等按钮退出 loading 态。验证
npm run test:123 文件 / 801 用例全绿npm run lint:0 error / 11 warning(存量基线持平)npm run typecheck、format:check:通过