Skip to content

[RFC] Surface Inline Bundled Dependencies in Package Pages #1736

@sxzz

Description

@sxzz

Summary

Add first-class UI support for packages that physically inline their dependencies into their published tarball — making it possible for developers and consumers to understand what packages are silently shipped inside a bundle, and optionally estimate their implied download contribution.

npmx would recognize two sources of this information: the existing bundleDependencies / bundledDependencies field already supported by npm, and a new proposed inlinedDependencies field being discussed at e18e.

Note: The design of the inlinedDependencies field itself — naming, shape, and adoption strategy — is being discussed separately at e18e/ecosystem-issues#237. This RFC focuses on how npmx consumes and surfaces the data, assuming that standard lands.

Background: bundleDependencies Already Exists — But Is Not Enough

npm already supports a bundleDependencies field. When set, npm pack copies the listed packages from node_modules directly into the tarball. This is the mechanism behind packages like vite shipping cac — every npm install vite delivers a copy of cac, yet cac's download count reflects none of this. cac has 20M weekly downloads, and the real number is even higher.

However, bundleDependencies only covers the "copy from node_modules" case. It does not cover bundler-inlined code (Rollup, esbuild, etc.), which is equally common. The proposed inlinedDependencies field fills this gap as purely declarative metadata, covering any inlining method.

Proposed npmx Features

1. Display inlined dependencies on package pages

npmx would read both bundleDependencies / bundledDependencies and inlinedDependencies from the published package.json, surfacing them in a unified "Inlined Dependencies" section alongside the existing Dependencies / Dev Dependencies / Peer Dependencies panels.

Each entry should link to the inlined package's own npmx page, show the resolved version, and be visually distinguished to make the inlining relationship immediately clear.

2. Implied / Shadow Download Estimates

For each inlined dependency, npmx could display an "implied downloads" metric — an estimate of how many additional downloads the inlined package effectively received by being shipped inside the parent.

implied_downloads(inlined_pkg, parent_pkg) ≈ downloads(parent_pkg, period)

This could be surfaced in two places:

A. On the parent package page — show each inlined dep alongside the parent's download count as its implied contribution.

B. On the inlined package's own page — aggregate implied downloads from all packages that inline it:

Downloads (last week)
  Direct:    340,000
  Implied: 15,100,000  (via vite and 2 other packages)
  ──────────────────────
  Total:   15,440,000

3. Ecosystem-level "Most Inlined" discovery

A dedicated explore/stats page listing the most frequently inlined packages, ranked by number of packages that inline them or total implied download volume.

Implementation Notes

  • npmx reads both bundleDependencies / bundledDependencies (existing) and inlinedDependencies (proposed, pending e18e discussion) from the published package.json.
  • For implied downloads, npmx would query the npm download API (https://api.npmjs.org/downloads/point/{period}/{package}) per parent package, lazily and with caching to manage API load.
  • Tarball inspection as a fallback for undeclared inlined deps is out of scope for this RFC.

Open Questions

  1. Should "implied downloads" be opt-in in the UI to avoid confusing users unfamiliar with the concept?
  2. Should npmx display bundleDependencies-sourced entries differently from inlinedDependencies-sourced entries?
  3. Naming the metric — "Implied Downloads", "Shadow Downloads", "Bundled Reach"? Open to suggestions.

Alternatives Considered

  • Do nothing: leaves a meaningful gap in ecosystem visibility.
  • Show inlined deps without download estimates: a reasonable v1 scope.

Checklist

  • Community feedback on UI design
  • Agreement on "implied downloads" methodology
  • API rate limit / caching strategy for download queries
  • Design mockups
  • inlinedDependencies standard finalized at e18e

This is an RFC — all details are open for discussion. For questions about the inlinedDependencies field standard itself, please join the conversation at e18e/ecosystem-issues#237.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions