Skip to content

Superseded by #179 - #172

Closed
lukekania wants to merge 2 commits into
milestone/v0.11.0-builder-parityfrom
feat/bundler-per-provider-shake
Closed

Superseded by #179#172
lukekania wants to merge 2 commits into
milestone/v0.11.0-builder-parityfrom
feat/bundler-per-provider-shake

Conversation

@lukekania

@lukekania lukekania commented May 18, 2026

Copy link
Copy Markdown
Owner

Superseded by #179. The closing-link to issue 171 is sticky GitHub state from this PR's original body — see #179 for the actual work.

Generalize cross-chunk used-names collection so every chunk gets its own
externally-used set, not just main. Vendor chunks holding `@angular/core`
or `rxjs` previously pinned every export the package declared because
`externally_used = None` made the shaker fall back to entry-walk
reachability — on `index.mjs`-style packages that reaches almost
everything.

- `shake::collect_cross_chunk_used_names_per_provider` returns
  `Vec<HashSet<String>>` indexed by chunk index; for each chunk i it
  collects the names other chunks import from any module in i.
- `bundle()` builds a bare-specifier → canonical-path map from the
  existing namespace tables so bare imports (`'@angular/core'`) attribute
  to the owning vendor chunk, then feeds `externally_used_per_chunk[idx]`
  into `analyze_unused_exports` for every chunk — the `is_main` gate is
  dropped.
- `npm_wrap::wrap_npm_module` now accepts `unused_exports` and drops both
  the unused `export const X = ...` declarations and the matching
  `__exports.X = ns.X` re-export bridges, so shake decisions reach the
  emitted vendor chunk code.

Bumps version to 0.10.13.
@lukekania
lukekania changed the base branch from main to milestone/v0.11.0-builder-parity May 18, 2026 08:24
@lukekania lukekania changed the title feat(bundler): per-provider tree-shake for vendor chunks (#171) feat(bundler): per-provider tree-shake for vendor chunks May 18, 2026
@lukekania lukekania changed the title feat(bundler): per-provider tree-shake for vendor chunks feat(bundler): per-provider tree-shake for vendor chunks (#171) May 18, 2026
@lukekania

Copy link
Copy Markdown
Owner Author

Recreating as a new PR without the sticky auto-close link to #171.

@lukekania lukekania closed this May 18, 2026
@lukekania lukekania changed the title feat(bundler): per-provider tree-shake for vendor chunks (#171) feat(bundler): per-provider tree-shake for vendor chunks superseded May 18, 2026
@lukekania lukekania changed the title feat(bundler): per-provider tree-shake for vendor chunks superseded Superseded by #179 May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(bundler): per-provider tree-shake for vendor chunks

1 participant