Skip to content

fix(types): add hotUpdateCallback to auto-resolver handleHotUpdate - #2836

Merged
posva merged 1 commit into
mainfrom
fix/auto-resolver-hmr-callback-type
Oct 9, 2026
Merged

posva merged 1 commit into
mainfrom
fix/auto-resolver-hmr-callback-type

Conversation

@posva

@posva posva commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Declare the optional hotUpdateCallback that the generated vue-router/auto-resolver module already accepts and calls with the new resolver.

Summary by CodeRabbit

  • New Features
    • Hot-update handling now accepts an optional callback that receives the router’s updated resolver, allowing applications to respond when the resolver changes.
  • TypeScript
    • Added type checks for the resolver callback, including validation of its accepted argument type.

@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vue-router canceled.

Name Link
🔨 Latest commit c690fba
🔍 Latest deploy log https://app.netlify.com/projects/vue-router/deploys/6ac8fb2c4c48b800089245ca

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: vuejs/router/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0e7944c-b519-465c-8d30-53d5f054fcc3

📥 Commits

Reviewing files that changed from the base of the PR and between 8acc2bb and c690fba.


📒 Files selected for processing (3)
  • packages/router/test-dts/auto-resolver.test-d.ts
  • packages/router/test-dts/tsconfig.experimental.json
  • packages/router/vue-router-auto-resolver.d.mts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.



📝 Walkthrough

Walkthrough

The auto-resolver declaration adds an optional hot-update callback that receives the new resolver. TypeScript tests check the exported resolver type and callback signature.

Changes

Auto-resolver types

Layer / File(s) Summary
Hot-update callback declaration
packages/router/vue-router-auto-resolver.d.mts
handleHotUpdate now accepts an optional callback that receives the new resolver. The declaration documentation describes callback timing and includes an example.
Resolver type checks
packages/router/test-dts/tsconfig.experimental.json, packages/router/test-dts/auto-resolver.test-d.ts
The experimental TypeScript configuration maps and includes the auto-resolver type test. The test checks the exported resolver type and verifies accepted and rejected callback types.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to c690f

No actionable issue remains in the supplied review evidence; this change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding the optional hotUpdateCallback type to auto-resolver's handleHotUpdate.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/vue-router@2836
npm i https://pkg.pr.new/vue-router@2836
yarn add https://pkg.pr.new/vue-router@2836.tgz

commit: c690fba

@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.27%. Comparing base (8acc2bb) to head (c690fba).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2836   +/-   ##
=======================================
  Coverage   88.27%   88.27%           
=======================================
  Files          78       78           
  Lines        6305     6305           
  Branches     2047     2047           
=======================================
  Hits         5566     5566           
  Misses        650      650           
  Partials       89       89           

☔ View full report in Codecov by Harness.
📢 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.

@posva
posva merged commit 0729ce7 into main Oct 9, 2026
11 checks passed
@posva
posva deleted the fix/auto-resolver-hmr-callback-type branch October 9, 2026 14:49
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