feat: use --before to show old versions in package timeline - #3264
nicolo-ribaudo wants to merge 1 commit into
Conversation
Thanks for opening this pull request! 🎉We really appreciate you taking the time to contribute, @nicolo-ribaudo. A maintainer will take a look as soon as they can. In the meantime, please make sure that:
If anything needs adjusting we'll leave comments here. Thanks again! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: npmx-dev/npmx.dev/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds frozen-history dependency resolution for install-size data. It adds server and client mode selection, separate caches, timeline controls, package-page display logic, localisation, documentation, and tests. ChangesFrozen history support
Sequence Diagram(s)sequenceDiagram
participant User
participant TimelineChart
participant TimelineEndpoint
participant InstallSize
participant DependencyResolver
User->>TimelineChart: change frozen-history setting
TimelineChart->>TimelineEndpoint: request sizes with frozen-history flag
TimelineEndpoint->>InstallSize: calculate sizes with historical limit
InstallSize->>DependencyResolver: resolve dependencies before cutoff
DependencyResolver-->>InstallSize: resolved dependency tree
InstallSize-->>TimelineEndpoint: size metrics
TimelineEndpoint-->>TimelineChart: mode-specific metrics
Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The frozen-history flow retains its intended route-refresh and monorepo release-batch behavior, with no concrete unresolved merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
--before to show old versions in package timeline--before to show old versions in package timeline
|
It's working for me locally, but not in the PR preview. Any idea of what I might need to look at to figure out why? |
🔗 Linked issue
None -- we briefly discussed this in Discord, I can create one if needed.
🧭 Context
Today we released a new version of Babel (8.0.6) that halved the package size. I went to npmx.dev's timeline view to get my daily dopamine dose, and unfortunately I saw that... Babel 8.0.6 was almost the same size as 8.0.5 :/
The reason is that
@babel/core@8.0.5depends on multiple other Babel packages; so it was now in the stats pulling the 8.0.6 version of them making it look like as if 8.0.5 was already small.📚 Description
This PR introduces a behavior similar to pnpm's
--before, making sure that a package's computed size reflects the latest state of the registry before that the next version was released. This is different from taking a snapshot when a given version is released, so that the shown size reflects what was the actual total size when that old version was still the current one.A couple notes:
--beforeand instead resolving to whatever are the latest dep versions in range. I think this is important for the "Install Size" information in a package's main page, this:that's because even if I'm looking at an older version, that number is mostly useful to answer the question "how big would it be if I were to add this version now to my dependencies?". On hover it then also shows the
--before-frozen size:I used an LLM to help with this; all the production code has been cleaned up / rewritten by me, but the tests are in large part auto-generated.