Conversation
📝 Walkthroughウォークスループロジェクト全体で使用されていた中央集約型の 変更内容
推定コードレビュー工数🎯 2 (シンプル) | ⏱️ ~12 分 関連する可能性があるイシュー
関連する可能性がある PR
推奨レビュアー
詩
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0375a84 to
746c3bf
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
8-8: fetcher の実装は正しいですが、クォートの統一を検討してください。実装ロジックは正しく、Rails request.js の
jsongetter を適切に使用しています(learnings に基づく)。ただし、このファイルでは"json"とダブルクォートを使用していますが、他のファイル(Bookmarks.jsx、Events.jsx、Notifications.jsx など)では'json'とシングルクォートを使用しています。Prettier が自動整形するため実害はありませんが、統一性の観点から他のファイルと揃えることをご検討ください。
必要に応じて以下の diff を適用できます:
-const fetcher = (url) => get(url, { responseKind: "json" }).then((res) => res.json) +const fetcher = (url) => get(url, { responseKind: 'json' }).then((res) => res.json)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
app/javascript/components/Bookmarks.jsx(1 hunks)app/javascript/components/BookmarksInDashboard.jsx(1 hunks)app/javascript/components/Events.jsx(1 hunks)app/javascript/components/Notifications.jsx(1 hunks)app/javascript/components/NotificationsBell/NotificationsBell.jsx(1 hunks)app/javascript/components/Products.jsx(1 hunks)app/javascript/components/RegularEvents.jsx(1 hunks)app/javascript/components/Reports.jsx(1 hunks)app/javascript/components/Tags/TagsInput.jsx(1 hunks)app/javascript/fetcher.js(0 hunks)app/javascript/tag.js(2 hunks)
💤 Files with no reviewable changes (1)
- app/javascript/fetcher.js
🚧 Files skipped from review as they are similar to previous changes (6)
- app/javascript/components/Bookmarks.jsx
- app/javascript/components/Tags/TagsInput.jsx
- app/javascript/tag.js
- app/javascript/components/Reports.jsx
- app/javascript/components/Products.jsx
- app/javascript/components/Events.jsx
🧰 Additional context used
📓 Path-based instructions (2)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/javascript/components/RegularEvents.jsxapp/javascript/components/NotificationsBell/NotificationsBell.jsxapp/javascript/components/BookmarksInDashboard.jsxapp/javascript/components/Notifications.jsx
app/javascript/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/TypeScript code in
app/javascript/should be linted with ESLint and formatted with Prettier viayarn lintscripts; use React 17 and Shakapacker/Webpack 5
Files:
app/javascript/components/RegularEvents.jsxapp/javascript/components/NotificationsBell/NotificationsBell.jsxapp/javascript/components/BookmarksInDashboard.jsxapp/javascript/components/Notifications.jsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9331
File: app/javascript/action_completed_button.js:46-53
Timestamp: 2025-12-04T01:50:46.369Z
Learning: Rails request.js の FetchResponse クラスでは、HTTP ステータスコードは `response.statusCode` プロパティでアクセスする必要がある。`response.status` ではなく `response.statusCode` を使用する。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/watches.js:78-78
Timestamp: 2025-07-26T01:11:03.921Z
Learning: Rails request.jsのFetchResponseクラスでは、text、json、htmlプロパティはgetterとして定義されており、response.text()ではなくresponse.textとしてアクセスする必要がある。getterは自動的にレスポンスをキャッシュし、jsonの場合はContent-Typeの検証も行う。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-04T07:17:55.949Z
Learning: Rails request.jsのFetchResponseクラスでは、json、text、htmlなどはgetterとして定義されており、response.json()ではなくresponse.jsonとしてアクセスする必要がある。また、getterはContent-Typeの自動チェック機能を含んでいる。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。また、Content-Typeがapplication/jsonでない場合は自動的にエラーを投げる安全性チェックも含まれている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-04T07:17:55.949Z
Learning: Rails request.jsのFetchResponseクラスでは、jsonとtextはgetterとして定義されており、それぞれPromiseを返す。jsongetterは自動的にContent-Typeをチェックし、application/jsonでない場合はエラーを投げる。また、レスポンスは一度パースされるとキャッシュされる仕組みになっている。
📚 Learning: 2025-07-04T07:15:17.639Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。
Applied to files:
app/javascript/components/RegularEvents.jsx
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
app/javascript/components/BookmarksInDashboard.jsx
🧬 Code graph analysis (3)
app/javascript/components/NotificationsBell/NotificationsBell.jsx (8)
app/javascript/components/Bookmarks.jsx (1)
fetcher(8-9)app/javascript/components/BookmarksInDashboard.jsx (1)
fetcher(7-8)app/javascript/components/Events.jsx (1)
fetcher(8-9)app/javascript/components/Notifications.jsx (1)
fetcher(9-10)app/javascript/components/Products.jsx (1)
fetcher(10-11)app/javascript/components/RegularEvents.jsx (1)
fetcher(9-10)app/javascript/components/Reports.jsx (1)
fetcher(10-11)app/javascript/components/Tags/TagsInput.jsx (1)
fetcher(10-10)
app/javascript/components/BookmarksInDashboard.jsx (8)
app/javascript/components/Bookmarks.jsx (1)
fetcher(8-9)app/javascript/components/Events.jsx (1)
fetcher(8-9)app/javascript/components/Notifications.jsx (1)
fetcher(9-10)app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
fetcher(8-8)app/javascript/components/Products.jsx (1)
fetcher(10-11)app/javascript/components/RegularEvents.jsx (1)
fetcher(9-10)app/javascript/components/Reports.jsx (1)
fetcher(10-11)app/javascript/components/Tags/TagsInput.jsx (1)
fetcher(10-10)
app/javascript/components/Notifications.jsx (8)
app/javascript/components/Bookmarks.jsx (1)
fetcher(8-9)app/javascript/components/BookmarksInDashboard.jsx (1)
fetcher(7-8)app/javascript/components/Events.jsx (1)
fetcher(8-9)app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
fetcher(8-8)app/javascript/components/Products.jsx (1)
fetcher(10-11)app/javascript/components/RegularEvents.jsx (1)
fetcher(9-10)app/javascript/components/Reports.jsx (1)
fetcher(10-11)app/javascript/components/Tags/TagsInput.jsx (1)
fetcher(10-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (4)
app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
7-7: LGTM:@rails/request.jsの import が正しく追加されています。このPR全体で統一されたパターンに従っており、問題ありません。
app/javascript/components/RegularEvents.jsx (1)
3-10: Rails request.js を使った fetcher への置き換えは妥当そうです
get(url, { responseKind: 'json' }).then((res) => res.json)で JSON を返す実装になっており、useSWRの fetcher として問題なさそうです。res.jsonをメソッドではなくプロパティとして参照しているのも、Rails request.js のjsonが getter という過去の知見と一致しています(response.json()ではなくresponse.json)。retrieved_learnings の方針どおりです。app/javascript/components/Notifications.jsx (1)
7-10: Notifications の fetcher 差し替えも他コンポーネントと揃っていて問題なさそうです
getの導入とconst fetcher = (url) => get(url, { responseKind: 'json' }).then((res) => res.json)という実装は、他のコンポーネント(Bookmarks, Events など)と完全に同じ形で、SWR 用の fetcher として妥当だと思います。- Rails request.js の
jsongetter をres.jsonとして扱っている点も、既存のプロジェクト方針・過去の PR の learnings と整合しています。app/javascript/components/BookmarksInDashboard.jsx (1)
3-8: Dashboard 用ブックマークの fetcher 置き換えと import 追加も問題なさそうです
getを追加してconst fetcher = (url) => get(url, { responseKind: 'json' }).then((res) => res.json)としている点は、他コンポーネントと同じパターンで、Rails request.js のjsongetter の使い方としても正しいと思います。useSWR(bookmarksUrl, fetcher)とmutate(bookmarksUrl)で同じキーを使っており、削除後の再フェッチもこれまでどおり動作しそうです。- BookmarksInDashboard.jsx 自体は将来的に削除予定(retrieved_learnings)なので、この PR で過度に抽象化せず最小限の差し替えに留めているのもスコープ的に良さそうです。
9736834 to
53c447a
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/javascript/tag.js (1)
3-64: タグ候補取得の request.js への移行は正しく行われています
get('/api/tags.json?taggable_type=...', { responseKind: 'json' })のレスポンスに対してawait response.jsonとしており、request.js の FetchResponse.json を getter として扱う正しい形になっています。tagify.whitelistへの代入ロジックも既存挙動と同等に見えます。なお、同ファイル内の PUT
/api/...は依然として素のfetchを使っているため、将来的にはこちらも request.js に統一するとコードスタイルとコーディングガイドラインの整合性がより高まりそうです(この PR では現状のままでも良さそうです)。As per coding guidelines, ...
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
app/javascript/components/Bookmarks.jsx(1 hunks)app/javascript/components/BookmarksInDashboard.jsx(1 hunks)app/javascript/components/Events.jsx(1 hunks)app/javascript/components/Notifications.jsx(1 hunks)app/javascript/components/NotificationsBell/NotificationsBell.jsx(1 hunks)app/javascript/components/Products.jsx(1 hunks)app/javascript/components/RegularEvents.jsx(1 hunks)app/javascript/components/Reports.jsx(1 hunks)app/javascript/components/Tags/TagsInput.jsx(1 hunks)app/javascript/fetcher.js(0 hunks)app/javascript/tag.js(2 hunks)
💤 Files with no reviewable changes (1)
- app/javascript/fetcher.js
🚧 Files skipped from review as they are similar to previous changes (4)
- app/javascript/components/Bookmarks.jsx
- app/javascript/components/NotificationsBell/NotificationsBell.jsx
- app/javascript/components/RegularEvents.jsx
- app/javascript/components/Tags/TagsInput.jsx
🧰 Additional context used
📓 Path-based instructions (3)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/javascript/components/Products.jsxapp/javascript/components/Events.jsxapp/javascript/components/Notifications.jsxapp/javascript/components/Reports.jsxapp/javascript/tag.jsapp/javascript/components/BookmarksInDashboard.jsx
app/javascript/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/TypeScript code in
app/javascript/should be linted with ESLint and formatted with Prettier viayarn lintscripts; use React 17 and Shakapacker/Webpack 5
Files:
app/javascript/components/Products.jsxapp/javascript/components/Events.jsxapp/javascript/components/Notifications.jsxapp/javascript/components/Reports.jsxapp/javascript/tag.jsapp/javascript/components/BookmarksInDashboard.jsx
**/*.js
⚙️ CodeRabbit configuration file
**/*.js: - どうしても避けられない時以外に新規にVue.js, Reactのコードを追加しない。
- fetchメソッドの代わりにrequest.jsを使う。
Files:
app/javascript/tag.js
🧠 Learnings (6)
📓 Common learnings
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9331
File: app/javascript/action_completed_button.js:46-53
Timestamp: 2025-12-04T01:50:46.369Z
Learning: Rails request.js の FetchResponse クラスでは、HTTP ステータスコードは `response.statusCode` プロパティでアクセスする必要がある。`response.status` ではなく `response.statusCode` を使用する。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/watches.js:78-78
Timestamp: 2025-07-26T01:11:03.921Z
Learning: Rails request.jsのFetchResponseクラスでは、text、json、htmlプロパティはgetterとして定義されており、response.text()ではなくresponse.textとしてアクセスする必要がある。getterは自動的にレスポンスをキャッシュし、jsonの場合はContent-Typeの検証も行う。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-04T07:17:55.949Z
Learning: Rails request.jsのFetchResponseクラスでは、json、text、htmlなどはgetterとして定義されており、response.json()ではなくresponse.jsonとしてアクセスする必要がある。また、getterはContent-Typeの自動チェック機能を含んでいる。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。また、Content-Typeがapplication/jsonでない場合は自動的にエラーを投げる安全性チェックも含まれている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-04T07:17:55.949Z
Learning: Rails request.jsのFetchResponseクラスでは、jsonとtextはgetterとして定義されており、それぞれPromiseを返す。jsongetterは自動的にContent-Typeをチェックし、application/jsonでない場合はエラーを投げる。また、レスポンスは一度パースされるとキャッシュされる仕組みになっている。
📚 Learning: 2025-07-04T07:17:55.949Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-04T07:17:55.949Z
Learning: Rails request.jsのFetchResponseクラスでは、jsonとtextはgetterとして定義されており、それぞれPromiseを返す。jsongetterは自動的にContent-Typeをチェックし、application/jsonでない場合はエラーを投げる。また、レスポンスは一度パースされるとキャッシュされる仕組みになっている。
Applied to files:
app/javascript/tag.js
📚 Learning: 2025-07-26T01:11:03.921Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/watches.js:78-78
Timestamp: 2025-07-26T01:11:03.921Z
Learning: Rails request.jsのFetchResponseクラスでは、text、json、htmlプロパティはgetterとして定義されており、response.text()ではなくresponse.textとしてアクセスする必要がある。getterは自動的にレスポンスをキャッシュし、jsonの場合はContent-Typeの検証も行う。
Applied to files:
app/javascript/tag.js
📚 Learning: 2025-07-04T07:15:17.639Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。
Applied to files:
app/javascript/tag.js
📚 Learning: 2025-07-04T07:15:17.639Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 8877
File: app/javascript/check-stamp.js:22-24
Timestamp: 2025-07-04T07:15:17.639Z
Learning: Rails request.jsライブラリでは、FetchResponseクラスのjsonプロパティはgetterとして定義されており、response.json()ではなくresponse.jsonとして使用する必要がある。また、Content-Typeがapplication/jsonでない場合は自動的にエラーを投げる安全性チェックも含まれている。
Applied to files:
app/javascript/tag.js
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
app/javascript/components/BookmarksInDashboard.jsx
🧬 Code graph analysis (2)
app/javascript/components/Reports.jsx (8)
app/javascript/components/Bookmarks.jsx (1)
fetcher(8-9)app/javascript/components/BookmarksInDashboard.jsx (1)
fetcher(7-8)app/javascript/components/Events.jsx (1)
fetcher(8-9)app/javascript/components/Notifications.jsx (1)
fetcher(9-10)app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
fetcher(8-9)app/javascript/components/Products.jsx (1)
fetcher(10-11)app/javascript/components/RegularEvents.jsx (1)
fetcher(9-10)app/javascript/components/Tags/TagsInput.jsx (1)
fetcher(10-11)
app/javascript/components/BookmarksInDashboard.jsx (8)
app/javascript/components/Bookmarks.jsx (1)
fetcher(8-9)app/javascript/components/Events.jsx (1)
fetcher(8-9)app/javascript/components/Notifications.jsx (1)
fetcher(9-10)app/javascript/components/NotificationsBell/NotificationsBell.jsx (1)
fetcher(8-9)app/javascript/components/Products.jsx (1)
fetcher(10-11)app/javascript/components/RegularEvents.jsx (1)
fetcher(9-10)app/javascript/components/Reports.jsx (1)
fetcher(10-11)app/javascript/components/Tags/TagsInput.jsx (1)
fetcher(10-11)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (5)
app/javascript/components/Products.jsx (1)
7-11: request.js を使った fetcher への置き換えは妥当です
get(url, { responseKind: 'json' })に対してres.jsonをプロパティ参照しており、request.js の FetchResponse.json の仕様に沿った書き方になっています。既存のfetcherと同等の振る舞いになりそうで、特に懸念ありません。Based on learnings, ...app/javascript/components/Events.jsx (1)
6-9: Events の fetcher 置き換えも一貫していて問題ありません
getの導入とconst fetcher = (url) => get(url, { responseKind: 'json' }).then((res) => res.json)への差し替えは、他コンポーネントと同じパターンで、SWR の呼び出し側もそのままなので挙動は維持できていそうです。Based on learnings, ...app/javascript/components/BookmarksInDashboard.jsx (1)
3-8: Dashboard 用ブックマークの取得も request.js ベースに正しく移行できています
getを使ったfetcherの定義と、destroyの import 元を request.js に揃えたことで、取得・削除ともに同じライブラリに統一されており、SWR・mutate周りのフローも従来どおり維持できていそうです。As per coding guidelines, ...app/javascript/components/Notifications.jsx (1)
7-10: 通知一覧の fetcher 置き換えは SWR パターンと整合しています
apiUrlを SWR のキー関数として渡しつつ、fetcherを request.js ベースに差し替えており、res.jsonをプロパティとして扱う形も他ファイルと揃っているため、不整合はなさそうです。Based on learnings, ...app/javascript/components/Reports.jsx (1)
3-11: 日報一覧の fetcher も request.js ベースに問題なく差し替えられています
get(url, { responseKind: 'json' }).then((res) => res.json)によるローカル fetcher 定義は、他コンポーネントと同じパターンで、request.js の json getter 仕様にも沿っているため、この置き換えによる挙動差はほぼなく安全そうです。Based on learnings, ...
a54833f to
bf1cd7e
Compare
|
お疲れ様です! |
bf1cd7e to
abdddb3
Compare
|
#9257 (comment)
|
|
@yokomaru お待たせしていたにもかかわらず、大変申し訳ないのですが、以上よろしくお願いいたします。 |
|
@kutimiti1234 |
|
@karlley |
|
@yokomaru |
|
@karlley |
Issue
概要
fetcher.jsから@rails/request.js(get)に置き換え、fetcher.js を削除影響ファイル
実装方針
fetcher.jsの削除を優先するfetcher.jsを使用している箇所に直接ロジックを記述する(Issue fetcher.jsを撤廃したい #9257 にて駒形さんに確認済み)rails/request.jsはjsonをgetterとして定義している(参考)ため、.then(res => res.json)のような記述となっている(関数参照をしているわけではない)変更確認方法
1)ブランチを取り込む
chore/replace_fetcher_js_with_request_jsをローカルに取り込む2)ローカルサーバの立ち上げ
foreman start -f Procfile.devを実行3)画面でデータ取得できていることを確認する
kimuraでログインして以下を確認BookmarksInDashboard.jsx
NotificationsBell.jsx
Reports.jsx
komagataでログインして以下を確認(他の管理者権限のあるユーザーでもOK)Products.jsx
どの権限ユーザーでもOK
RegularEvents.jsx
タグ入力関連
TagsInput.jsx
tag.js
4) NetWorkタブでAPIレスポンスを確認する(レビュワーの方は確認不要)
NetWorkタブでのステータス確認
NetWorkタブでの確認
200または304が帰ってくることを確認200を返したい場合はブラウザキャッシュをクリアorシークレットウィンドウで実行確認手順
BookmarksInDashboard.jsx
bookmarks.jsonのAPIレスポンスが200または304が帰ってくることを確認スクショ
NotificationsBell.jsx
notifications.jsonのAPIレスポンスが200または304が帰ってくることを確認スクショ
Reports.jsx
reports.jsonのAPIレスポンスが200または304が帰ってくることを確認スクショ
komagataでログインして以下を確認(他の管理者権限のあるユーザーでもOK)Products.jsx
productsのAPIレスポンスが200または304が帰ってくることを確認スクショ
どのユーザーでもOK
定期イベント
RegularEvents.jsx
regular_eventsのAPIレスポンスが200または304が帰ってくることを確認スクショ
タグ入力
TagsInput.jsx
tags.jsonのAPIレスポンスが200または304が帰ってくることを確認スクショ
tag.js
tags.jsonのAPIレスポンスが200または304が帰ってくることを確認スクショ
Screenshot
見た目の変更はありません。
Summary by CodeRabbit
リリースノート
✏️ Tip: You can customize this high-level summary in your review settings.