Skip to content

fix: Update timerifyMethods to include resolveFromAST#1814

Merged
webpro merged 1 commit into
webpro-nl:mainfrom
gwagjiug:fix/performance-resolve-from-ast-hook
Jun 25, 2026
Merged

fix: Update timerifyMethods to include resolveFromAST#1814
webpro merged 1 commit into
webpro-nl:mainfrom
gwagjiug:fix/performance-resolve-from-ast-hook

Conversation

@gwagjiug

@gwagjiug gwagjiug commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a typo in the plugin performance instrumentation hook list.

packages/knip/src/plugins.ts currently includes resolveAST as one of the hooks to wrap with timerify. However, the actual plugin hook is named resolveFromAST, as defined in the Plugin type.

Because of this mismatch, --performance did not collect function-level timing information for plugin resolveFromAST hooks.

Changes

  • Replace resolveAST with resolveFromAST in the performance hook list.
  • Align the performance instrumentation with the actual Plugin hook name.

Verification

I verified the change with:

pnpm lint
pnpm run --dir packages/knip build
node packages/knip/dist/cli.js --directory packages/knip/fixtures/plugins/next --performance --no-exit-code

After this change, the performance output includes timing information for resolveFromAST plugin hooks.

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/knip@1814
npm i https://pkg.pr.new/@knip/language-server@1814
npm i https://pkg.pr.new/@knip/mcp@1814

commit: 1a83e87

@webpro
webpro merged commit 3c8deac into webpro-nl:main Jun 25, 2026
27 of 30 checks passed
@webpro

webpro commented Jun 25, 2026

Copy link
Copy Markdown
Member

Thank you!

@gwagjiug
gwagjiug deleted the fix/performance-resolve-from-ast-hook branch June 25, 2026 10:35
@webpro

webpro commented Jun 25, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.21.0. See Release 6.21.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

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