Skip to content

fix(compiler-core): correct filter rewrite recursion#14959

Open
alentide wants to merge 1 commit into
vuejs:mainfrom
alentide:fix-compiler-filter-recursion
Open

fix(compiler-core): correct filter rewrite recursion#14959
alentide wants to merge 1 commit into
vuejs:mainfrom
alentide:fix-compiler-filter-recursion

Conversation

@alentide

@alentide alentide commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

In rewriteFilter, the branch handling COMPOUND_EXPRESSION children recursively calls rewriteFilter(node...) instead of rewriteFilter(child...), so the function would never make progress if that branch were reached.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a compiler bug where filters were not correctly processed in nested expressions. Filters will now be properly applied to complex nested expression structures.

@coderabbitai

coderabbitai Bot commented Jun 14, 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: 9fc99792-2b80-47bd-bd26-90a6132699c0

📥 Commits

Reviewing files that changed from the base of the PR and between 478e3e8 and 9bdeb7c.

📒 Files selected for processing (1)
  • packages/compiler-core/src/compat/transformFilter.ts

📝 Walkthrough

Walkthrough

In rewriteFilter, the COMPOUND_EXPRESSION branch was recursively calling rewriteFilter(node, ...) (the parent) instead of rewriteFilter(child, ...). The fix changes the argument to child so the traversal descends into nested expressions correctly.

Changes

Filter Rewrite Recursion Fix

Layer / File(s) Summary
Fix rewriteFilter recursion target
packages/compiler-core/src/compat/transformFilter.ts
The recursive call in the COMPOUND_EXPRESSION branch is corrected from rewriteFilter(node, ...) to rewriteFilter(child, ...), ensuring nested expression structures are traversed rather than the parent node being re-processed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hopped through nested trees,
But kept returning to the leaves above.
One word changed — now child, not node
And filters flowed as they should.
🐇✨ Down the branches, finally free!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and concisely describes the primary fix in the changeset: correcting a recursion bug in the filter rewrite functionality.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 106 kB 40.2 kB 36.1 kB
vue.global.prod.js 164 kB 60.2 kB 53.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.8 kB 19 kB 17.4 kB
createApp 56.9 kB 22 kB 20.1 kB
createSSRApp 61.2 kB 23.8 kB 21.7 kB
defineCustomElement 63.1 kB 23.9 kB 21.8 kB
overall 71.7 kB 27.4 kB 25 kB

@pkg-pr-new

pkg-pr-new Bot commented Jun 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@14959
npm i https://pkg.pr.new/@vue/compiler-core@14959
yarn add https://pkg.pr.new/@vue/compiler-core@14959.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@14959
npm i https://pkg.pr.new/@vue/compiler-dom@14959
yarn add https://pkg.pr.new/@vue/compiler-dom@14959.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@14959
npm i https://pkg.pr.new/@vue/compiler-sfc@14959
yarn add https://pkg.pr.new/@vue/compiler-sfc@14959.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@14959
npm i https://pkg.pr.new/@vue/compiler-ssr@14959
yarn add https://pkg.pr.new/@vue/compiler-ssr@14959.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@14959
npm i https://pkg.pr.new/@vue/reactivity@14959
yarn add https://pkg.pr.new/@vue/reactivity@14959.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@14959
npm i https://pkg.pr.new/@vue/runtime-core@14959
yarn add https://pkg.pr.new/@vue/runtime-core@14959.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@14959
npm i https://pkg.pr.new/@vue/runtime-dom@14959
yarn add https://pkg.pr.new/@vue/runtime-dom@14959.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@14959
npm i https://pkg.pr.new/@vue/server-renderer@14959
yarn add https://pkg.pr.new/@vue/server-renderer@14959.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@14959
npm i https://pkg.pr.new/@vue/shared@14959
yarn add https://pkg.pr.new/@vue/shared@14959.tgz

vue

pnpm add https://pkg.pr.new/vue@14959
npm i https://pkg.pr.new/vue@14959
yarn add https://pkg.pr.new/vue@14959.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@14959
npm i https://pkg.pr.new/@vue/compat@14959
yarn add https://pkg.pr.new/@vue/compat@14959.tgz

commit: 9bdeb7c

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