chore(deps): React 19 対応(ReactDOM.render の置き換えと skipLibCheck) - #60
Merged
Conversation
React 19 では react-dom の render が削除されているため、src/index.tsx を react-dom/client の createRoot に移行した。 semantic-ui-react 2.1.5 の型定義が型定義 19 系で削除された React.ReactNodeArray を参照して TS2694 になるため、tsconfig.json の skipLibCheck を true にした。実害は型定義のみで、9つの利用コンポーネントの 描画結果は React 18 と一致することを確認済み。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
semantic-ui-react 2.1.5 の peer 依存が React 18 までのため npm ci が ERESOLVE で失敗していた。npm install は警告で通るが ci は厳密に解決する。 描画結果が React 18 と一致することは確認済みなので overrides で上書きする。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
先の再生成で @emnapi/core と @emnapi/runtime のエントリが lock から 消え、CI の npm ci が lock 不整合で失敗していた。この2つは rolldown の wasm32-wasi バイナリが optional に要求するもので、main の lock を基点に 再解決して復元した。ローカルで npm ci --ignore-scripts とビルドの通過を確認。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
前のコミットではこの2つのエントリが lock に戻っておらず、CI の npm ci が 同じ不整合で失敗していた。ローカルの npm はプレリリース版であるこの2つを 再解決時に書き出さないため、main の lock から該当エントリをそのまま復元した。 rolldown の wasm32-wasi バイナリが optional に要求するもので、 バージョンは main と同一。npm ci が lock を書き換えずに通ることを確認済み。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
概要
react / react-dom を 18.3.1 系から 19 系へ更新した。必要な修正は2箇所。
変更点
src/index.tsx: React 19 ではreact-domからrenderが削除されているため、react-dom/clientのcreateRootへ置き換えた。StrictMode の入れ子は維持tsconfig.json:skipLibCheckをtrueに変更。semantic-ui-react の型定義が型定義 19 系で削除されたReact.ReactNodeArrayを参照しており TS2694 になるためpackage.json/package-lock.json: react, react-dom, @types/react, @types/react-dom を 19 系へsemantic-ui-react について
2.1.5 が最終版で peer 依存は React 18 までのため、
npm install時に peer の警告が出る。それでも移行して問題ないと判断した根拠は、React 19 と React 18 の両方で実際に描画して HTML を比較したこと。ajime が使う Button / Icon / Form / Checkbox / Message / Input / Accordion / Divider / Label の9つで出力は完全に一致した。このうち Button / Icon / Form / Checkbox / Input は関数コンポーネントでありながら
defaultPropsを持つが、semantic-ui-react は内部のgetElementTypeでdefaultPropsを自前に読んでおり React の自動適用に依存していないため、React 19 でも効いている。findDOMNodeも文字列 ref も使っていない。実害は型定義のみ。semantic-ui-react から離れるかそのまま抱えるかは別途判断する。
検証
npm run build(tsc && vite build)がエラーなく完走することを確認。🤖 Generated with Claude Code