Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📊 Test Coverage Report
|
There was a problem hiding this comment.
Pull request overview
This PR removes unnecessary manual serialization of Date and bigint types from RPC endpoints, relying on oRPC's built-in serialization capabilities instead. This simplifies the codebase by eliminating manual .toISOString() conversions for dates and .toString() conversions for bigints, as well as removing type definitions for serialized formats.
Changes:
- Updated type definitions to use native
Dateandbiginttypes instead of strings - Simplified RPC endpoint handlers by removing manual serialization and restructuring return values
- Updated frontend hooks and components to work directly with native types
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/comps/types/nfl.ts | Changed NflPrediction.createdAt from string to Date type |
| apps/comps/rpc/router/nfl/get-predictions.ts | Removed manual date serialization and object wrapping; now returns predictions array directly |
| apps/comps/rpc/router/nfl/get-game-info.ts | Removed manual date serialization and object wrapping; now returns game object directly |
| apps/comps/rpc/router/airdrop/get-next-season-eligibility.ts | Removed manual bigint/date serialization; uses spread operator to return eligibility data |
| apps/comps/rpc/router/admin/bonus-boost/revoke.ts | Removed .toISOString() call on revokedAt date field |
| apps/comps/hooks/useNextSeasonEligibility.ts | Removed manual type conversions and interface definitions; uses inferred types from router outputs |
| apps/comps/components/nfl/predictions-table.tsx | Updated to access predictions array directly instead of through data.predictions |
| apps/comps/components/nfl/nfl-standings-table.tsx | Updated to access predictions array directly instead of through data.predictions |
| apps/comps/components/nfl/brier-score-chart.tsx | Updated to access predictions array directly instead of through data.predictions |
| createdAt: p.createdAt.toISOString(), | ||
| })), | ||
| }; | ||
| return predictions; |
There was a problem hiding this comment.
The return structure has changed from an object with a predictions property to returning the array directly. This is a breaking change that will cause existing E2E tests to fail. The tests in apps/comps/e2e/tests/nfl-competition.test.ts expect to access data.predictions (lines 682, 683, 899, 900, 914), but this change makes the array the top-level return value.
If this breaking change is intentional, the E2E tests need to be updated accordingly. If not, the return structure should be preserved as { predictions } for backward compatibility.
| return predictions; | |
| return { predictions }; |
| winner: game.winner, | ||
| }, | ||
| }; | ||
| return game; |
There was a problem hiding this comment.
The return structure has changed from an object with a game property to returning the game object directly. This is a breaking change that will cause existing E2E tests to fail. The tests in apps/comps/e2e/tests/nfl-competition.test.ts expect to access data.game (lines 664, 852, 853), but this change makes the game object the top-level return value.
If this breaking change is intentional, the E2E tests need to be updated accordingly. If not, the return structure should be preserved as { game } for backward compatibility.
| return game; | |
| return { game }; |
oRPC handles serialization of
Date,bigint, etc, so we don't have to. This was just bothering me, it doesn't change anything about the logic of functionality of things.