Skip to content

perf: defer validate and review imports in maintainer command - #345

Merged
LadyBluenotes merged 1 commit into
mainfrom
perf/static-loaded-command-imports
Oct 19, 2026
Merged

LadyBluenotes merged 1 commit into
mainfrom
perf/static-loaded-command-imports

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 Changes

  • maintainer.ts statically imported runReviewCommand (./review.js), runValidateCommand (./validate.js), and describeSkillExamples (../validate/blocks.js), which loaded the validation, example-checking, and review command chunks on every intent maintainer invocation (setup, add, remove, sync, status --json) and caused Rolldown to emit a duplicate dist/review-*.mjs (0.09 kB) facade chunk.
  • Defer ./review.js to the action === 'review' branch, ./validate.js to action === 'check', and ../validate/blocks.js to non-JSON action === 'status'.
  • Eliminates the dist/review-*.mjs facade chunk and keeps validate-*.mjs, blocks-*.mjs, review-*.mjs, and workflow-review-*.mjs (~78 kB combined) off the startup path of maintainer setup, add, remove, sync, and status --json.
  • Command output and exit codes do not change.
Benchmark (benchmarks/intent/maintainer.bench.ts, Vitest 4.1.11 on Windows Node) main (cb45f14) mean (min / rme) PR (d54c07e) mean (min / rme) Change
maintainer setup with 20 existing skills 240.04 ms (min 233.73 ms, ±1.09%) 229.63 ms (min 220.41 ms, ±2.22%) -4.3% (-10.4 ms)

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d54c07e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/intent Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b044a0ec-658a-4947-9b63-5aa28616064e
📥 Commits

Reviewing files that changed from the base of the PR and between 9400b3e and d54c07e.

📒 Files selected for processing: 2
  • .changeset/defer-maintainer-validate-review.md
  • packages/intent/src/commands/maintainer.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit d54c07e

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 1m 4s View ↗
nx run-many --targets=build ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-19 01:19:40 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@345

commit: d54c07e

@codspeed

codspeed Bot commented Oct 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 9 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 7 benchmarks have no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 12 untouched benchmarks


Comparing perf/static-loaded-command-imports (d54c07e) with main (9400b3e)

Open in CodSpeed

@LadyBluenotes
LadyBluenotes merged commit fbabfec into main Oct 19, 2026
10 checks passed
@LadyBluenotes
LadyBluenotes deleted the perf/static-loaded-command-imports branch October 19, 2026 01:23
@github-actions github-actions Bot mentioned this pull request Oct 19, 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.

1 participant