-
- Notifications
You must be signed in to change notification settings - Fork 8.8k
feat(runtime-vapor): use shallow clone to support shallowRef in v-for #12985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: minor
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vapor-repl ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File ( |
Size ReportBundles
Usages
|
| ||
// change deep value should not update | ||
// change | ||
list.value[0].name = 'a' | ||
setList() | ||
await nextTick() | ||
expect(host.innerHTML).toBe( | ||
'<li>0. 1</li><li>1. 2</li><li>2. 3</li><li>3. 4</li><!--for-->', | ||
'<li>0. a</li><li>1. 2</li><li>2. 3</li><li>3. 4</li><!--for-->', | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature was initially removed for performance optimization:
vuejs/vue-vapor#280
vuejs/vue-vapor@b962aa5
REPL
Using the
rows.slice()
(shallow copy) to replaced therows
, only the content inside v-for hasn't changed, which is inconsistent with the behavior of the Virtual DOM.So I created a shallow clone for the item when the source is a not a reactive object .