Implement jsdelivr optimization for GitHub packages in bun install
- Dominant language
- Rust
- Stars
- 96k
- Forks
- 5k
- Avg merge
- 19h 29m
- Merged PRs (30d)
- 190
Description
In bun install, we can fetch the package.json & start enqueing dependencies before the tarball for GitHub packages by reading the package.json from jsdelivr. Using jsdelivr should work better than GitHub proper because we won’t get rate limited and I’m pretty sure it works in China too.
We will need to be careful of caching, to only do this step when the tarball for that version hasn’t previously been downloaded or else it will be slower than not doing this
This should be prioritized to do after priviligedDependencies and after workspace names glob star matching. I haven’t benchmarked if this actually makes it faster but pretty sure the extra request is worth it when there are > 0 packages to install because of the waterfall problem
Contributor guide
Research direction
Start by tracing bun install's GitHub package tarball fetching and caching flow, then inspect where dependencies are enqueued. Evaluate retrieving package.json from jsdelivr and ensure this happens only when that version's tarball is not already cached. Done means dependencies can be enqueued before the tarball without slowing cached installs, with the work considered after privilegedDependencies and workspace name glob matching.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, javascript, rust
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100