Skip to content
Source
Sign inSign up
TanStack/intent

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

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/345/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

🎯 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 skills240.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).
    1. 🦋 Changeset detected

      Latest commit: d54c07e2bf7087efb2f8a0f59761624d00b9d7dc

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

      This PR includes changesets to release 1 package
      NameType
      @tanstack/intentPatch

      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

    2. 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 9400b3ea5ad5c378f04993fa197cacfe7c1c05ac and d54c07e2bf7087efb2f8a0f59761624d00b9d7dc.

      📒 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.
    3. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit d54c07e2bf7087efb2f8a0f59761624d00b9d7dc

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded1m 4sView ↗
      nx run-many --targets=build✅ Succeeded1sView ↗

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

    4. Open in StackBlitz

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

      commit: d54c07e

    5. Merging this PR will not alter performance

      :warning: 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

      :information_source: 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

Sign in to join this conversation.