perf(cli): isolate leaderboard calculation - #205
Conversation
|
also - this is just a start, have some other changes lined up that would shrink the entire CLI, but thought i'd split em up to make it easier for you to review |
es3n1n
left a comment
There was a problem hiding this comment.
since you moved the score provider to score.ts, maybe it would make sense to split all of them like this? probably in a new subfolder in providers though
|
sorry for the delays in my response, i was out of office this entire time 🙃 i will do a more thorough review later on this week |
yeah agreed, that's where the rest of the changes were also headed. i was thinking in
no worries! hope you had fun at defcon :) (so much fomo lol) |
do you want to try these new github stacked prs for this? |
that'd be great but seems like it's not possible to do stacked PRs across different repos... since i’m sending these PRs from my fork, i think we could only use that if i had collaborator access here. |
|
oof yeah, i see. makes sense. you can just add these changes to this pr then i think |
123fcf5 to
844eb58
Compare
yeah, all done |
|
Thank you! |
Summary
Part of #190.
Motivation
The seed command only needs leaderboard calculation and score-provider functionality, but its imports previously traversed broad API service and provider barrels. This pulled unrelated provider SDKs and services into the seed dependency graph, preventing Bun from tree-shaking them.
The new module boundaries allow the seed entry point to import only what it uses.
Bundle impact
Measured from
apps/cliwith:This is a reduction of approximately 70%. AWS SDK, Nodemailer, and Google Cloud dependencies are no longer included in the seed graph.
This PR does not materially reduce the complete CLI bundle yet. Other CLI entry points still import the full provider barrel; those will be handled separately.
Behavior
Leaderboard query and calculation logic is unchanged; this is a module-boundary refactor.
Score-provider configuration is now validated when the scoring module is loaded rather than whenever the general provider barrel is imported. The API server continues to load it during startup through the leaderboard workers.
Verification
oxlint --deny-warningspasses.