Skip to content

Revert "fix(runtime-core): pause tracking when invoking function refs" - #15094

Merged
edison1105 merged 1 commit into
mainfrom
revert-14985-edison/fix/runtime-core-function-ref-tracking
Jul 16, 2026
Merged

edison1105 merged 1 commit into
mainfrom
revert-14985-edison/fix/runtime-core-function-ref-tracking

Conversation

@edison1105

@edison1105 edison1105 commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

close #15039
close #15041

Reverts #14985 and restores dependency tracking inside function template refs.
As Evan clarified in #4084 and #4646, this is intentional behavior: function refs may run on each render, and their dependencies should be tracked because reactive state may determine which ref receives the value.
#14985 caused #15039, while #15041 introduced downstream regressions in radix-vue. Reverting is the smallest compatibility-preserving fix.

Summary by CodeRabbit

  • Bug Fixes
    • Updated function-based template refs to preserve dependency tracking during callback execution.
    • Removed outdated test coverage for the previous tracking behavior.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 937ac6fe-d9e1-41db-8dee-49a77ff654bd

📥 Commits

Reviewing files that changed from the base of the PR and between 90aecb1 and ce6727d.

📒 Files selected for processing (2)
  • packages/runtime-core/__tests__/rendererTemplateRef.spec.ts
  • packages/runtime-core/src/rendererTemplateRef.ts
💤 Files with no reviewable changes (1)
  • packages/runtime-core/tests/rendererTemplateRef.spec.ts

📝 Walkthrough

Walkthrough

Function template refs no longer pause and reset dependency tracking around callback invocation. The related regression test asserting untracked dependency reads was removed, and the reactivity import was updated accordingly.

Changes

Template ref callback tracking

Layer / File(s) Summary
Remove function-ref tracking suppression
packages/runtime-core/src/rendererTemplateRef.ts, packages/runtime-core/__tests__/rendererTemplateRef.spec.ts
Function template ref callbacks are invoked directly without pauseTracking() and resetTracking(), and the corresponding non-tracking test is removed.

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

Possibly related PRs

  • vuejs/core#14985: Introduced tracking suppression around function template ref callbacks.
  • vuejs/core#14986: Also changes tracking behavior around function template ref invocation.

Suggested labels: :hammer: p3-minor-bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change removes pauseTracking instead of deferring component function refs and does not add the exposed-ref regression coverage required by #15039/#15041. Implement the deferred post-render path for stateful component function refs, keep pauseTracking, and add the exposed template-ref regression test.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reverting the function-ref tracking pause.
Out of Scope Changes check ✅ Passed The edits are confined to rendererTemplateRef logic and its related test, matching the ref-tracking revert.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-14985-edison/fix/runtime-core-function-ref-tracking

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15094
npm i https://pkg.pr.new/@vue/compiler-core@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15094
npm i https://pkg.pr.new/@vue/compiler-dom@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15094
npm i https://pkg.pr.new/@vue/compiler-sfc@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15094
npm i https://pkg.pr.new/@vue/compiler-ssr@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15094
npm i https://pkg.pr.new/@vue/reactivity@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15094
npm i https://pkg.pr.new/@vue/runtime-core@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15094
npm i https://pkg.pr.new/@vue/runtime-dom@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15094
npm i https://pkg.pr.new/@vue/server-renderer@15094
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15094
npm i https://pkg.pr.new/@vue/shared@15094
yarn add https://pkg.pr.new/@vue/[email protected]

vue

pnpm add https://pkg.pr.new/vue@15094
npm i https://pkg.pr.new/vue@15094
yarn add https://pkg.pr.new/[email protected]

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15094
npm i https://pkg.pr.new/@vue/compat@15094
yarn add https://pkg.pr.new/@vue/[email protected]

commit: ce6727d

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 107 kB (-24 B) 40.4 kB (-7 B) 36.3 kB (-21 B)
vue.global.prod.js 165 kB (-24 B) 60.4 kB (-3 B) 53.8 kB (+99 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49.2 kB (-24 B) 19.1 kB (-8 B) 17.5 kB (-9 B)
createApp 57.3 kB (-24 B) 22.2 kB (-3 B) 20.3 kB (-7 B)
createSSRApp 61.9 kB (-24 B) 24.1 kB (-5 B) 22 kB (+6 B)
defineCustomElement 63.5 kB (-24 B) 24.1 kB (-1 B) 22 kB (-9 B)
overall 71.9 kB (-24 B) 27.5 kB (-6 B) 25 kB (-5 B)

@edison1105
edison1105 merged commit 7da6334 into main Jul 16, 2026
13 checks passed
@edison1105
edison1105 deleted the revert-14985-edison/fix/runtime-core-function-ref-tracking branch July 16, 2026 01:51
edison1105 added a commit that referenced this pull request Jul 16, 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.

Function refs on components are invoked before exposed template refs become available since 3.5.39

1 participant