GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: preserve custom tap options dropped by _tap fast path by alexander-akait · Pull Request #227 · webpack/tapable

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Apr 21, 2026

Copy link
Copy Markdown
Member

The fast path added in 9e9ae4d (fix(perf): improve (#224)) only checks
for a fixed set of properties (before/stage/context/type/fn) before
rebuilding the options descriptor as { type, fn, name }. Any custom
user-provided property - notably webpack's additionalAssets, used by
the processAssets hook - was silently dropped, breaking the webpack
ConfigTestCases > process-assets > additional-assets test.

Tighten the fast-path guard to a strict "only name" check via
Object.keys length, preserving the hidden-class optimization for the
common hook.tap({ name: "X" }, fn) case while restoring correctness
for every other call shape.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
claude added 2 commits April 21, 2026 04:00
@claude
fix: preserve custom tap options dropped by _tap fast path
f208db9
The fast path added in 9e9ae4d (fix(perf): improve (#224)) only checks
for a fixed set of properties (before/stage/context/type/fn) before
rebuilding the options descriptor as `{ type, fn, name }`. Any custom
user-provided property - notably webpack's `additionalAssets`, used by
the processAssets hook - was silently dropped, breaking the webpack
`ConfigTestCases > process-assets > additional-assets` test.

Tighten the fast-path guard to a strict "only name" check via
Object.keys length, preserving the hidden-class optimization for the
common `hook.tap({ name: "X" }, fn)` case while restoring correctness
for every other call shape.
@claude
perf(Hook): replace Object.keys with for-in in only-name guard
4622404
The previous fix used `Object.keys(options).length === 1` to check
whether the tap options object carries any properties beyond `name`
before taking the fast-path literal construction. `Object.keys`
allocates an intermediate array on every call, costing ~10% on the
common `hook.tap({ name: "X" }, fn)` shape vs the (broken) baseline.

Swapping to a `for...in` scan with an early-break avoids that
allocation and pulls the regression down to within measurement noise
(~3%), while keeping the correctness property - any extra user-
supplied key (e.g. webpack's `additionalAssets`) forces the safe
`Object.assign` slow path.

Benchmarked locally with tinybench, 10 taps per iteration, mean of
three runs:

  shape                      broken     for-in     delta
  string                     2.66M      2.50M      -6%
  {name}                     2.16M      2.10M      -3%
  {name,stage}               1.01M      0.98M      -3%
  {name,additionalAssets}    2.19M      1.15M      -48% *
  {name,before}              511K       491K       -4%

  * inherent: this shape must now take the correct slow path since
    the previous "fast" speed was produced by dropping the property.
@changeset-bot

changeset-bot Bot commented Apr 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4622404

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 21, 2026

Copy link
Copy Markdown

CLA Not Signed

  • ❌ - login: @claude / name: Claude . The commit (4622404, f208db9) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.

claude[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Apr 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.35%. Comparing base (5da5021) to head (4622404).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #227      +/-   ##
==========================================
+ Coverage   99.09%   99.35%   +0.25%     
==========================================
  Files          15       15              
  Lines         775      775              
  Branches      132      128       -4     
==========================================
+ Hits          768      770       +2     
+ Misses          7        5       -2     
Flag Coverage Δ
integration 99.35% <100.00%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Apr 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 92 untouched benchmarks


Comparing claude/fix-additional-assets-test-IdN0k (4622404) with main (5da5021)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait merged commit 780b3c0 into main Apr 21, 2026
33 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the claude/fix-additional-assets-test-IdN0k branch April 21, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@alexander-akait @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.