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.
このプルリクエストには、クライアントサイドAPI処理の大幅な更新、
InputMessage
コンポーネントのリファクタリング、およびサーバーサイドCORS設定が含まれています。最も重要な変更点は、転送ロジックの統合、APIフックのリファクタリング、InputMessage
コンポーネントの機能強化です。クライアントサイドAPI処理:
client/src/api/transport.ts
からの共有TRANSPORT
インスタンスを使用するようにAPIフックをリファクタリングしました。この変更により、コードが簡素化され、アプリケーション全体の転送設定の一貫性が確保されます。[1] [2] [3] [4] [5] [6]useSWRMutation
を使用するようにAPIフックを更新し、可読性と保守性を向上させるため、フェッチャー関数を改善しました。[1] [2] [3] [4] [5]TRANSPORT
インスタンスをエクスポートする新しいファイルclient/src/api/transport.ts
を追加しました。コンポーネントのリファクタリング:
useCallback
を使用するようにInputMessage
コンポーネントをリファクタリングし、ローディング状態管理によるメッセージ送信ロジックを追加しました。これにより、複数回送信を防ぎ、パフォーマンスとユーザーエクスペリエンスが向上します。sendMessage
ボタンを無効にするように更新し、role
属性とaria-label
属性を追加することでアクセシビリティを向上させました。サーバーサイド設定:
server/src/router.rs
にCORS設定を追加しました。この変更により、フロントエンドがCORSの問題なくバックエンドと通信できるようになります。[1] [2]その他の変更点:
client/src/pixi/Canvas.tsx
とclient/src/pixi/World.tsx
を更新しました。[1] [2] [3] [4] [5]client/src/state/userPosition.ts
に新しいuserPositionAtom
を導入しました。これらの変更は、コードベースの保守性、パフォーマンス、および機能を総合的に向上させます。