Skip to content

fix(runtime-vapor): avoid fast remove for component v-for#14889

Merged
edison1105 merged 5 commits into
minorfrom
edison/fix/vForFastRemove
May 28, 2026
Merged

fix(runtime-vapor): avoid fast remove for component v-for#14889
edison1105 merged 5 commits into
minorfrom
edison/fix/vForFastRemove

Conversation

@edison1105
Copy link
Copy Markdown
Member

@edison1105 edison1105 commented May 28, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed component unmounting issue when clearing v-for lists with fast removal optimization enabled.
    • Improved handling of default values in v-for destructuring patterns for correct updates.
    • Enhanced v-for source validation with warnings for non-integer or negative numeric values.
  • Tests

    • Added comprehensive test coverage for v-for edge cases and slot default values.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 09e50197-4d48-42d2-87a6-667998eca23c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edison/fix/vForFastRemove

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 28, 2026

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 04c6153

@github-actions
Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 86.5 kB 30.3 kB 26.6 kB
runtime-dom.global.prod.js 113 kB 42.6 kB 38.2 kB
vue.global.prod.js 172 kB 62.4 kB 55.6 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 51.6 kB 20.1 kB 18.3 kB
createApp 60.6 kB 23.5 kB 21.3 kB
createApp + vaporInteropPlugin 106 kB 38.1 kB 34.4 kB
createVaporApp 29.1 kB 11.2 kB 10.3 kB
createSSRApp 65.1 kB 25.3 kB 22.9 kB
createVaporSSRApp 35.4 kB 13.4 kB 12.3 kB
defineCustomElement 67.2 kB 25.5 kB 23.1 kB
defineVaporCustomElement 41.2 kB 14.8 kB 13.5 kB
overall 75.9 kB 28.9 kB 26.2 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/runtime-vapor/src/apiCreateFor.ts`:
- Around line 768-773: The warning text is inconsistent with the check in the
v-for range code that allows 0 (it tests Number.isInteger(source) and source <
0), so update the warn message invoked in the __DEV__ block (the warn call
referencing source and setting values = []) to state "non-negative integer" (or
"integer greater than or equal to 0") instead of "positive integer" so the
message matches the behavior of the Number.isInteger(source) || source < 0
check; alternatively, if strict positivity is desired, change the condition to
source <= 0 and keep the original message—adjust the warn call surrounding the
variables __DEV__, source, warn, and values accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c426e8dc-8623-446d-b7ef-5cd96671c0c7

📥 Commits

Reviewing files that changed from the base of the PR and between 520ee6f and 04c6153.

⛔ Files ignored due to path filters (2)
  • packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap is excluded by !**/*.snap
  • packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • packages/compiler-vapor/__tests__/transforms/vFor.spec.ts
  • packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts
  • packages/compiler-vapor/src/generators/for.ts
  • packages/runtime-vapor/__tests__/for.spec.ts
  • packages/runtime-vapor/src/apiCreateFor.ts

Comment thread packages/runtime-vapor/src/apiCreateFor.ts
@edison1105 edison1105 merged commit 9691bc5 into minor May 28, 2026
21 of 23 checks passed
@edison1105 edison1105 deleted the edison/fix/vForFastRemove branch May 28, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant