Skip to content

v10: merge results of separate runs - #651

Draft
bartveneman wants to merge 1 commit into
claude/incremental-analyzerfrom
claude/merge-support
Draft

bartveneman wants to merge 1 commit into
claude/incremental-analyzerfrom
claude/merge-support

Conversation

@bartveneman

Copy link
Copy Markdown
Member

Stacked on #647 (base is its branch, so the diff only shows merge support). Split off to keep #647 smaller to review and the package smaller to ship. Opened as a draft on purpose.

What it adds

  • merge(a, b): combines results that were computed independently (workers, one run per page, coverage runs). Pass the collectors as a third argument for results that lost their origin (e.g. after structuredClone).
  • define_collector(init, merge): every collector provides a merge function for its own result.
  • merge_counts, merge_context_counts and merge_defined_used for custom collectors.
  • A test for every collector that merging two results equals adding both inputs to one analyzer, and that defined/used names (keyframes, containers, layers, custom properties) combine across runs.
  • The readme and migration guide mention it again.

create_analyzer().add() (many inputs in one analyzer) stays in #647.

How this branch is built

It is #647 plus one commit that reverts "move merge support out of this PR", so merging it later is a clean re-add. Merge #647 first; GitHub will retarget this PR to main when #647's branch is deleted.


Generated by Claude Code

@pkg-pr-new

pkg-pr-new Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@projectwallace/css-analyzer@e75bd01

commit: e75bd01

@bartveneman
bartveneman changed the base branch from claude/sleepy-tesla-tu72wq to claude/incremental-analyzer November 7, 2026 19:09
@bartveneman
bartveneman force-pushed the claude/incremental-analyzer branch from 229c7c0 to 26bf8d5 Compare November 7, 2026 19:15
Adds merging back on top of the v10 branch:

- `merge(a, b)` combines results that were computed independently
  (workers, one run per page, coverage runs); pass the collectors as a
  third argument for results that lost their origin
- every collector provides a `merge` function: `define_collector(init,
  merge)`; counters, context counters and defined/used names have
  `merge_counts`, `merge_context_counts` and `merge_defined_used`
- merging results equals adding both inputs to one analyzer, tested for
  every collector

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bartveneman
bartveneman force-pushed the claude/incremental-analyzer branch from 26bf8d5 to c9f49a4 Compare November 7, 2026 19:25
bartveneman pushed a commit that referenced this pull request Nov 11, 2026
…documents ./utils/collections and comment handlers (4.2)
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.

2 participants